Excel errors

#CALC! error in Excel: causes and how to fix it

Fix #CALC! in Excel 365: FILTER with no matches, empty arrays from DROP or UNIQUE, nested arrays in BYROW or MAP, uncalled LAMBDA, Python in Excel.

#CALC! means "the calculation engine cannot produce this kind of result". It belongs to the dynamic array and LAMBDA era of Excel (Microsoft 365, Excel 2021 and later) and appears in situations the older errors do not cover: an array that turned out to be empty, a formula that would need an array inside each cell of another array, or a LAMBDA function that was defined but never called. By far the most common case is FILTER finding no rows. This page reproduces each cause on a small sheet, shows the fix and explains how #CALC! relates to the classic errors. The basics of spilled formulas are in Dynamic arrays: spill, FILTER, SORT, UNIQUE, SEQUENCE and # and LET and LAMBDA: variables and your own functions.

What #CALC! means

A worksheet cell can hold one value, and a spilled formula can fill a rectangle of cells with one value each. #CALC! appears when the result of a formula does not fit that model: an array with zero rows (there is nothing to put in the cell), an array in which every item is itself an array, or a value that is a function rather than a number or text. Python in Excel also uses #CALC! for some problems with the data sent to the cloud. Older versions of Excel never show #CALC!, because they cannot create these results.

Cause 1: FILTER found nothing (empty array)

FILTER returns the rows that meet a condition. When no row meets it, the result is an empty array, and Excel shows #CALC! because an empty array cannot be displayed:

D2fx=FILTER(A2:B5, B2:B5>1000)
ABCD
1OrderAmountBig orders
21001450#CALC!
31002820
41003300
51004610

No order is above 1,000, so FILTER has nothing to return.

Result: #CALC!

Fix. Give FILTER its third argument, if_empty, which says what to show when nothing matches:

D2fx=FILTER(A2:B5, B2:B5>1000, "None over 1,000")
ABCD
1OrderAmountBig orders
21001450None over 1,000
31002820
41003300
51004610

The message appears instead of #CALC!; when a big order arrives, the rows appear instead.

Result: None over 1,000

Formulas built on top of FILTER inherit the problem: =SUM(FILTER(B2:B5, B2:B5>1000)) returns #CALC!. Use =SUM(FILTER(B2:B5, B2:B5>1000, 0)) so the empty case sums a zero, or use SUMIFS, which simply returns 0. The same applies to AVERAGE, SORT and UNIQUE wrapped around a FILTER.

Cause 2: other functions that return an empty array

  • DROP that removes every row, such as =DROP(A2:A4, 3), and TAKE asked for 0 rows leave nothing behind.
  • UNIQUE with exactly_once set to TRUE returns an empty array when every value appears more than once.
  • Fix: test the size first (=IF(ROWS(A2:A4)>3, DROP(A2:A4, 3), "")) or wrap the empty step in FILTER with an if_empty value; IFERROR around the whole formula also works when an empty result is the only error you expect.

Cause 3: nested arrays (an array of arrays)

BYROW, BYCOL, MAP, SCAN and MAKEARRAY call a LAMBDA once per item and expect one value back each time. If the LAMBDA returns several values for each row, the result would be an array of arrays, which Excel cannot spill, so it shows #CALC!.

C2fx=BYROW(A2:A3, LAMBDA(t, TEXTSPLIT(t, ",")))
ABC
1TagsSplit
2red,blue#CALC!
3green,red

Each row returns two values, so BYROW would have to build an array of arrays.

Result: #CALC!

Fix. Either make the LAMBDA return a single value per row (for example =BYROW(A2:A3, LAMBDA(t, COUNTA(TEXTSPLIT(t, ",")))) returns the number of tags, 2 and 2), or build the two-dimensional result another way. For splitting, join the rows first and split once:

C2fx=TEXTSPLIT(TEXTJOIN(";", , A2:A3), ",", ";")
ABCD
1TagsSplit
2red,blueredblue
3green,redgreenred

TEXTJOIN makes "red,blue;green,red"; TEXTSPLIT splits columns at commas and rows at semicolons.

For more general cases the pattern =REDUCE(header, rows, LAMBDA(acc, r, VSTACK(acc, ...))) with REDUCE and VSTACK stacks one result per row into a single array. Rows of different widths are padded with #N/A (#N/A error in Excel: causes and how to fix it), which you can replace with IFNA.

Cause 4: a LAMBDA that was never called

LAMBDA creates a function. Typed into a cell on its own, it returns that function, which is not a value a cell can display:

B2fx=LAMBDA(x, x*1.2)
AB
1NetGross
250#CALC!

The function is defined but not given an input.

Result: #CALC!

B2fx=LAMBDA(x, x*1.2)(A2)
AB
1NetGross
25060

Calling it with A2 as the input: 50 × 1.2 = 60.

Result: 60

Testing a LAMBDA in a cell this way is normal while you build it. Once it works, copy everything except the final (A2) into Formulas › Name Manager › New under a name such as ADDVAT; then =ADDVAT(A2) works anywhere in the workbook. A name that contains a LAMBDA and is used without parentheses (=ADDVAT) also returns #CALC!.

Cause 5: Python in Excel and other special cases

  • A PY formula that refers to cells containing volatile functions such as RAND or NOW, or that sends more data than the service allows (Microsoft quotes about 100 MB), returns #CALC!. Remove the volatile references or reduce the data, for example by loading it through Power Query.
  • Referring to a Python object that lives in another workbook returns #CALC!, because Python objects only exist in the workbook that created them.
  • A formula that references too many cells for an array function, or a custom function (UDF) that Excel cannot apply across an array, can also show #CALC!. Smaller ranges or a helper column usually solve it.

How to find every #CALC! in a workbook

  1. Go To Special. Press F5 or Ctrl+G (the same on a Mac), click Special, choose Formulas and leave only Errors ticked, then OK. Excel selects every formula on the sheet that shows an error, of any kind. Give the selection a fill colour so the cells stay visible after you click away.
  2. Find All. Press Ctrl+F (Cmd+F), type #CALC!, open Options, set Look in to Values, tick Match entire cell contents, set Within to Workbook and click Find All. The list at the bottom shows sheet, cell and formula for every hit; Ctrl+A inside the list selects them all.
  3. Error Checking. Formulas › Formula Auditing › Error Checking jumps from one error to the next and offers Show Calculation Steps, which opens Evaluate Formula on that cell so you can see the exact step that fails.
  4. Trace Error. Select an error cell and choose Formulas › Error Checking (the arrow beside it) › Trace Error. Red arrows lead back to the cell where the error started; blue arrows show the healthy inputs. Errors travel downstream, so fixing the first cell often clears dozens of others.
  5. Evaluate Formula. In a nested formula, Formulas › Evaluate Formula shows which inner step (usually a FILTER) first returns the empty array.

When you should NOT hide #CALC!

An empty FILTER is often good news: no overdue invoices, no stock below the minimum. Do not hide it with a blank, which readers cannot tell apart from a broken formula; use if_empty to say it in words, such as "No overdue invoices". The other causes (nested arrays, uncalled LAMBDA) mean the formula is not finished yet, and wrapping them in IFERROR just hides unfinished work. Fix the structure instead.

Version notes

  • #CALC! appears only in Microsoft 365, Excel 2021, Excel 2024, Excel for the web and recent Excel for Mac, because only these versions have dynamic arrays.
  • FILTER, UNIQUE and SORT arrived with Excel 2021; LAMBDA, BYROW, MAP, DROP and TAKE with Excel 2024. In older versions these formulas return #NAME? instead (#NAME? error in Excel: causes and how to fix it).
  • Python in Excel is a Microsoft 365 feature; its #CALC! causes do not apply elsewhere.

Check yourself

1. =FILTER(A2:C50, C2:C50="Overdue") shows #CALC!. What does that usually mean?

2. Which formula returns #CALC!?

3. Why does =BYROW(A2:A10, LAMBDA(r, TEXTSPLIT(r, ","))) return #CALC!?

More excel errors