Function Problems

Use Excel GET.CELL to Read a Cell Background Color

Bushra ParveenBushra Parveen Nov 12, 2026 869 views

Question details

The user wants to return an Excel cell background color code and use it in an IF calculation without receiving a #VALUE! error.

Use Excel GET.CELL to Read a Cell Background Color
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user needs to test a cell’s fill color as part of a worksheet calculation.
Observed behavior
Entering GET.CELL directly in a worksheet formula returns a #VALUE! error.
Before you start

GET.CELL is a legacy Excel 4.0 macro function, so it must be stored in a defined name rather than entered directly in a worksheet cell. Identify the cell whose fill color you want to evaluate before creating the name.

Solution 1Recommended

Create a defined name that returns the Excel cell fill color

Use this method when GET.CELL returns #VALUE! because it was entered as a standard worksheet formula.

The GET.CELL function with argument 63 returns the background fill color index of a referenced cell. Excel allows this legacy macro function through Name Manager, where the defined name can then be used in worksheet formulas.

1
Open Name Manager

In Excel, select a result cell, then go to Formulas > Name Manager > New.

2
Create the GetColor name

Enter GetColor in the Name box. In the Refers to box, enter =GET.CELL(63,Sheet1!A1), replacing Sheet1!A1 with the cell whose background color you want to read.

3
Return the color code in a worksheet cell

Select the cell next to the colored cell and enter =GetColor. Excel returns the fill color index for the referenced cell.

4
Use the color code in an IF formula

Enter a formula such as =IF(GetColor=6,"Yellow","Other") and replace 6 with the color index returned for the fill color you want to test.

Create a defined name that returns the Excel cell fill color
Recalculate after changing fill colors: Changing a cell’s fill color may not trigger recalculation. Press F9, or edit and confirm a worksheet cell, to refresh the GET.CELL result.
Free Microsoft Office alternative

Work with Excel-compatible spreadsheets in WPS Office

GET.CELL is a legacy Microsoft Excel macro function, so its behavior depends on Excel’s support for Excel 4.0 macro functions. WPS Office is a free, lightweight alternative for creating, editing, and sharing everyday spreadsheets with a familiar interface and seamless migration from Microsoft Office files.

  1. 1. Download WPS Office: Select Download WPS Office Free and install WPS Office on your device.
  2. 2. Open your spreadsheet: Launch WPS Spreadsheets and choose Menu > Open to select your Excel .xlsx or .xls file.
  3. 3. Review formulas and formatting: Select the relevant worksheet and check formulas, cell fills, and conditional formatting from the Home tab.
Create formulas, IF calculations, and conditional formatting in WPS Spreadsheets.Open and save Microsoft Excel .xlsx, .xls, and .csv files with strong format compatibility.Use a familiar ribbon-style interface for an easier move from Microsoft Office.Apply fill colors and visual rules to spreadsheet data quickly.
microsoft office alternative - wps office

Frequently Asked Questions

Why does GET.CELL return #VALUE! in an Excel worksheet?

GET.CELL is an Excel 4.0 macro function, not a normal worksheet function. Add it through Formulas > Name Manager > New, then use the defined name in a cell.

What does GET.CELL(63, reference) return?

GET.CELL with type number 63 returns the background fill color index for the referenced cell. The number can be compared in an IF formula.

How can I use a cell color in an IF formula in Excel?

Create a defined name such as GetColor with =GET.CELL(63,Sheet1!A1), then use a formula such as =IF(GetColor=6,"Yellow","Other"). Replace 6 with the returned color index you need.

Why does the GET.CELL result not change after I apply a new fill color?

Excel may not recalculate a GET.CELL defined name after formatting-only changes. Press F9 to recalculate, or edit a cell and press Enter.

Can GET.CELL identify conditional formatting colors?

GET.CELL may not reliably return the displayed color produced by conditional formatting. It is most suitable for checking a cell’s directly applied fill color.