Category: FUNCTION | Updated: 2026-11-22
How to Use the CELL Function in Google Sheets | Get Cell Formatting, Position, and Content Information
CELL Function
The CELL function returns metadata about the formatting, location (row, column, address), or contents of a specified cell.
Syntax
=CELL(info_type, reference)
- info_type: Specifies the type of information to retrieve as a text string enclosed in double quotes.
"address": Returns the cell reference as an absolute reference string (e.g.,$B$2)."col": Returns the column number of the cell as a number."row": Returns the row number of the cell as a number."contents": Returns the value of the cell (the calculated result, not the formula)."type": Returns the data type (blank ="b", text ="l", other such as numbers ="v")."format": Returns a code corresponding to the number format (General ="G", Currency ="C2", Date ="D1", etc.)."width": Returns the column width as an integer.
- reference: Specifies the cell whose information you want to retrieve (if omitted, it targets the cell where the formula is entered).
Practical Table Example
This example specifies various info_type values for cell B2 (value: 1000, currency format).
| Cell | A (Information to Retrieve) | B (Formula) | C (Result) |
|---|---|---|---|
| 1 | Target data | 1000 (assuming cell B2) |
- |
| 2 | Cell address | =CELL("address", B2) |
$B$2 |
| 3 | Row number | =CELL("row", B2) |
2 |
| 4 | Column number | =CELL("col", B2) |
2 |
| 5 | Data type | =CELL("type", B2) |
v |
| 6 | Display format code | =CELL("format", B2) |
C0 |
Common Errors and Precautions
#VALUE!error: Occurs when an unsupported string is specified for the first argumentinfo_type. Options available in Excel’sCELLfunction such as"filename"(to get the file path) are not supported in Google Sheets.- Behavior with range references: If a multi-cell range (e.g.,
A1:C5) is specified forreference, only information for the top-left cell (A1) is returned. - Delayed reflection of format changes: If you change only the “number format” or “column width” rather than the target cell’s value, automatic spreadsheet recalculation may not trigger and the old result may remain.
Frequently Asked Questions
Q. What are the main 'info_type' values you can specify in the CELL function?
A. They include "address" (cell address), "row" (row number), "col" (column number), "contents" (cell value), "type" (data type), "format" (display format), and "width" (column width).
Q. Why doesn't the result of CELL("format", A1) update immediately after changing a cell's format?
A. Because the CELL function is designed to recalculate when a cell's value is edited, if you only change the display format, the result may not update until you reload or trigger a recalculation.