Confident CellsExcel practice Start free

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.

Your turn

In J2, list each team once, using UNIQUE. The list spills down by itself.

ABCDEFGHIJ
1EmployeeTeamSalesTeams
2JordanOperations48
3JessSales69
4ZoeOperations13
5PriyaSales59
6MariaOperations88
7LucySupport71
8SunilSupport42
9NiaSupport12
10GraceSupport78
11HamzaSales29
12KerryFinance76
13AlexSales36
14BenSales30
15DevSupport66
16SamSupport78

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

ABCDEF
1NameTeamSales
2AmiraSales52
3BenFinance30
4CaraSales38
5DevSupport45
6EwaSales40
7FinnFinance51
  1. =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.
  2. =SORT(UNIQUE(B2:B7)) in E2. Wrap it in SORT for alphabetical order: Finance, Sales, Support.

Worked example: FILTER

ABCDEF
1NameTeamSales
2AmiraSales52
3BenFinance30
4CaraSales38
5DevSupport45
6EwaSales40
7FinnFinance51
  1. =FILTER(A2:A7,B2:B7="Sales") in F2. Keep the names (A2:A7) where the team (B2:B7) is Sales: Amira, Cara and Ewa.
  2. =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

  1. In J2, list each team once, using UNIQUE. The list spills down by itself.
  2. In J2, use FILTER to list everyone in the team named in H1.
  3. In J2, use FILTER to list the whole row (name, team and sales) for everyone whose sales are at least the target in H1.
  4. In J2, list each team once, in alphabetical order.
  5. 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