Vertically Stack and Sort Data

About this Tutorial

It's a common problem: combining two lists of scores to identify top performers using Google Sheets. We demonstrate how to sort data from two different ranges using the VSTACK function and also using curly brackets. Learn the step-by-step process to create a single, vertically stacked dataset that can be sorted effectively.

Featured Formulas

Video Transcript

0:00 A common problem that comes up when we're dealing with data and trying to sort data and analyze data and manage data is we have two lists somewhere.
0:08 Maybe two different people are taking scores or different scores are being scored at different times. And we want to stack these.
0:16 We want to see what are the top scores and we want to see what are the top people, but we have these two lists.
0:20 Data sets. Here we have on the left a name and a score and on the right we have a name and a score.
0:25 And we want to see who among this group has the top score. How do we do that programmatically or systematically?
0:32 Uh we will probably try to start using sort right away. We'll use a range and we'll see that sort only accepts one range.
0:40 The second thing we do here is uh sort column. So we need to say sort the second column and is it ascending or descending?
0:49 Is it highest score first? And we're going to say ascending meaning lowest score first is false. We want the highest score.
0:57 So here we have only the score from here. So what we need to do is we need to combine sort and something else.
1:04 Instead of the range being only one single range, we can use Vstack here. Vstack is going to allow us to have two ranges.
1:12 We're going to select our first range over here and then our second range over here. And we and we keep the exact same sort as we did before, but now we have the sort across both of these lists.
1:28 If we change, let's say, Michelle over here to a score of 14, we now see Michelle is at the top of the score list.
1:36 And so using Vstack here, we are able to create The essentially one array or one vertically stacked item. We can also, there's another thing if you don't remember Vstack here, we can also use two curly brackets and use a semicolon in between, and let's see if this works.
1:59 Use a semicolon, and we have it. Have both of these here, and we get exactly the same thing. So we can use Vstack or we can use this pretty much non-formula use of a, essentially like array formula.
2:15 it combines two formulas, or sorry, two ranges with just one. Just curly brackets. So again, we can use Vstack here, or we can use these curly brackets with a semicolon.
2:25 Either one is going to work, uh, and get the same result, which is we want one single vertically stacked dataset that is sorted, right?
2:36 So we use sort and Vstack as a formula combination, or this curly bracket.