Google Sheets function · Info
CELL in Google Sheets: syntax and examples
CELL reports facts about one cell: where it is, what type of content it holds, what the content is. It is a small inspection tool, handy next to INDIRECT or in checks on imported data.
Syntax
CELL(info_type, reference)
Arguments
| Argument | Type | Required | What it does |
|---|---|---|---|
info_type | string | yes | What to report, such as "address", "row", "col", "contents" or "type". |
reference | cell | yes | The cell to inspect. |
Examples
The examples use this table, starting in A1:
| Item | Qty |
| Lamp | 12 |
| Chair | |
| 5 | 3 |
=CELL("address", B2)Result: $B$2
Absolute address of a cell, as text.
Run in a Google Sheet (English US locale) on .
=CELL("row", C4)Result: 4
Row number of a cell.
Run in a Google Sheet (English US locale) on .
=CELL("col", C4)Result: 3
Column number of a cell: C is 3.
Run in a Google Sheet (English US locale) on .
=CELL("contents", A2)Result: Lamp
The value stored in the cell.
Run in a Google Sheet (English US locale) on .
=CELL("type", A2)Result: l
Type of content: "l" for a text label, "v" for a value.
Run in a Google Sheet (English US locale) on .
Common errors
- The info_type is text and must be quoted. A name Sheets does not know returns #VALUE!.
- "address" returns an absolute reference with dollar signs, as text.
- "type" gives "b" for a blank cell, "l" for text and "v" for anything else, numbers included.
- Not every Excel info type works. CELL("filename", A1) returns #VALUE!, so test an info_type before copying it from an Excel file.
Compared with Excel
Excel has more info types, for example "filename", which returns #VALUE! in Google Sheets.