MAP and MAKEARRAY in Excel: Transform Arrays and Build Custom Grids With LAMBDA

Isometric spreadsheet illustration showing MAP in Excel transforming an array into a custom grid

Dragging a formula across hundreds of rows—or writing nested AND checks inside FILTER that break on array operations—slows down modern spreadsheet workflows. With MAP in Excel and its companion generator MAKEARRAY, you can transform every element across one or more ranges using a custom LAMBDA, or build a brand-new 2D grid from scratch in a single spilling formula.

Availability & Compatibility: Per the official MAP function documentation and MAKEARRAY function documentation, both functions are available in Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel for the web, Excel 2024, and Excel 2024 for Mac (plus Google Sheets). Older perpetual versions such as Excel 2021 and Excel 2019 do not support them and will display #NAME?.

How MAP in Excel Works (Transform One or More Arrays)

MAP evaluates each value in one or more arrays through a LAMBDA function in Excel and returns a new spilled array with the exact same dimensions. Here is the syntax:

=MAP(array1, [array2, ...], LAMBDA(param1, [param2, ...], calculation))
  • array1, [array2, …] (Required): One or more ranges or dynamic arrays to map cell-by-cell. All arrays must have matching dimensions.
  • lambda (Required): Must be the final argument and must declare one parameter for every array passed in (for example, two parameters s and c when mapping two columns).

Suppose your Practice sheet tracks six apparel orders in A6:D11 (Order ID, Size, Color, and Price). Because Excel’s AND function normally collapses an entire column into a single TRUE/FALSE instead of checking row-by-row, wrapping two columns inside MAP solves the problem cleanly. To flag every order that is both Large and Red from cell F6, enter:

=MAP(B6:B11, C6:C11, LAMBDA(s, c, AND(s="Large", c="Red")))

Even better, you can pass that exact MAP expression straight into the FILTER function in Excel to extract only matching rows dynamically: =FILTER(A6:D11, MAP(B6:B11, C6:C11, LAMBDA(s, c, AND(s="Large", c="Red")))). Need a conditional price discount? Map Column D alone to apply 15% off orders above $100: =MAP(D6:D11, LAMBDA(p, IF(p>100, p*0.85, p))).

How MAKEARRAY Works (Generate Custom 2D Grids From Scratch)

While MAP transforms existing cells, MAKEARRAY creates a brand-new 2D array of a specified row and column size by calling a LAMBDA with each cell’s row and column index:

=MAKEARRAY(rows, cols, LAMBDA(row, col, calculation))
  • rows (Required): Total number of rows to generate. Must be an integer greater than 0.
  • cols (Required): Total number of columns to generate. Must be an integer greater than 0.
  • lambda (Required): A two-parameter LAMBDA(r, c, calculation) receiving the current 1-based row index r and column index c.

To generate a dynamic 4×4 multiplication grid starting in cell B14 of your Practice sheet without typing a single input value, enter:

=MAKEARRAY(4, 4, LAMBDA(r, c, r*c))

In real-world financial models, MAKEARRAY shines for building dynamic amortization grids, tiered pricing tables, or random test matrices using RANDBETWEEN or CHOOSE inside the LAMBDA.

MAP vs. MAKEARRAY vs. BYROW & BYCOL

Use this comparison table to pick the right LAMBDA helper function for your task:

FunctionInput RequiredOutput ShapeLAMBDA ParametersBest Use Case
MAP1 or more arraysSame size as input array(s)1 per input arrayElement-by-element transforms & multi-column AND/OR checks
MAKEARRAYRow & column countsrows × cols grid2 (row, col)Multiplication grids, schedules, synthetic test tables
BYROW / BYCOL1 2D array1 column or 1 row summary1 (entire row or col)Row/column totals, peaks, or pass/fail flags

Troubleshooting #VALUE!, #SPILL!, and #NAME? Errors

  • #VALUE! error (“Incorrect Parameters”): Per Microsoft Support, MAP returns #VALUE! if the number of LAMBDA parameters doesn’t match the number of input arrays. In MAKEARRAY, passing rows or cols less than 1 (or non-numeric values) also returns #VALUE!.
  • Mismatched array sizes in MAP: When passing multiple ranges to MAP (such as B6:B11 and C6:C10), mismatched row or column counts produce #VALUE! or #N/A errors—always align range bounds.
  • #SPILL! error: Both functions spill dynamically onto neighboring cells. Clear any existing values or merged cells in the output path—see our guide on how to fix the #SPILL! error in Excel.
  • #NAME? error: The workbook was opened in Excel 2021 or older, where MAP and MAKEARRAY are not supported.

Frequently Asked Questions

Download the practice workbook

The same data as this tutorial, with empty answer cells and a Solutions sheet.

Team Xl in Excel

Team Xl in Excel

Spreadsheet Architect & Educator at Xl in Excel. Sharing advanced formulas, dynamic arrays, and clean data modeling techniques.

Learn More About Team Xl in Excel →

Leave a Reply

Your email address will not be published. Required fields are marked *

Zoom: 100% | UTF-8 | Xl in Excel