FILTER, UNIQUE and SORT practice exercises
Modern Excel formulas can return a whole list that spills into the cells below. Practice FILTER, UNIQUE and SORTBY on an inventory table, and combine them with SUM for one-cell answers.
Try it yourself
A live spreadsheet. Type a formula and press Enter to check it.
List every product in the Furniture category.
Write your formula in the green cell, H2.
Click a cell to add it to your formula, drag to select a range, or click a column letter for the whole column.
All 11 dynamic arrays exercises
- 1→
Filter a list
FreeList every product in the Furniture category.
- 2→
Unique values
FreeList each category once.
- 3→
Out of stock
PremiumList the products that are out of stock (Stock is 0).
- 4→
FILTER by a number
PremiumList every product that costs under $50.
- 5→
Count unique values
PremiumHow many different categories are there? Use one formula that still works when new categories are added.
- 6→
Sort by price
PremiumList all product names sorted by price, most expensive first.
- 7→
Top 3 with TAKE
PremiumList the 3 most expensive products, most expensive first.
- 8→
Stock value with FILTER
PremiumWhat's the total stock value (Price × Stock) of Accessories? Use FILTER.
- 9→
FILTER with AND
PremiumList the Accessories that are in stock (Stock more than 0).
- 10→
FILTER with OR
PremiumList every product that is in Lighting or is out of stock.
- 11→
Name parts with LET
PremiumUse LET to work out the total stock value (Price × Stock) of Furniture.
The dynamic arrays functions, with examples
Every example runs on inventory.xlsx, the same sheet the exercises use, and the results are calculated from that data.
FILTER
Returns every row that meets a condition, spilling the results into the cells below. Excel 2021 and later.
FILTER(array, include, [if_empty])Example
=FILTER(B2:B9, E2:E9=0)returnsStanding deskFloor lampDesk matUNIQUE
Lists each distinct value once, in the order they first appear.
UNIQUE(array, [by_col], [exactly_once])Example
=UNIQUE(C2:C9)returnsLightingFurnitureAccessoriesSORTBY
Sorts one range by the values in another, without changing the source data. Use -1 for largest first.
SORTBY(array, by_array1, [sort_order1], …)Example
=SORTBY(B2:B9, D2:D9, -1)returnsStanding deskOffice chairBookshelfFloor lampMonitor armDesk lampCable trayDesk matLET
Gives a value a name inside a formula so you can reuse it. Long formulas get shorter and easier to read, and the value is only calculated once.
LET(name1, value1, [name2, value2, …], calculation)Example
=LET(value, D2:D9*E2:E9, SUM(value))returns$20,999.00
Common mistakes
- 1
Being stopped by #SPILL!
A formula that returns a list needs empty cells to spill into. #SPILL! means something is in the way: clear the cells below or beside the formula, or move it.
- 2
Not planning for no matches
When nothing meets the condition, FILTER returns #CALC!. Give it the third argument for that case:
=FILTER(B2:B9,E2:E9=0,"None"). - 3
Pointing at a fixed range instead of the spill
If a list spills from G2, refer to all of it as
G2#.=COUNTA(G2#)keeps counting correctly as the list grows;G2:G10misses anything past row 10.