Cell() Function

The Excel Cell function returns information about a cell in a worksheet. The type of information to be returned is specified as info_type. CELL can get things like address and filename, as well as detailed info about the formatting used in the cell.

Syntax

            The syntax for the CELL function in Microsoft Excel is:

=CELL( type, [range] )

Parameters or Arguments

type

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

“format”

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

range

            Optional. It 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.

Examples of the Excel Cell Function

                  In the following example spreadsheet, the Excel Cell function is used to return different properties of the cell A1. It should be noted that, in the spreadsheet, cell A1 is formatted with the Custom Format   #,##0; [Red] – #,##0.

Formulas:

Results:

                                    Note that, in cell B6 of the above example spreadsheet, the “format” type is returned as “,0-“. This is comprised of two parts: the “,0” part, which represents the #,##0 number format, and the “-” part, which indicates that the cell is formatted in color for negative values.

Note:

                     If the formatting of cell A1 in the above spreadsheet is changed, the formulas in cells B1-B12 will not immediately recalculate. You can force them to recalculate by pressing the F9 key.