MAP Function in Google Sheets

Apply a custom function to each element in one or more arrays using the MAP function.

MAP Function

The MAP function in Google Sheets applies a specified LAMBDA function to each element of one or more arrays.

Syntax

MAP(array1, [array2, ...], LAMBDA)
  • array1: The first array to apply the function to.
  • array2, ...: Additional arrays to apply the function to (optional).
  • LAMBDA: A custom function to apply to each element.

Examples

  1. Basic Example

Apply a custom function to add corresponding elements of arrays A1:A3 and B1:B3:

=MAP(A1:A3, B1:B3, LAMBDA(x, y, x + y))

Notes

  • Can handle multiple arrays in parallel.
  • REDUCE: Apply a custom function to reduce an array.