The CELL function takes two arguments: info_type and reference. Info_type is a text string that indicates the type of information requested. See the table below for a full list of info types. Reference is a cell reference. Reference is typically a single cell. If reference refers to more than one cell, CELL returns information about the first cell in reference. For certain kinds of information (like filename) the cell address used for reference is optional and can be omitted. However, if reference is not supplied, CELL will return the name of the current “active sheet” which may or may not be the sheet where the formula exists, and might even be in a different workbook. To avoid confusion, use A1 for reference. Note: the CELL function is a volatile function and may cause performance issues in large or complex worksheets.
Examples
For example, to get the column number for C10: To get the address of A1 as text: To get the full path and workbook name for the current worksheet: CELL can also return format code information. For example, if A1 contains the number 100 with the currency number format applied, the CELL function will return “C2”: When requesting the info_type “format” or “parentheses”, a set of empty parentheses “()” is appended to the format returned if the number format uses parentheses for all values or for positive values. For example, if A1 uses the custom number format (0), then:
Info types
The following info_types can be used with the CELL function:
Format codes
The table below shows the text codes returned by CELL when “format” is used for info_type.
Notes
The CELL function is a volatile function and may cause performance issues in large or complex worksheets. Reference is optional for some info types, but use an address like A1 to avoid unexpected behavior.
Dave Bruns
Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.