MAP
The MAP
function in Google Sheets allows you to map each value in a given array to a new value by applying a LAMBDA function to each value.
Function Syntax and Parameters
Syntax: MAP(array1, [array2, ...], LAMBDA)
Parameters:
array1
: The first array to be mapped.array2, ...
: [Optional] Additional arrays to be mapped.LAMBDA
: The function applied to each value in the arrays.
Step-by-Step Tutorial
-
Using
MAP
with a single array:- Example:
=MAP(A1:A5, LAMBDA(x, x^2))
- Result:
[1, 4, 9, 16, 25]
- Example:
-
Using
MAP
with multiple arrays:- Example:
=MAP(A1:A5, B1:B5, LAMBDA(x, y, x+y))
- Result:
[3, 7, 11, 15, 19]
- Example:
Use Cases and Scenarios
- Data Transformation: Apply a specific formula to each value in an array.
- Array Combination: Combine two or more arrays by applying a specific operation to their corresponding values.
Related Functions
FILTER
: Filter values from an array based on a condition.SORT
: Sort values in an array or range.REDUCE
: Reduce an array or range to a single value using a LAMBDA function.