CELL Function In Excel

What Is CELL Function In Excel?

The CELL function in Excel extracts and returns the requested information about a cell value regarding its contents, formatting, location, etc. In a large dataset, the function helps identify numeric values before proceeding with any calculations. The Excel CELL function is an inbuilt Information function, so we can insert the formula from the “Function Library” or enter it directly in the worksheet. For example, we will use the CELL function to find the cell address for the value in column A.

Cell Function in Excel - 2

Select cell B2, enter the formula =CELL(“address”,A2), and press “Enter”. The result is ‘$A$2’, as shown below, indicating that the selected cell’s cell address is A2.

Cell Function in Excel - 1
Key Takeaways
  • The CELL function in Excel helps users find the needed facts or information w.r.t a cell value in a given dataset.
  • The info_type tells what kind of information is required, such as its cell address, formatting [color, format, etc.], location [column, row, etc.], etc.
  • We can see the “Info-type” table and the “Format Code” table provided, at the start of the article, to comprehend what results or output to expect when the function is executed.
  • For the reference argument, we must select the cells in a dataset or a cell range, apply the CELL formula, and extract the required details.

CELL() Excel Formula

The syntax of the CELL Excel Formula is,

CELL Function in Excel - Formula Syntax

The arguments of the CELL Excel Formula are,

  • info_type: It is a mandatory argument. It is the cell information that is to be returned.

Info Type value – The table below contains the Info type and its description.

Info TypeDescription
AddressReturns the address of the first cell as text.
ColReturns the column number of the first cell.
ColorReturns the value 1 for negative values and value 0 for others if the cell is formatted in color.
ContentsReturns the value of the upper left cell but not the formula cell.
FilenameReturns the Filename that includes the full path of the file as text. If the content is not yet saved, it returns empty text (“”).
FormatReturns the code which is corresponding to the number format of the cell.
ParenthesesReturns the value 1 for the first cell formatted as parentheses; otherwise, returns the value 0.
PrefixReturns text value based on the specified “label prefix” of the cell.
ProtectReturns the value 0 if the cell is not locked; otherwise, returns the value 1.
RowReturns the row number of the cell.
TypeReturns the text value, which depends on the type of data, i.e., ‘b’ for blank cell, ‘l’ for the label, & ‘v’ for value.
WidthReturns the column width.

Cell Format Codes

Format CodeDescription
GGeneral
F00
,0#,##0
F20
,2#,##0.00
C0$#,##0_);($#,##0)
C0-$#,##0_);[Red]($#,##0)
C2$#,##0.00_);($#,##0.00)
C2-$#,##0.00_);[Red]($#,##0.00)
P00%
P20.00%
S20.00E+00
G# ?/? or ??/??
D1d-mmm-yy or dd-mmm-yy
D2d-mmm or dd-mmm
D3mmm-yy
D4m/d/yy or m/d/yy h:mm or mm/dd/yy
D5Mm/dd
D6h:mm:ss AM/PM
D7h:mm AM/PM
D8h:mm:ss
D9h:mm
  • reference: It is an optional argument. It is the cell from which the information is collected.

How To Use CELL Function In Excel?

We can use the CELL function in Excel in 2 ways, namely,

  1. Access from the Excel ribbon.
  2. Enter in the worksheet manually.


Excel VBA – All in One Courses Bundle (35+ Hours of Video Tutorials)

If you want to learn Excel and VBA professionally, then ​Excel VBA All in One Courses Bundle​ (35+ hours) is the perfect solution. Whether you’re a beginner or an experienced user, this bundle covers it all – from Basic Excel to Advanced Excel, Macros, Power Query, and VBA.

Method #1 – Access from the Excel ribbon

Choose an empty cell for the output → select the “Formulas” tab → go to the “Function Library” group → click the “More Functions” option drop-down → click the “Information” option right arrow → select the “CELL” function, as shown below.

Cell Function in Excel - Access from the excel ribbon

The “Function Arguments” window appears. Enter the arguments in the “Info_type” and “Reference” fields → click “OK”, as shown below.

Cell Function in Excel - function arguments window

Method #2 – Enter in the worksheet manually

  1. Select an empty cell for the output.
  2. Type =CELL( in the selected cell. [Alternatively, type =C and double-click the CELL function from the list of suggestions shown by Excel.]
  3. Enter the arguments as cell values or cell references and close the brackets.
  4. Press the “Enter” key.

Let us take a basic example to understand this function.

We will find the formatting of the cell values using CELL function in Excel.

In the table, the data is,

  • Column A contains the Data.
  • Column B contains the Result.
How to use CELL Excel Function - Basic Example

The steps to find the required details using the CELL formula are,

  1. Select cell B2, and enter the formula =CELL(“format”, i.e., the format value of the cell.


    Basic Example - Step 1

  2. Enter the value of ‘reference’ as A2, and close the brackets. The complete formula is =CELL(“format”,A2).


    Basic Example - Step 2

  3. Press the “Enter” key. The results in cell B2, as shown below.


    Basic Example - Step 3

  4. Drag the formula from cell B2 to B6 using the fill handle. The output is shown below.


    Basic Example - Step 4

Examples

We will understand some advanced scenarios using the CELL function in Excel examples.

Example #1

We will find the column cell reference of the cell values using the CELL function in Excel.

In the table, the data is,

  • Column A contains the Data.
  • Column B contains the Result.
CELL Function in Excel - Example 1

The steps to find the required details using the CELL formula are,

  • Step 1: Select cell B2, enter the formula =CELL(“col”,A2), and press “Enter”. The result is ‘1’, as shown below, indicating the column number of the selected cell.
Example 1 - Step 1
  • Step 2: Drag the formula from cell B2 to B5 using the fill handle. The output is shown below.
Example 1 - Step 2

Example #2

We will find the prefix of the cell values using the CELL function in Excel.

In the table, the data is,

  • Column A contains the Data.
  • Column B contains the Result.
CELL Function in Excel - Example 2

The steps to find the required details using the CELL formula are,

  • Step 1: Select cell B2, enter the formula =CELL(“prefix”,A2), and press “Enter”. The result is ’.
Example 2 - Step 1
  • Step 2: Drag the formula from cell B2 to B5 using the fill handle. The output is shown below.
Example 2 - Step 2

Example #3

We will find the color of the cell values using the CELL function in Excel.

In the table, the data is,

  • Column A contains the Data.
  • Column B contains the Result.
CELL Function in Excel - Example 3

The procedure to find the required details using the CELL formula is,

Enter the formula =CELL(color, A2) in cell A2, =CELL(“abc”,A3) in cell A3, and =CELL(6,A4) in cell A4. Press the “Enter” key every time the formula is entered.

Example 3 - 1

The result in cell B2 is a “#NAME?” error”, and in cells B3 and B4 are “VALUE!” errors, as shown in the image above. Column C is for our reference.

Important Things To Note

  • The “#NAME?” error occurs when the “info_type” arguments are text values that are not enclosed in quotes (“ ”) and are not valid cell references.
  • The “#VALUE!” error occurs when,
    • The “info_type” value is less than one or is greater than the given number of values.
    • The “info_type” argument value is non-numeric.

Frequently Asked Questions (FAQs)

1. What does the CELL function in Excel mean?

The CELL function returns the information about cell references by taking 2 arguments, such as what info is needed, whether the cell values location, format, address, and which cell value to find the required details.

The Formula of the CELL function is =CELL(info_type,reference)

2. How to insert the CELL function in Excel?

We can insert Excel CELL Function as follows:
1. Select an empty cell for the output.
2. Type =CELL( in the selected cell. [Alternatively, type =C and double-click the CELL function from the list of suggestions shown by Excel.]
3. Enter the arguments as cell values or cell references and close the brackets.
4. Press the “Enter” key.

For example, we will find the cell content using the CELL function for the following values.

Cell Function in Excel - FAQ 2

Select cell B2, enter the formula =CELL(“contents”,A2), and press the “Enter” key.

FAQ 2 - Step 1

The result is ‘10’, as shown above.

3. Where is the CELL function in Excel?

The CELL Excel Function is found in the “Formulas” tab, as shown below.

Choose an empty cell for the output → select the “Formulas” tab → go to the “Function Library” group → click the “More Functions” option drop-down → click the “Information” option right arrow → select the “CELL” function, as shown below.

Cell Function in Excel - FAQ 3

Download Template

This article must help understand the CELL function in Excel’s formula and examples. You can download the template here to use it instantly.

This has been a guide to CELL Function In Excel. Here we explain how to use CELL formula along with examples & downloadable excel template. You can learn more from the following articles –

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *