Get information about any cell — its format, its address, its contents type — without inspecting it manually.
CELL returns specific information about a cell — its formatting, its address, whether it's protected, what type of data it contains, and more. It's most useful for building dynamic references, troubleshooting formatting issues, and building smart audit formulas.
CELL(info_type, [reference])| Argument | What it means |
|---|---|
| info_type required | A text string specifying what information to return. See table below. |
| reference optional | The cell to get information about. If omitted, returns info about the last changed cell. |
| info_type | Returns |
|---|---|
| "address" | Absolute cell reference as text, e.g. "$A$1" |
| "col" | Column number of the cell |
| "row" | Row number of the cell |
| "type" | "b" = blank, "l" = label (text), "v" = value (number) |
| "format" | Text code representing the cell's number format |
| "filename" | Full path and filename of the workbook |
| "protect" | 1 if the cell is locked, 0 if not |
| "width" | Column width rounded to nearest integer |
=CELL("address", B5)
-- Returns "$B$5"
=CELL("type", A2)
-- Returns "v" if A2 contains a number, "l" if text, "b" if blank
=CELL("filename", A1)
-- Returns the full file path and sheet name -- useful for footer references
=CELL("row", A1)
-- Returns 1Combine CELL with MID and FIND to extract just the sheet name: =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
Type it in a live spreadsheet, get instant feedback. No videos, no downloads.
Start practising free →