GET.CELL is not a standard Excel worksheet function. It is a macro-only function that belongs to Excel's legacy XLM macro language, and it only works when called from a defined name, a macro sheet, or VBA code. Typing =GET.CELL(...) into an ordinary cell on a normal sheet returns the #NAME? error, because Excel's normal calculation engine does not recognise it. In short: it is a real, documented, long-supported Excel feature, but it is nonstandard in the sense that most users never encounter it and it cannot be used like SUM or VLOOKUP.

The function's purpose is to report information about a cell that normal worksheet functions cannot see — its background fill colour, its font colour, whether it is bold or italic, which format it uses, whether it is locked, whether it contains a formula, and roughly two dozen similar properties. The most common real-world use is reading a cell's fill colour so that a filter, sort, or conditional formula can respond to colour rather than to the value stored in the cell.

Where GET.CELL Comes From

GET.CELL is part of the XLM macro language that predates modern Visual Basic for Applications. Early spreadsheet programs, including Microsoft Excel's forerunners, relied on macro sheets: dedicated worksheets on which each row was a command in a simple function-like language. GET.CELL was the command that pulled information about a cell's appearance into that macro sheet so other commands could act on it.

When VBA arrived, Microsoft kept the old XLM commands for backward compatibility. Many were quietly retired or hidden from the function list, but a handful — GET.CELL among them — still work when invoked in the right context. That is why older forums and help pages discuss it as though it were a normal function while new users find it does nothing at all. The behaviour has not changed in years; the surrounding advice simply stopped being updated.

Because the function is undocumented in the visible function list, you will not find it by browsing the Formula bar's function picker. It has to be typed or built manually inside a defined name or in code.

How GET.CELL Works

The syntax is straightforward but strict:

GET.CELL(type_num, reference)

The first argument is a number that selects which piece of information you want. The second is a reference to a cell. A few of the type numbers that are genuinely useful:

  • 6 — returns the formula in the reference cell as text, or a placeholder if there is no formula.
  • 7 — returns the number format code applied to the cell.
  • 20 — returns whether the cell is bold (TRUE or FALSE).
  • 21 — returns whether the cell is italic.
  • 24 — returns the font colour as a palette index.
  • 38 — returns the background (fill) colour as an index, with 0 meaning no fill.
  • 48 — returns whether the cell contains a formula.
  • 50 — returns whether the cell is locked.
  • 63 — returns the fill colour as a different palette mapping, often used when the plain index is ambiguous.

These are the classic documented indices; a few older references list dozens more, many of which are obsolete in current versions. The colour indices refer to Excel's internal palette positions, not to standard RGB hex values, which is the single biggest source of confusion. A cell that looks pale green might return a small number like 4 or 10, and mapping that number back to a visible colour is guesswork unless you build a lookup from sample cells.

The Only Reliable Way to Use It: Defined Names

Because GET.CELL cannot live directly in a worksheet cell, the standard technique is to wrap it in a defined name built with a relative reference. The steps, which apply to the desktop versions of Excel on Windows:

  1. Select the first cell where you want the result to appear.
  2. Open the Formulas tab and choose Name Manager, then New.
  3. Give the name something clear, such as CellFill.
  4. In the Refers to box type =GET.CELL(38,Sheet1!A1), where the reference is the cell holding the colour you want to read — use a relative row reference and no dollar signs on the row so the formula can copy down.
  5. Confirm, then in the worksheet type =CellFill in the cell you selected and fill it down the column.
  6. To refresh values after changing a cell's colour, press F9 or reopen the sheet, since formatting changes do not trigger a normal recalculation.

Labels in the menus can differ slightly between Excel versions, and the Mac version historically has far less support for this technique, so treat the steps above as written for Windows desktop Excel. The wrapper approach works because a defined name is evaluated in a context where the macro function is permitted, unlike a cell formula.

A practical warning: a workbook that relies on this is fragile. Emailing it to a colleague, opening it in Excel Online, or converting it to another app will usually break or blank the results, because the macro function is not part of the standard formula set.

GET.CELL vs VBA and Modern Alternatives

Before committing to GET.CELL, compare it with what else is available:

  • VBA with a User-Defined Function. A short function using the Range object's Interior.Color or Font.Color property returns the colour directly, is easier to read, and works in more situations. The trade-off is that a macro-enabled workbook (.xlsm) is required and macro security settings must allow it.
  • Built-in conditional formatting. If your goal is to colour cells based on rules, conditional formatting plus formulas avoids the need to read colours at all. Reading colour is only necessary when someone else has applied colour by hand.
  • Helper columns with structured data. The cleanest long-term fix is to record the reason for a colour (status, priority, owner) in a real column and colour the cell from that value. Then formulas, filters, and PivotTables work without any macro tricks.
  • Filter by colour. Excel's own filter dropdown includes a Filter by Color option, which handles simple visual filtering with no formulas at all.

The honest comparison is that GET.CELL solves a narrow problem — reacting to manual formatting — and does so with a technique that is invisible to anyone who later opens the file.

Common Problems and Misconceptions

Most frustration with GET.CELL comes from a handful of recurring mistakes:

  • #NAME? in a normal cell. This is expected, not a bug. The function cannot be called directly from a worksheet formula.
  • Values that never update. Colour changes are formatting events, not value changes, so Excel does not recalculate. Force a recalculation or reopen the workbook.
  • Wrong colour numbers. The returned index belongs to Excel's palette mapping, which does not translate directly to RGB. Build a small reference table by filling sample cells and reading their results.
  • Works for me, blank for them. Opening in Excel Online, Google Sheets, or older or newer builds with different compatibility settings can strip the result. Send a rendered copy if the recipient only needs to read it.
  • Believing it is a supported public function. It is a compatibility holdover. Microsoft's documentation for modern functions does not list it, and it can behave differently from version to version.

The most common misconception is that hiding text in white font makes a cell's contents secret. GET.CELL(24) reads the font colour, and a simple copy-paste or a change of fill colour reveals the text instantly. Never treat formatting as a security measure.

When You Should Not Use It

If the workbook is shared, edited by several people, stored in a cloud service, or likely to be opened on a phone or tablet, avoid GET.CELL entirely. The defined-name trick depends on a desktop calculation engine that other viewers do not replicate. In those cases, record the meaning of each colour in a data column, or use conditional formatting driven by values. Reserve GET.CELL for one-off analysis on your own machine: auditing a legacy sheet that is colour-coded by hand, checking which cells are locked before protecting a sheet, or extracting the number formats applied across a range so you can standardise them.

Frequently Asked Questions

Is GET.CELL a real Excel function?

Yes, it is a real but legacy macro function from the XLM macro language. It exists and works only inside defined names, macro sheets, or VBA — not as a normal cell formula.

Why does =GET.CELL(38,A1) give #NAME?

Because a worksheet cell cannot call macro functions directly. Wrap it in a defined name and reference that name from the cell instead.

Does GET.CELL work on Excel for Mac?

Support is limited and inconsistent compared with Windows. If you depend on reading cell colours, a VBA approach is more dependable, though it still requires a macro-enabled file.

Can GET.CELL read a colour applied by conditional formatting?

No. GET.CELL reports the formatting stored on the cell, not the display colour produced by a conditional formatting rule. You have to evaluate the rule's logic instead.

Why do the colour numbers not match RGB values?

The function returns palette indices, not RGB codes. Different indices can look similar, and the mapping varies with the workbook's colour theme.

Is GET.CELL safe to keep in a workbook?

It is not a security risk, but it is a compatibility risk. Save such workbooks as macro-enabled files, keep a plain copy for sharing, and expect results to disappear in Excel Online.