MAKEARRAY(rows, columns, LAMBDA)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
rows:
The number of rows that the array will have.
columns:
The number of columns that the array will have.
LAMBDA:
A function that defines how to calculate the values for each cell in the array, taking the row and column indices as parameters.
The MAKEARRAY function in Google Sheets is a versatile tool that allows users to create an array of values based on specified dimensions and a custom formula. This function is particularly useful for generating dynamic arrays that can be used for calculations, data manipulation, or even for creating complex data structures without the need for manual entry.
In simpler terms, MAKEARRAY enables you to generate a grid of values in a single formula, making it easier to handle large datasets and perform operations on them efficiently.
Imagine you want to create a multiplication table for the numbers 1 through 5:
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | |||||
| 3 | |||||
| 4 | |||||
| 5 |
You want to fill in this table with the product of the row and column headers.
To achieve this, you would use the MAKEARRAY function as follows:
=MAKEARRAY(5, 5, LAMBDA(r, c, r * c))In this formula:
5 is the number of rows you want in the array.5 is the number of columns you want in the array.LAMBDA(r, c, r * c) is a custom function that takes the row index r and column index c and returns their product.When you apply the MAKEARRAY formula, the output would look like this:
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 | 5 |
| 2 | 2 | 4 | 6 | 8 | 10 |
| 3 | 3 | 6 | 9 | 12 | 15 |
| 4 | 4 | 8 | 12 | 16 | 20 |
| 5 | 5 | 10 | 15 | 20 | 25 |
This table now dynamically displays the products of the numbers 1 through 5.
MAKEARRAY is beneficial because it simplifies the process of generating arrays in Google Sheets. It allows for dynamic calculations without the need for extensive manual data entry. Additionally, it can be combined with other functions to create more complex data manipulations, making your spreadsheets more powerful and efficient.
MAKEARRAY is an essential function for anyone looking to enhance their data manipulation capabilities in Google Sheets, providing a powerful way to automate and streamline data entry and calculations.
Happy spreadsheeting!
You have a dataset of sales data with columns for product IDs and sales figures. Using the MAKEARRAY function, you can create a dynamic summary table that calculates total sales per product, allowing for quick analysis and visualization of sales performance.
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.