Excel functions / Logical

MAP function

Runs a function on each value of an array and returns the results in the same shape.

Syntax

=MAP(array1, [array2], …, lambda)

Arguments

When to use it

MAP runs a LAMBDA on every value of a range and spills the results in the same shape. It is for calculations that a plain formula cannot do value by value, such as a function that does not accept a range.

Examples

  1. Each price with tax, rounded up to the next 5 cents

    ABC
    1Price
    21.21.45
    38.910.70
    42.42.90

    In C2: =MAP(A2:A4, LAMBDA(p, CEILING.MATH(p*1.2, 0.05))) → 1.45; 10.70; 2.90

    Try this example

  2. A label for each score

    ABC
    1Score
    272Pass
    348Retake

    In C2: =MAP(A2:A3, LAMBDA(s, IF(s>=50, "Pass", "Retake"))) → Pass; Retake

    Try this example

Common mistakes

Try MAP in the playground

Practise it

Related functions