Members-only tutorial

Watch the video and get the practice sheet with membership.

See membership options

Wrangle Scattered Data with Flatten()

About this Tutorial

Check out how to use flatten(). Discover the funky formula that makes data wrangling a breeze! Learn how to use Flatten in Google Sheets to organize scattered data and get insights that were previously hidden. Read on to see how this simple trick can save you hours of manual labor. 

Featured Formulas

Video Transcript

<div>0:00 Here's a funky little formula Learn about the syntax rules for using formulas in Google Sheets. Opens in new tab called flatten Discover how the flatten function can simplify your data organization. Opens in new tab , and I'm going to show you how to use it, how I use it, how I love to use it.<br>0:07 But first I want to show you how it works. What is flatten Discover how the flatten function can simplify your data organization. Opens in new tab ? You can flatten Discover how the flatten function can simplify your data organization. Opens in new tab things in Google sheets and you think, oh my gosh, it's already flat.<br>0:16 It's a sheet. Right? Well, it can get flatter. Um, don't flatter me. I love this.

Uh, so if you have data Understand what data types you can work with in Google Sheets. Opens in new tab like in &lt;inaudible&gt; and all the way down to like see to, right, and you have these like six little words and, but I really want them in like a colon.<br>0:36 What I can do is call flatten Discover how the flatten function can simplify your data organization. Opens in new tab and it puts them into a column. It reads everything from left to right up and up to down.<br>0:44 So you can see a one is here in D uh, three, then it goes left to right. Hello. I M and then after it gets through the, uh, range Find out how to define ranges for your formulas in Sheets. Opens in new tab , it goes back and to a, to getting flattened today.<br>1:02 So, hello, I'm getting collected today.

Uh, let me show you how, how that works or what to do to get there.<br>1:07 So you just, it was equal flatten Discover how the flatten function can simplify your data organization. Opens in new tab , and then you put in the range Find out how to define ranges for your formulas in Sheets. Opens in new tab that you want, and we can do a one colon C two, and we get exactly the same thing.<br>1:17 Right. We can also not even deal with the numbers and just do the whole column Learn how to reference entire columns in your formulas. Opens in new tab . So a colon C, and that gets everything in column eight to see, uh, notice, we'd go down to the bottom.<br>1:31 It didn't add any rows because everything's blinking. It understands what's blinked, but it also will show up blank.

So if I put a blank here, there is the blank there.<br>1:42 So it gets the data Understand what data types you can work with in Google Sheets. Opens in new tab , but then once it ends, it ends. Uh, okay. So what is this? It's more like, uh, an unpivot Explore the concept of unpivoting data for better analysis. Opens in new tab almost, uh, some people are using it with, uh, uh, a few other formulas, like split See how to split data into separate cells using formulas. Opens in new tab transpose, um, and doing an unpivot Explore the concept of unpivoting data for better analysis. Opens in new tab .<br>2:02 But very, most of the time, I'm not trying to unpivot Explore the concept of unpivoting data for better analysis. Opens in new tab things I'm trying to pivot Understand how to pivot data for dynamic reporting. Opens in new tab things more and more so flattened, where Learn how to filter data using the query function. Opens in new tab , where Learn how to filter data using the query function. Opens in new tab can we use it on that?<br>2:11 And I like to use it when I wrangled scattered data.

And here's, here's an example of what I mean by that.<br>2:17 So let's say we took a poll of everyone in the company. There's every employee, and we want to know what projects you've been working on just to get sort Discover how to sort your data effectively in Sheets. Opens in new tab of qualitative data Understand what data types you can work with in Google Sheets. Opens in new tab on this.<br>2:28 Right. And we said, Hey, just, we have a list of all the projects, go in, look at each project and put a yes or no.<br>2:34 Or maybe we didn't ask them what to put in there. Just say, tell us if you've been working on this or not.<br>2:39 You know, we took a very simple, we thought it was going to be simple.

He said, Hey, just go into this sheet, fill in if you're working on it or not, maybe we messed up and we didn't say, Hey, only say yes or no.<br>2:51 Maybe there are notes Find out how to add notes to your cells for better context. Opens in new tab . There are extra little data Understand what data types you can work with in Google Sheets. Opens in new tab pieces. People will leave comments Learn how to use comments for collaboration in Sheets. Opens in new tab , uh, all sorts of things gonna happen when you don't give exact instructions.<br>3:02 Right.

Or if you don't use data validation Explore how to create dropdown lists for data entry. Opens in new tab , uh, to tell someone they've entered something wrong, uh, this is what you get now, what happens is like everybody, some people capitalize, some people didn't capitalize.<br>3:15 Some people said sometimes, or forever or so Carl even here wrote in, oh no, nobody works on this. And in fact, yeah, nobody works on this when he could have just said no, but Carl had to put in a comment Understand the difference between comments and notes. Opens in new tab .<br>3:27 Right.

And look, it is so simple and easy and takes only a minute or two to go down a list like this, uh, 27, I think I've seen some more 30 projects, five people, not a big deal.<br>3:43 Right. Okay. You can probably change these by hand to like yes or no. Okay. Sometimes it means yes. Forever means.<br>3:52 Yes. You know, never will be no. Sure. You can do it by hand.

But what if some of this data Understand what data types you can work with in Google Sheets. Opens in new tab is actually important?<br>4:00 What if we want to know, Hey, we didn't come up with these edge cases when we first asked this question, right?<br>4:06 We want to know the edge cases we, we wanted this data Understand what data types you can work with in Google Sheets. Opens in new tab . So what I usually did in the past before flattened was I could do unique Learn how to extract unique values from your data sets. Opens in new tab .<br>4:15 Unique Learn how to extract unique values from your data sets. Opens in new tab is cool because let's do Bob's row B to B and it gets each unique Learn how to extract unique values from your data sets. Opens in new tab point there. And then it also gets the name of the column.<br>4:28 So we can actually get that out, rid of that by just doing two.

Um, and now if we want to count, let's say count, if this is always fun, I use count F on column B and we use yes.<br>4:40 As the criterion and we get a nice count and double like on that. And we get that. We get all of the count in that row.<br>4:49 Right? Okay. Well, we have five, four other columns here. So if we do, yes, we can do this unique Learn how to extract unique values from your data sets. Opens in new tab . We can do this again.<br>4:58 Right. We can Even get all the uniques of each row. There we go. We got all the uniques of each row.<br>5:09 So it's five unique Learn how to extract unique values from your data sets. Opens in new tab . Now I need to get you to any of this.

So, you know, sometimes I might go like, um, I might actually get to the bottom here, Do something like, let's just delete everything on.<br>5:25 Um, Okay. And just deleted everything row 4 51 in down. And what we can do is then do unique Learn how to extract unique values from your data sets. Opens in new tab . And this is going to take a while, right?<br>5:37 This is just a few steps too much. Um, but it will get us the answer that will be super fast with flattened.<br>5:46 So we can put all of these in a single column. Okay. So I put all five uniques in one column.<br>5:57 Now I need a unique Learn how to extract unique values from your data sets. Opens in new tab of unique Learn how to extract unique values from your data sets. Opens in new tab . So we'd go unique Learn how to extract unique values from your data sets. Opens in new tab .

I've done this before with like thousands of rows of data Understand what data types you can work with in Google Sheets. Opens in new tab .<br>6:04 And it's not that fun yet, or unique Learn how to extract unique values from your data sets. Opens in new tab of uniques. Uh, H okay, now we have uniques of uniques. Now we know every unique Learn how to extract unique values from your data sets. Opens in new tab thing in this entire thing, but like, that was not fun.<br>6:19 Right. We had to do with rows and columns and deletions, and this unique Learn how to extract unique values from your data sets. Opens in new tab of uniques flattened is going to help us.<br>6:26 So-so so much in the next, uh, tap one second. All right.

In one formula Learn about the syntax rules for using formulas in Google Sheets. Opens in new tab , I'm just going to type in here equals flatten Discover how the flatten function can simplify your data organization. Opens in new tab , and I'm going to do B two all the way to, we already know it F 50, And we get every single item in B2 to FFT.<br>6:52 And now you only one go, we can do unique Learn how to extract unique values from your data sets. Opens in new tab . Uh, H H and there we go. We have the same answer, right?<br>7:01 In this unique Learn how to extract unique values from your data sets. Opens in new tab of your needs, where Learn how to filter data using the query function. Opens in new tab we've had to copy and paste and edit, uh, these formulas pretty manually, right.<br>7:10 We still get the exact same, uh, answer, but we get it in so much faster.

You know, one interesting thing too, is we may want to use this data Understand what data types you can work with in Google Sheets. Opens in new tab to figure out, is there a blank here or not?<br>7:25 Now, one thing to note Discover how to use notes for additional information in cells. Opens in new tab is the blanks at the end of the rows, won't show up with them, think show you.<br>7:33 They do show up. There it is. There's a blank.

Um, and what is interesting is I've been able to find blanks pretty easily.<br>7:45 If I, if I hold down command and push down the down arrow, you can see what is it sort Discover how to sort your data effectively in Sheets. Opens in new tab of hard to explain whatever is if you're in a piece of data Understand what data types you can work with in Google Sheets. Opens in new tab , if you're in a cell with data Understand what data types you can work with in Google Sheets. Opens in new tab , it'll go to the last cell with data Understand what data types you can work with in Google Sheets. Opens in new tab .<br>8:00 If you're in a, uh, blink cell, it'll go to the last blink cell.

So this makes it super easy for me to check if there are blinks.<br>8:12 Um, if I just take my cursor and move through it with the command, I can really quickly see if there's any data Understand what data types you can work with in Google Sheets. Opens in new tab or if there's any data Understand what data types you can work with in Google Sheets. Opens in new tab in, um, blank cells Find out how to identify and manage blank cells in your data. Opens in new tab or blank cells Find out how to identify and manage blank cells in your data. Opens in new tab in where Learn how to filter data using the query function. Opens in new tab there should be data Understand what data types you can work with in Google Sheets. Opens in new tab .<br>8:28 But now everything's in one, one column.

So now there's a blank right here, and I don't have to search around for five of them.<br>8:38 And again, this is going to be sound really stupid and silly if you're talking about 20 cells Understand the different types of cells and their functions. Opens in new tab of data Understand what data types you can work with in Google Sheets. Opens in new tab , but if you have 20,000 cells Understand the different types of cells and their functions. Opens in new tab of data Understand what data types you can work with in Google Sheets. Opens in new tab , if you even have a thousand cells Understand the different types of cells and their functions. Opens in new tab of data Understand what data types you can work with in Google Sheets. Opens in new tab or even, um, sort Discover how to sort your data effectively in Sheets. Opens in new tab of not a wide or not a tall, uh, piece, a sense of data Understand what data types you can work with in Google Sheets. Opens in new tab , you have maybe lots of rows in lots of cell, uh, columns.<br>9:04 Then this kind of flattened thing will help you immensely, right? It will bring you all of the data that sort of scattered, right.<br>9:12 And it will help you wrangle it.

So, uh, use flatten Discover how the flatten function can simplify your data organization. Opens in new tab , let me know how you use it in the comments Learn how to use comments for collaboration in Sheets. Opens in new tab .<br>9:18 Uh, thanks for watching this video.</div>