CELL Function in Microsoft Excel: Syntax, Examples & Troubleshooting
Inspect Excel cells with CELL. Use explicit references, interpret type and format codes, handle the two-item width result and distinguish platform-specific info_type limits.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: CELL(info_type, reference) reports information about a cell. Always supply a single-cell reference for predictable diagnostics. Omitting it makes the result depend on selection at calculation time, which can vary by platform and co-authoring activity.
Syntax and supported information
=CELL(info_type, [reference])
info_type is required quoted text. Reference is technically optional, but the vendor recommends including it. English info_type keywords are language-specific and may fail in a differently localized Excel version.
| Keyword | Documented information |
|---|---|
"address" |
Cell address as text |
"col" |
Column number |
"row" |
Row number |
"contents" |
Cell value, not its formula text |
"type" |
b for blank, l for a text constant, v otherwise |
"color" |
1 if the number format uses color for negative values; otherwise 0 |
"filename" |
Workbook path/name information; empty text if not yet saved |
"format" |
A code for the cell’s number format |
"parentheses" |
1 for a format using parentheses for positive or all values; otherwise 0 |
"prefix" |
Label-prefix indicator related to text alignment |
"protect" |
1 for locked, 0 for unlocked |
"width" |
Two-item array: rounded column width and whether it is the default width |
Microsoft marks color, filename, format, parentheses, prefix, protect and width unsupported in Excel for the web, Excel Mobile and Excel Starter. The individual reference discusses other CELL behavior on the web, so do not infer identical support for every keyword from a broad product label.
Worked example: inspect a known single cell
Enter numeric 125 in B3. In separate cells enter:
=CELL("row",B3)
=CELL("col",B3)
=CELL("address",B3)
=CELL("contents",B3)
=CELL("type",B3)
Expected results are 3, 2, $B$3, 125 and v, respectively, for the local single-cell fixture. These outputs separate position, value and broad content classification. They do not inspect whether the number is financially meaningful or whether an imported row is complete.
Second example: blank, constant text and formula results
Leave B4 genuinely empty and put the text constant Ready in B5. =CELL("type",B4) is expected to return b, and =CELL("type",B5) l. Put =10+5 in B6; =CELL("contents",B6) is expected to return 15, not the string =10+5.
The documented type table calls v everything other than an empty cell or text constant. It should not be treated as a rigorous replacement for ISNUMBER. A formula that returns text is not a text constant; use a direct type-testing function when your calculation requires a number.
Advanced application: check built-in number formats
In a supported desktop version, set B3 to the built-in two-decimal numeric format 0.00. =CELL("format",B3) is expected to return F2. Change it to General and recalculate; expected code G. Microsoft specifically says a formatting change requires recalculation, such as F9, to update this result.
Other documented built-in codes include F0 for 0, ,0 and ,2 for grouped integers/two decimals, C0/C2 for the documented currency formats, P0/P2 for integer/two-decimal percentages and S2 for 0.00E+00. Negative-color formats append a minus sign; some parentheses formats append ().
Date/time codes include D1 for day-month-year with abbreviated month, D2 for day-month, D3 for month-year, D4 for the listed numeric date formats, D5 for month/day, D6/D7 for time with AM/PM and with/without seconds respectively, and D8/D9 for 24-hour time with/without seconds. These are codes, not full custom format strings.
Troubleshooting and interpretation limits
- A filename result from an unsaved workbook is documented as empty; no actual user path is asserted here.
- Protect reports the cell’s locked attribute, not proof that the worksheet is currently protected or that access is secure.
- Color concerns negative-value number formatting, not a generic fill-color detector.
- Width is a two-item array in the current reference, not invariably a single scalar.
- The reference’s range wording is inconsistent between active-cell and first-cell descriptions. Use an explicit single cell, as above, rather than relying on that ambiguity.
No workbook filename, environment property or native formatting result was collected for these examples; the expected controls follow the documented single-cell contract.
Compatibility and verification
Microsoft’s reference checked on October 17, 2026 lists: Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel 2024 Excel 2024 for Mac Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2016 Excel for iPad Excel for iPhone Excel for Android tablets Excel for Android phones. This current support list does not establish the first release. The introduction version and last functioning version have not been established from the reviewed documentation. No retirement is asserted.
Example verification: Expected numerical results are independently calculated; text and shape expectations follow the documented contract. These examples have not been tested in Microsoft Excel. No screenshot or native execution is claimed.
Related guides and source
ISNUMBER in Excel | ISTEXT in Excel | ROW in Excel | COLUMN in Excel | FORMULATEXT in Excel
- Microsoft CELL reference, retrieved October 17, 2026.