Formula Errors

How to Fix Excel #CALC! Error in MAP and BYROW Formulas

John WilsonJohn Wilson Oct 23, 2026 869 views

Question details

The user needs to fix a #CALC! error occurring when using Excel MAP and BYROW formulas with nested arrays.

How to Fix Excel #CALC! Error in MAP and BYROW Formulas
Product
Excel
Device & OS
not provided
Scenario
Calculating overlapping intervals or multi-layered conditions using LAMBDA functions inside MAP or BYROW formulas.
Observed behavior
Excel returns a #CALC! error because a LAMBDA function inside a MAP or BYROW formula returns another array, resulting in an unsupported nested array calculation.
Before you start

Ensure you are using a Microsoft 365 version of Excel that supports Dynamic Arrays and LAMBDA functions. Review your formula bar to locate where the array-within-array is being generated.

Solution 1Recommended

Replace Nested MAP Arrays with SUMPRODUCT

Bypass the nested array limitation by replacing the inner MAP function with a SUMPRODUCT calculation.

Excel's calculation engine currently does not support nested arrays. This means if you use a MAP or BYROW function, and the LAMBDA inside it attempts to return another array via a second MAP function, Excel will trigger a #CALC! error. For example, the formula '=MAP({1;2;3},LAMBDA(n,MAP({4;5;6},LAMBDA(s,TRUE))))' will fail.

Using SUMPRODUCT resolves this limitation. It calculates the conditions and aggregates them into a single scalar value instead of generating a second array, completely avoiding the unsupported nested-array scenario.

1
Locate the formula causing the error

Select the cell displaying the #CALC! error and examine the formula bar. Look for a MAP or BYROW function that contains another MAP or array-generating function inside its LAMBDA.

2
Remove the inner MAP function

Delete the secondary MAP function and its corresponding LAMBDA statement that is producing the nested array.

3
Insert the SUMPRODUCT function

Replace the deleted section with a SUMPRODUCT formula to evaluate your logic. For instance, if you are checking for overlapping intervals, type: SUMPRODUCT((start<=endInc)*(end>=startInc)).

4
Adjust for duplicate overlap counts

If your overlapping logic counts each pair twice, wrap your entire formula logic to sum the overall results and divide the final number by two (or subtract self-overlaps before dividing).

5
Apply and verify

Press Enter to execute the updated formula. The #CALC! error should disappear and display the correct calculated value.

Replace Nested MAP Arrays with SUMPRODUCT
Microsoft Documentation Note: Microsoft officially documents this specific scenario as the 'Nested Array #CALC! error'. SUMPRODUCT is the standard and most reliable workaround for processing internal arrays without outputting them as a nested list.
Free Microsoft Office alternative

Try WPS Office for Your Spreadsheet Needs

If you are encountering persistent calculation limitations in Microsoft Office, consider trying WPS Office. It is a free, lightweight, and highly compatible alternative that seamlessly opens and edits Excel files while providing a familiar interface and robust formula support without the heavy subscription fees.

  1. 1. Download the software: Visit the official WPS website and download the free WPS Office installation package.
  2. 2. Install WPS Office: Run the installer and follow the on-screen prompts to set up the software on your device.
  3. 3. Open your Excel files seamlessly: Launch WPS Spreadsheet and open your existing .xlsx files directly. All your data and formulas will remain intact.
100% compatible with Microsoft Excel (.xlsx) formats and dynamic arraysFamiliar ribbon interface ensures a seamless migration with zero learning curveLightweight application that uses minimal system resourcesFree to use with comprehensive spreadsheet capabilities
microsoft office alternative - wps office

Frequently Asked Questions

What does the #CALC! error mean in Excel?

The #CALC! error indicates that Excel's calculation engine encountered an unsupported mathematical scenario or an internal limitation, such as attempting to nest one array inside another array.

Why can't I use nested arrays in Excel dynamic formulas?

Excel's calculation engine currently does not support nested arrays (arrays of arrays). Functions like MAP or BYROW cannot output an array if they are already operating inside a function that evaluates an array, which triggers the #CALC! error.

Are there other functions besides SUMPRODUCT to fix nested array errors?

Yes. Depending on your data logic, you can also use aggregation functions like MMULT, SUM, or single-level FILTER and REDUCE formulas to condense the inner logic into a single scalar value.

Why does SUMPRODUCT work instead of MAP for inner array loops?

SUMPRODUCT aggregates the internal array logic and boolean checks into a single calculated number. Because it returns a scalar value rather than an array, it prevents the nested array conflict that causes MAP to fail.