MAP(array1, [array2, ...], LAMBDA)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
array1:
The first array or range of cells that you want to map over.
array2:
(Optional) Additional arrays or ranges of cells that you want to map over alongside array1. You can include multiple arrays.
LAMBDA:
A function that defines the operation to be performed on each element of the arrays. This function can take parameters corresponding to the elements of the arrays and return a value for each mapping.
The MAP function in Google Sheets is a dynamic array function that allows you to apply a specified function to each element in an array or range, returning an array of results. This function is particularly useful for performing calculations or transformations on a set of data without the need for complex formulas or additional helper columns.
In simpler terms, MAP enables you to efficiently process and manipulate data in bulk, making it easier to analyze and visualize information.
Imagine you have a list of sales data that includes the quantities sold and the price per unit for various products:
| ProductName | Quantity | PricePerUnit |
|---|---|---|
| Widget A | 3 | 25.00 |
| Widget B | 5 | 30.00 |
| Widget C | 2 | 15.00 |
You want to calculate the total sales for each product by multiplying the quantity sold by the price per unit.
To achieve this, you would use the MAP function as follows:
=MAP(B2:B4, C2:C4, LAMBDA(q, p, q * p))In this formula:
B2:B4 is the range containing the quantities sold.C2:C4 is the range containing the price per unit.LAMBDA(q, p, q * p) is a custom function that takes two arguments (quantity and price) and returns their product.When you apply the MAP formula to the Sales Data Table, the output would look like this:
| ProductName | Quantity | PricePerUnit | TotalSales |
|---|---|---|---|
| Widget A | 3 | 25.00 | 75.00 |
| Widget B | 5 | 30.00 | 150.00 |
| Widget C | 2 | 15.00 | 30.00 |
The MAP function calculates the total sales for each product and displays the results in the new column.
MAP is beneficial because it streamlines the process of applying functions to arrays, reducing the need for repetitive formulas and enhancing spreadsheet efficiency. It allows for easy data manipulation and can significantly simplify complex calculations.
MAP is an essential function for anyone working with data in Google Sheets, providing a powerful way to enhance data analysis and reporting capabilities.
Happy spreadsheeting!
You have a table with sales data in Column A and corresponding commission rates in Column B. Use the MAP function to calculate total commissions for each sale by multiplying sales amounts with their respective rates, streamlining commission calculations.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.