Name

CELL

Synopsis

Use CELL to get specific information about the formatting, location, or contents of a specific cell.

To Calculate

=CELL(Info_Type, Reference)

The Info_Type argument is required for this function. If the Reference argument is omitted, the information is returned for the last modified cell.

Info_Type

Specifies one of the following text values that indicates the type of information that should be returned about the specified cell. Remember to enclose the value in quotes.

address

Returns the cell reference of the first cell in the range of cells specified by Reference.

col

Returns the column number of the reference.

color

Returns a value of 1 if negative values display in color. Otherwise returns a value of 0 (zero).

contents

Returns the contents of the upper-left cell in the range of cells specified by Reference.

filename

If the file containing the reference has been saved, the filename (with the full path) is returned; otherwise, the function returns empty text.

format

Returns a text value that identifies the type of formatting applied to the cell. The text value corresponds to the cell formatting listed on the Number tab of the Format Cells dialog. This dialog displays when you select Format Cells. For example, the function returns G for a general format and C2 for a currency value with two decimal places. If the cell is formatted to display negative values in color, a - is returned at the end of the text value. If the cell is formatted to display negative value in parentheses, ...

Get Excel 2000 in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.