FormulaCamp
Completed
5. Advanced Formulas · Formula Builders · 25 min

15. LAMBDA, MAP, REDUCE, BYROW

Lesson 15 of 20
Task 1 of 3
  1. In C2, calculate all prices with a 7% discount, rounded down to whole dollars, with a single formula.

Lesson theory

LAMBDA(parameter, calculation) is your own small function right inside a formula. By itself it calculates nothing; you pass it to the helper functions:

  • MAP(array, LAMBDA(x, …)) applies it to every element and returns an array;
  • REDUCE(start, array, LAMBDA(acc, x, …)) folds an array into a single value;
  • SCAN is like REDUCE but shows all the intermediate totals (a running total);
  • BYROW(array, LAMBDA(row, …)) returns one value per row.

In Excel 365 you can save a LAMBDA in the Name Manager and call it like a normal function: =SalesTax(A2). The practice grid here supports LAMBDA inside formulas and the helper functions.

Practice is part of Pro

The live spreadsheet, task checking and .xlsx files in all 170 lessons. Your progress is saved in this browser; sync across devices is coming soon.