CELL Function
Returns information about a cell (address, contents, format, etc.).
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| info_type | A quoted text string naming the info to return, such as "address", "contents", "row", "col", "width", "format", "type", or "filename". | Required |
| reference | The cell or range to inspect. If omitted, CELL uses the last cell that was changed. | Optional |
Basic Example
Get the absolute address of a cell
=CELL("address", A1)The "address" info type returns the absolute reference of the cell.
Advanced Examples
Example 1: Read a cell's contents
A1 contains 42.Return the value held in a cell
=CELL("contents", A1)Example 2: Get the row number
Find which row a cell is on.Return the row with "row"
=CELL("row", B5)How CELL Works
CELL returns a single piece of information about a cell chosen by info_type. Common types include "address" (absolute reference as text), "contents" (the cell's value), "row"/"col" (row/column numbers), "width" (column width), "format" (a code describing number format), "type" (b/l/v for blank/label/value), and "filename" (the full path and sheet). If reference is omitted, CELL refers to the last cell changed, which is unpredictable.
Important Notes & Limitations
Volatile: CELL recalculates on every change, which can slow large workbooks.
If reference is omitted, it refers to the last changed cell, which is unpredictable.
'filename' returns an empty string if the workbook has not been saved.
Common Errors & Fixes
#VALUE! errorAn invalid info_type string was supplied.Fix: Use a valid code such as "address", "row", or "format".
Stale filename or pathCELL('filename') result is cached until recalculation.Fix: Press F9 to recalculate and refresh the value.
Download Practice File
CELL
cellPractice CELL with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the CELL function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps