Quick Answer

CELL Function

Returns information about a cell (address, contents, format, etc.).

✓ Excel✓ Google SheetsExcel All versions

Syntax

CELL
(info_type, [reference])

Parameters

ParameterDescriptionRequired
info_typeA quoted text string naming the info to return, such as "address", "contents", "row", "col", "width", "format", "type", or "filename".Required
referenceThe 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)
Result$A$1

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)
Result: 42
The "contents" info type returns the value stored in the referenced cell.

Example 2: Get the row number

Find which row a cell is on.

Return the row with "row"

=CELL("row", B5)
Result: 5
The "row" info type returns the row number of the reference.

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.

1
Choose info_type
Decide what you need, e.g. "address" or "row".
2
Pick a reference
Select the cell to inspect (recommended).
3
Enter the formula
Type =CELL("info_type", reference).

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

Practice 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.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

Is CELL volatile?
Yes, it recalculates on every change to the workbook.
What does "type" return?
'b' for blank, 'l' for label (text), or 'v' for value (number/date).
How do I get the file path?
Use =CELL("filename", A1), which returns something like C:[book.xlsx]Sheet1!A1.