0PricingLogin
Excel Formulas Academy · Lesson

Looping With MAP and REDUCE

Apply a LAMBDA across an array to transform or accumulate values.

Looping Without Code

Sometimes you want to apply the same calculation to every value in a range, or boil a whole range down to a single number. In programming this is a loop. In modern spreadsheets, MAP and REDUCE do this for you using LAMBDA.

  • MAP transforms each element of an array into a new element
  • REDUCE combines all elements into one accumulated result

Both take a LAMBDA that describes what to do with each value. They are available in Microsoft 365 and Google Sheets.

How MAP Works

MAP walks through an array and applies a LAMBDA to each item, producing a new array of the same size. The LAMBDA's parameter receives one element at a time.

The pattern is: give MAP the array, then a LAMBDA whose parameter stands for each value. MAP spills the transformed results across cells automatically.

=MAP(array, LAMBDA(value, calculation))

All lessons in this course

  1. Naming Steps With LET
  2. Defining Custom Functions With LAMBDA
  3. Looping With MAP and REDUCE
  4. Cleaner Formulas With Named LAMBDAs
← Back to Excel Formulas Academy