Lists that spill: UNIQUE, FILTER, SORT: practice exercises
UNIQUE, FILTER, SORT, two conditions. 5 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.
In J2, list each team once, using UNIQUE. The list spills down by itself.
| A | B | C | D | E | F | G | H | I | J | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Employee | Team | Sales | Teams | ||||||
| 2 | Jordan | Operations | 48 | |||||||
| 3 | Jess | Sales | 69 | |||||||
| 4 | Zoe | Operations | 13 | |||||||
| 5 | Priya | Sales | 59 | |||||||
| 6 | Maria | Operations | 88 | |||||||
| 7 | Lucy | Support | 71 | |||||||
| 8 | Sunil | Support | 42 | |||||||
| 9 | Nia | Support | 12 | |||||||
| 10 | Grace | Support | 78 | |||||||
| 11 | Hamza | Sales | 29 | |||||||
| 12 | Kerry | Finance | 76 | |||||||
| 13 | Alex | Sales | 36 | |||||||
| 14 | Ben | Sales | 30 | |||||||
| 15 | Dev | Support | 66 | |||||||
| 16 | Sam | Support | 78 |
How it works
Some formulas give a whole list. You type them in one cell and the answers spill into the cells below (and to the right). UNIQUE(range) lists each value once. FILTER(range, test) keeps the rows where the test is TRUE. SORT(range) puts a list in order.
For two conditions in FILTER, multiply the tests: (B2:B9="Sales")*(C2:C9>=40) keeps rows where both are TRUE. Add a third argument to say what to show if nothing matches.
=UNIQUE(B2:B7) =FILTER(A2:A7,B2:B7="Sales") =SORT(A2:A7) =FILTER(A2:A7,(B2:B7="Sales")*(C2:C7>=40),"None")
Formulas that give a list
Most formulas give one answer. These give a whole list, which spills into the cells below. You only type the formula in the first cell.
UNIQUE(range): each value once, in the order they first appear.FILTER(range, test): the rows where the test is TRUE.SORT(range): the list in order, A to Z or smallest first.
The cells it spills into must be empty, or you get #SPILL!. These are in Excel 2021 and later, Excel 365 and Google Sheets.
Worked example: UNIQUE and SORT
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Name | Team | Sales | |||
| 2 | Amira | Sales | 52 | |||
| 3 | Ben | Finance | 30 | |||
| 4 | Cara | Sales | 38 | |||
| 5 | Dev | Support | 45 | |||
| 6 | Ewa | Sales | 40 | |||
| 7 | Finn | Finance | 51 |
=UNIQUE(B2:B7)in E2. Each team once, in the order they first appear: Sales, Finance, Support. Typed in E2, the list spills down to E4.=SORT(UNIQUE(B2:B7))in E2. Wrap it in SORT for alphabetical order: Finance, Sales, Support.
Worked example: FILTER
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Name | Team | Sales | |||
| 2 | Amira | Sales | 52 | |||
| 3 | Ben | Finance | 30 | |||
| 4 | Cara | Sales | 38 | |||
| 5 | Dev | Support | 45 | |||
| 6 | Ewa | Sales | 40 | |||
| 7 | Finn | Finance | 51 |
=FILTER(A2:A7,B2:B7="Sales")in F2. Keep the names (A2:A7) where the team (B2:B7) is Sales: Amira, Cara and Ewa.=FILTER(A2:A7,(B2:B7="Sales")*(C2:C7>=40),"None")in F2. Two tests multiplied together must both be TRUE: Sales and at least 40. Cara drops out. None would show if nobody fitted.
What you'll practise
- In J2, list each team once, using UNIQUE. The list spills down by itself.
- In J2, use FILTER to list everyone in the team named in H1.
- In J2, use FILTER to list the whole row (name, team and sales) for everyone whose sales are at least the target in H1.
- In J2, list each team once, in alphabetical order.
- In J2, use FILTER to list the people in the team in H1 whose sales are at least the number in H2. If nobody fits, show None.
Guides with worked examples: UNIQUE and FILTER: lists that update themselves · #SPILL! in Excel: what it means and how to fix it · Finding and removing duplicates in Excel · SORT and SORTBY: sorted lists that keep up · TRANSPOSE and TOCOL: turning tables round · Count unique values in Excel