How to Fix Excel #CALC! Error in MAP and BYROW Formulas
Question details
The user needs to fix a #CALC! error occurring when using Excel MAP and BYROW formulas with nested arrays.

- 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.
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.
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.
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.
Delete the secondary MAP function and its corresponding LAMBDA statement that is producing the nested array.
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)).
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).
Press Enter to execute the updated formula. The #CALC! error should disappear and display the correct calculated value.

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. Download the software: Visit the official WPS website and download the free WPS Office installation package.
- 2. Install WPS Office: Run the installer and follow the on-screen prompts to set up the software on your device.
- 3. Open your Excel files seamlessly: Launch WPS Spreadsheet and open your existing .xlsx files directly. All your data and formulas will remain intact.

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.




