Function Problems

Fix LAMBDA and MAP Errors in Excel LET Formulas

Ayan MasoodAyan Masood Nov 11, 2026 869 views

Question details

The user needs to fix an error caused by using MAP inside BYROW within a LET formula to generate a dynamic matrix of product attributes.

How to Fix LAMBDA and MAP Errors in Excel LET Formulas
Product
Excel
Device & OS
not provided
Scenario
Converting repeated product numbers and attributes into a structured two-dimensional matrix using dynamic array functions.
Observed behavior
The formula returns #CALC! or #N/A errors because Excel currently does not support returning an array of arrays from MAP inside BYROW.
Before you start

Ensure you are using a version of Excel that supports dynamic array functions like LET, LAMBDA, MAP, and BYROW, such as Excel 365 or Excel 2021. Check your data range to ensure there are no empty cells that might interfere with the UNIQUE function.

Solution 1Recommended

Replace Nested MAP and BYROW with XLOOKUP

Excel cannot output an array of arrays from a nested MAP and BYROW function. The most efficient workaround is building a two-dimensional lookup array using XLOOKUP.

Nesting iterative functions often causes Excel to attempt generating an array of arrays, triggering a #CALC! error. By concatenating the lookup values, we can flatten the logic and use XLOOKUP to handle the matrix generation smoothly.

1
Define your variables

Start your LET function and select your data ranges for product numbers (e.g., A2:A147), attribute names (e.g., F2:F147), and attribute values (e.g., G2:G147).

2
Create a concatenated lookup array

Combine the product numbers and attribute names using an ampersand and a delimiter like a pipe character. For example: lookup_array, p_num&"|"&attrib_name.

3
Extract unique values for headers

Generate the matrix framework by extracting unique rows and columns. Use UNIQUE(p_num) for the row headers and TOROW(UNIQUE(attrib_name)) for the column headers.

4
Implement XLOOKUP

Write the XLOOKUP step to bypass MAP: results, XLOOKUP(nums&"|"&names, lookup_array, attrib_value, "").

5
Combine the arrays

Wrap everything together using HSTACK and VSTACK to join your row headers, column headers, and the new results matrix into a single output: HSTACK(VSTACK("P_NUM",nums),VSTACK(names,results)).

Replace Nested MAP and BYROW with XLOOKUP
Matrix Successfully Generated: Your final formula will efficiently process multi-cell arrays and output the results grid without triggering the #CALC! error.

Build Advanced Dynamic Array Formulas in WPS Spreadsheet

WPS Spreadsheet fully supports modern dynamic array functions like LET, LAMBDA, XLOOKUP, and REDUCE. You can build complex, multi-dimensional reports and troubleshoot array formulas without performance issues.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the document containing your product and attribute lists.
  2. 2. Select the destination cell: Click on the cell where you want the dynamic matrix to start spilling its data.
  3. 3. Type your formula: Enter your =LET(...) formula utilizing XLOOKUP or REDUCE to bypass nested array limitations.
  4. 4. Press Enter to execute: Hit Enter to instantly spill the evaluated matrix results across the required rows and columns.
Full compatibility with Excel's advanced dynamic array functions like LET, LAMBDA, and XLOOKUP.Smooth and lightweight performance when processing large data matrices.Seamless compatibility with Microsoft Excel (.xlsx) file formats.Free to use with a familiar, easy-to-navigate tabbed interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my LET formula return a #CALC! error in Excel?

The #CALC! error usually occurs when an Excel formula attempts an operation that isn't supported, such as returning an array of arrays. This frequently happens when trying to nest a MAP function inside a BYROW function.

Can Excel return arrays within arrays using LAMBDA?

Currently, Excel does not support 'arrays of arrays' or multi-dimensional nested arrays natively through iterative functions like MAP or BYROW. You must flatten the lookup variables or use XLOOKUP on concatenated strings to output a single two-dimensional array.

What does the DROP function do when used with REDUCE?

When building a data matrix with REDUCE and VSTACK, you typically start the formula with a blank accumulator string (""). The DROP function is used at the end to target and remove this initial blank row from your final output matrix.