CELL function
CELL reports facts about a cell, such as its address, its column, or the workbook path. Leave out the reference and the result depends on the last cell edited.
Example
Read it as a sentence: give the address of cell D2.
Excel shows [Book5]Items!$D$2
D
1
Qty
2
12
Items
Syntax
CELL(info_type, [reference])
Arguments in [square brackets] are optional.
-
info_type(required) - Text naming what to report, such as "address", "col", "row", "filename", or "format".
-
reference(optional) - The cell to describe; defaults to the last changed cell.
Returns: The requested fact about the cell.
CELL is volatile: Excel works it out again every time anything in the workbook changes.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=CELL("address") | $A$1 | No reference |
=CELL("address",Items!D2) | [Book5]Items!$D$2 | Address |
=CELL("row",Items!D2) | 2 | Row |
=CELL("col",Items!D2) | 4 | Column |
=CELL("contents",Items!D2) | 12 | Contents |
=CELL("type",Items!B2) | l | Label |
=CELL("contents",Data!F5) | #DIV/0! | Contents of error formula |
=CELL("bogus",Items!B1) | #VALUE! | Bad info_type |
The Items sheet these formulas read
B
D
1
Item
Qty
2
Boxer cartridge
12
Items
The Data sheet these formulas read
A cell that starts with = holds that formula.
F
1
2
'123
3
2024-02-29
4
TRUE
5
=1/0
Data
Watch out for
- Omitting reference makes the result depend on the last edit.
- "filename" is blank until the workbook is saved.
Where it works
- Excel
- CELL is in every version of Excel from 2007 on.
- Google Sheets
- Same name, but behaves differently. Sheets supports fewer info types.
Part of Information functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .