CELL function
Returns information about a cell, such as its address, row, column, content type, number format or the file and sheet name.
Available in All versions of Excel, including Microsoft 365 and Excel for the web (some info types, such as "filename", are limited in Excel for the web)
In every Excel versionDifferent in Google Sheets
Syntax
CELL(info_type, [reference])| Argument | What it means | |
|---|---|---|
info_type | Required | Text saying what you want to know, e.g. "address", "row", "col", "contents", "type", "format", "width" or "filename". |
reference | Optional | The cell to inspect. If a range is given, only its top-left cell is used. If omitted, Excel uses the cell that was changed last, which can give confusing results — always supply it. |
Returns: Text or a number, depending on info_type.
How CELL works
CELL answers questions about a cell rather than about the value in it: where is it, what kind of content does it hold, what number format does it use, which file and sheet is it on? You choose the question with the first argument, written as text in quotes, and point the second argument at the cell.
The most popular use is CELL("filename", A1), which returns the full path, workbook name and sheet name of a saved file, for example C:\Reports\[Sales.xlsx]Q1. With a little text surgery you can extract the sheet name into a report heading so it updates when the sheet is renamed. Other useful types: "address" (the cell's address as text), "row" and "col" (its position as numbers), and "type", which returns b for blank, l (label) for text and v for any value such as a number or formula result.
Two cautions. First, "filename" returns empty text until the workbook has been saved. Second, if you leave out the reference, CELL reports on whichever cell was last edited anywhere — so a formula like =CELL("row") can change every time you type somewhere else.
Examples
1Get a cell's address as text
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Product | Stock | ||
| 2 | Cable | 140 | $B$3 | |
| 3 | Adapter | 0 |
Result: $B$3
The address is returned as absolute text. Combined with lookups (e.g. CELL("address", INDEX(B2:B3, MATCH(0, B2:B3, 0)))) it can tell you where the zero stock is.
2What kind of content is in a cell?
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Customer | Credit limit | ||
| 2 | Borealis Ltd | pending | l | |
| 3 | Kestrel SA | 5000 |
Result: l
B2 holds the text pending, so CELL returns l (for label). For B3, which holds a number, it would return v, and an empty cell returns b.
3Put the sheet name in a heading
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Region | Sales | Q1 | |
| 2 | East | 14690 |
Result: Q1
Assuming the file is saved and this sheet is named Q1, CELL returns something like C:\Reports\[Sales.xlsx]Q1. FIND locates the ] and MID takes everything after it — the sheet name (at most 31 characters). In an unsaved workbook the result is #VALUE! because the filename is empty.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | info_type is not one of the recognised words, or is not in quotes. | Type the info type as text, e.g. "address", and check the spelling. |
Empty result | "filename" was used in a workbook that has never been saved. | Save the file once; the formula updates after the next recalculation. |
Tips
- Always give the reference argument. Without it CELL reports on the last changed cell, which is rarely what you want.
- In Microsoft 365, TEXTAFTER makes the sheet-name trick shorter:
=TEXTAFTER(CELL("filename", A1), "]"). CELL("format", B2)returns a code such asF2(fixed, 2 decimals) orC2(currency); it is useful for spotting inconsistently formatted cells.
Google Sheets
Exists but supports fewer info_type values (for example address, col, row, contents, type, width, prefix); "filename" and some formatting types are not available.
CELL in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | POLÍČKO |
| Danish | CELLE |
| Dutch | CEL |
| Finnish | SOLU |
| French | CELLULE |
| German | ZELLE |
| Hungarian | CELLA |
| Italian | CELLA |
| Norwegian (Bokmål) | CELLE |
| Polish | KOMÓRKA |
| Portuguese (Brazil) | CÉL |
| Portuguese (Portugal) | CÉL |
| Russian | ЯЧЕЙКА |
| Spanish | CELDA |
| Turkish | HÜCRE |