Confident CellsExcel practice Start free

Stacking and reshaping lists: practice exercises

VSTACK, HSTACK, DROP, CHOOSEROWS, TOCOL, TRANSPOSE. 6 exercises on real-looking data, each marked the moment you press Check. The first exercise is below to try now; the full lesson is part of Pro.

Your turn

In F2, make one list of everyone: the North team, then the South team underneath, using VSTACK. Leave out the headings.

ABCDEF
1North teamSouth teamEveryone
2NiaWill
3PippaRachel
4PriyaZoe
5SamTanya
6EllaDev
7Chen
8
9
10
11
12

How it works

These functions take lists and tables and give you a new one, which spills. VSTACK puts lists one under another and HSTACK puts them side by side. DROP leaves out rows at the top or bottom, and CHOOSEROWS picks the rows you want.

TOCOL turns a grid into one column, and TRANSPOSE turns a table on its side.

=VSTACK(A2:B4,D2:E4) =DROP(A2:B5,-1) =CHOOSEROWS(A2:B5,1,-1) =HSTACK(A2:A4,B2:B4*2) =TOCOL(B2:F4,1) =TRANSPOSE(A1:B5)

Making new lists from old ones

Excel 365 and Excel 2024 have functions that build a new list or table from ones you already have. Like FILTER and SORT, you type them in one cell and the answer spills.

  • VSTACK(list1, list2): one list under the other.
  • HSTACK(list1, list2): side by side.
  • DROP(table, 1): everything except the first row. -1 leaves out the last row instead.
  • CHOOSEROWS(table, 1, 3): just the 1st and 3rd rows. -1 is the last row.

Worked example

ABCDE
1NameHoursNameHours
2Amira30Dev25
3Ben12Ewa40
4Cara45Finn18
5Total87Total83
  1. =VSTACK(A2:B4,D2:E4) in G2. The second table goes under the first, giving six rows from Amira to Finn. The ranges stop at row 4, so the Total rows are left out.
  2. =DROP(A2:B5,-1) in G2. DROP with -1 leaves out the last row, the Total. You get Amira, Ben and Cara.
  3. =CHOOSEROWS(A2:B5,1,-1) in G2. Row 1 and the last row: Amira with 30, and the Total, 87.

One column, or on its side

TOCOL(B2:F4) reads the grid along each row in turn and puts everything in one column. Add 1 to leave out empty cells: TOCOL(B2:F4,1). Wrap it in UNIQUE to list each name once.

TRANSPOSE(A1:G2) turns a table on its side. Two rows going across become two columns going down.

What you'll practise

  1. In F2, make one list of everyone: the North team, then the South team underneath, using VSTACK. Leave out the headings.
  2. This export ends with a Total row. In E2, list every row from A2:C12 except the Total, using DROP.
  3. In D2, show the first and the last month (month and sales), using CHOOSEROWS. A minus number counts from the bottom.
  4. In F2, use HSTACK to show each name next to their half-year total (Q1 plus Q2), in one formula.
  5. In H2, list everyone on this week's rota once each. TOCOL with 1 turns the grid B2:F4 into one column, leaving out empty shifts. UNIQUE then takes out the repeats.
  6. The report needs the months going down, not across. In A5, turn the whole table A1:G2 on its side with TRANSPOSE, headings included.

Guides with worked examples: VSTACK and HSTACK: joining lists in Excel · DROP, TAKE and CHOOSEROWS: picking rows from a table · TRANSPOSE and TOCOL: turning tables round · TEXTSPLIT: splitting text into cells with a formula · #SPILL! in Excel: what it means and how to fix it