Excel function

CELLfunction

Returns information about a cell, such as its address, position, value or type.

All versions
=CELL("type", A2)
A
B
1
2
3
4
5
6
7
8
9
10

Click a cell in the table to change reference. Leave info_type as "type" and click a blank cell, a text cell and a number cell in turn. Try breaking it on purpose to see the errors.

Result

l

info_type

The information you want. Excel has more types, such as "format" and "width"; this page covers the five most common.

reference
A2You can also click a cell in the table

The cell you want information about. Click any cell in the sheet.

What is the CELL function?

=CELL(info_type, [reference])

CELL returns information about a cell, such as its address, position, value or format. Write info_type as an English word in double quotes, like "address".

According to Microsoft, "type" returns "b" for a blank cell, "l" for a text constant and "v" for anything else. Click cells in the sheet above to check.

Arguments

info_type
"address", "row", "col", "contents", "type", "format", "width" and others.
reference
Optional, but Microsoft notes that without it the result depends on the currently selected cell and is unpredictable. It is best to give a cell.

CELL examples

  1. Example 1. Address

    =CELL("address", A3)

    "$A$3".

  2. Example 2. Kind of value

    =CELL("type", A4)

    A blank cell, so "b".

  3. Example 3. Value

    =CELL("contents", A2)

    The value in A2.

Common mistakes

FAQ

Does it work in Excel for the web?
According to Microsoft, Excel for the web supports only some info types.
Just the row number?
The ROW function is simpler.