The CELL function gets information about the formatting, location, or the contents of a cell.
The formula example above in cell C3 returns a value determined by the contents of the cell.
Formula in cell C3:
Excel Function Syntax
Required. A value that determines the type of cell information the function returns.
List of Info_type arguments and what they do.
Reference of the first cell in reference, as text.
Column number of the cell in reference.
The value 1 if the cell is formatted in color for negative values; otherwise returns 0 (zero).
Value of the upper-left cell in reference; not a formula.
Filename (including full path) of the file that contains reference, as text. Returns empty text ("") if the worksheet that contains reference has not yet been saved.
Text value corresponding to the number format of the cell. The text values for the various formats are shown in the following table. Returns "-" at the end of the text value if the cell is formatted in color for negative values. Returns "()" at the end of the text value if the cell is formatted with parentheses for positive or all values.
The value 1 if the cell is formatted with parentheses for positive or all values; otherwise returns 0.
Text value corresponding to the "label prefix" of the cell. Returns single quotation mark (') if the cell contains left-aligned text, double quotation mark (") if the cell contains right-aligned text, caret (^) if the cell contains centered text, backslash (\) if the cell contains fill-aligned text, and empty text ("") if the cell contains anything else.
The value 0 if the cell is not locked; otherwise returns 1 if the cell is locked.
Row number of the cell in reference.
Text value corresponding to the type of data in the cell. Returns "b" for blank if the cell is empty, "l" for label if the cell contains a text constant, and "v" for value if the cell contains anything else.
Column width of the cell, rounded off to an integer. Each unit of column width is equal to the width of one character in the default font size.
The second argument in the CELL function is [Reference].
Optional. The cell that you want information about. If omitted, the information specified in the Info_type argument is returned for the last cell that was changed.
Info_type "format" returns the following codes for different cell formatting settings.
This extensive function reference list provides detailed information including syntax, arguments, return values, and examples for many of the functions used in Excel formulas. Click on headers to sort table.
Functions in 'Information'
The CELL function function is one of many functions in the 'Information' category.