FLATTEN(range1,[range2,...])One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
range1:
The first range of cells that you want to flatten into a single column.
range2:
An optional additional range of cells that you want to include in the flattening process. You can include multiple ranges separated by commas.
The FLATTEN function in Google Sheets is a useful tool that allows you to convert a range or array of values into a single column. This function is particularly helpful when you want to simplify data presentation or when you need to work with data in a linear format. By flattening a range, you can easily manipulate and analyze data without dealing with multiple rows and columns.
In simpler terms, FLATTEN takes a multi-dimensional array and transforms it into a one-dimensional array, making it easier to work with in various scenarios.
Imagine you have a table of sales data for different products, organized in a grid format:
| Product | Q1 Sales | Q2 Sales | Q3 Sales |
|---|---|---|---|
| Widget A | 100 | 150 | 200 |
| Widget B | 120 | 130 | 140 |
| Widget C | 90 | 110 | 95 |
You want to create a single column that lists all the sales figures for each product across all quarters.
To achieve this, you would use the FLATTEN function as follows:
=FLATTEN(A2:D4)In this formula:
A2:D4 is the range that contains the sales data, including product names and sales figures.When you apply the FLATTEN formula to the Sales Data Table, the output would look like this:
| Sales Figures |
|---|
| Widget A |
| 100 |
| 150 |
| 200 |
| Widget B |
| 120 |
| 130 |
| 140 |
| Widget C |
| 90 |
| 110 |
| 95 |
As you can see, the FLATTEN function has transformed the multi-dimensional array into a single column, making it easier to analyze the sales figures.
FLATTEN is beneficial because it simplifies the organization of data, allowing for easier analysis and manipulation. It can be particularly useful when you need to prepare data for charts, pivot tables, or other analytical tools that require a linear format. Additionally, it helps in cleaning up data by removing the complexity of multiple rows and columns.
FLATTEN is an essential function for anyone working with data in Google Sheets, providing a powerful way to enhance data organization and analysis capabilities.
Happy spreadsheeting!
You have a table with multiple columns for sales data across different regions. By using the FLATTEN formula, you can convert this multi-column data into a single column list, making it easier to analyze total sales figures without losing any information.
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.