How To Use Excel CELL Function

    how to use excel cell function

    Quick Tip

    Use Excel CELL Function to get some specific information about a cell. For Example, If you want to check whether a is protected or not, or you want to check the width of a cell, you can use cell function for that.

    Cell function has total 12 different parameters to check about a cell reference.

    Syntax

    CELL(info_type, [reference])

    • info_type Type of information you want to check about a cell. You have a drop down to select which type of information you required about the reference.
    info_typeReturns
    addressCell address of the reference. If you refer to more than one cell it will return the address of the first cell.
    colColumn number of the cell reference.
    colorReturn 1 if a cell has a format for negative values else it will return 0.
    contentsCell content and if you refer to more than one cell it will return cell content of the first cell.
    filenameReturn filename with full path address.
    formatReturn a text value corresponding to the cell format. (See additional information for format table). If a cell has a format for negative values it will return “-” at the end text value & if a cell has parentheses it will return () at the end text value.
    parenthesesReturn 1 cell is formatted with parentheses and 0 if not.
    prefixIt will return a 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.
    protectReturns 0 if a cell is not protected & 1 if a cell is protected.
    rowRow number of the cell reference.
    typeReturn a text value corresponding to the type of data in the cell. Returns “b” for blank if the cell is empty, “l” for the label if the cell contains a text constant, and “v” for value if the cell contains anything else.
    widthReturns the width of the cell as an integer.
    • [reference] Cell for which you want to get the information.

    More Information On Excel CELL Function

    • If change the format of a cell, to update the result in the function you have to recalculate the worksheet.
    • Please check below format codes return by the CELL Function.
    info_typeReturns
    General“G”
    0“F0”
    #,##0“,0”
    0.00“F2”
    #,##0.00“,2”
    $#,##0_);($#,##0)“C0”
    $#,##0_);[Red]($#,##0)“C0-“
    $#,##0.00_);($#,##0.00)“C2”
    $#,##0.00_);[Red]($#,##0.00)“C2-“
    0%“P0”
    0.00%“P2”
    0.00E+00“S2”
    # ?/? or # ??/??“G”
    m/d/yy or m/d/yy h:mm or mm/dd/yy“D4”
    d-mmm-yy or dd-mmm-yy“D1”
    d-mmm or dd-mmm“D2”
    mmm-yy“D3”
    mm/dd“D5”
    h:mm AM/PM“D7”
    h:mm:ss AM/PM“D6”
    h:mm“D9”
    h:mm:ss“D8”

    Examples

    In the below example, I have used all the parameters to get information about a cell. You can use this function with other function where you need to use information about a cell.

    Examples For Excel CELL Function

    Sample File

    download sample file to learn more about this tips

    What’s Next?

    To learn more about Excel CELL Function you can check Microsoft’s Help Section. And, if you have a unique idea to use it, I would love to hear from you.

    There is also you have INFO function which is highly useful. Apart from this, I have a list of excel functions and some real life formulas examples.