MS Excel: Cell Function

In Excel, the Cell function can be used to retrieve information about a cell. This can include contents, formatting, size, etc.

The syntax for the Cell function is:

Cell( type, range )

type is the type of information that you’d like to retrieve for the cell. type can be one of the following values:


Address of the cell. If the cell refers to a range, it is the first cell in the range.

Column number of the cell.

Returns 1 if the color is a negative value; Otherwise it returns 0.

Contents of the upper-left cell.

Filename of the file that contains reference.

Number format of the cell. See example formats below.

Returns 1 if the cell is formatted with parentheses; Otherwise, it returns 0.

Label prefix for the cell.
* Returns a single quote (‘) if the cell is left-aligned.
* Returns a double quote (") if the cell is right-aligned.
* Returns a caret (^) if the cell is center-aligned.
* Returns a back slash (\) if the cell is fill-aligned.
* Returns an empty text value for all others.

Returns 1 if the cell is locked.  Returns 0 if the cell is not locked.

Row number of the cell.

Returns "b" if the cell is empty.
Returns "l" if the cell contains a text constant.
Returns "v" for all others.

Column width of the cell, rounded to the nearest integer.

For the "format" value, described above, the values returned are as follows:

Returned Value
for "format"













# ?/? or # ??/??

m/d/yy or m/d/yy h:mm or mm/dd/yy

d-mmm-yy or dd-mmm-yy

d-mmm or dd-mmm



h:mm:ss AM/PM

h:mm AM/PM



range is the cell (or range) that you wish to retrieve information for. If the range parameter is omitted, the Cell function will assume that you are retrieving information for the last cell that was changed.

Applies To:

  • Excel 2007, Excel 2003, Excel XP, Excel 2000

For example:

Let’s take a look at an example:

Based on the Excel spreadsheet above:

=Cell("col", A1)
would return 1

=Cell("address", A2)
would return $A$2

=Cell("format", A2)
would return P2


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: