Tables, sorting, filtering and drop-down lists
Turn a range into an Excel table, sort and filter thousands of rows in seconds, remove duplicates, use the FILTER, SORT and UNIQUE functions, and stop typing mistakes with drop-down lists.
🎯 By the end of this lesson you will be able to:
- Format data as a table and sort and filter it
- Use FILTER, SORT and UNIQUE to build lists that update themselves
- Prevent typing errors with Data Validation drop-down lists
Outline
What you'll learn and why it matters
With real data you rarely look at every row. You need *only this month*, *the biggest orders first*, *each region once*. Tables, sorting and filtering do that instantly, and drop-down lists stop people typing Nroth instead of North in the first place.
Format as a table
- Click any cell inside your data (the Sales sheet).
- On the Home tab choose Format as Table (or Insert → Table), pick a style, and confirm that *My table has headers* is ticked.
- Excel adds banded rows, filter arrows on every heading, and gives the table a name such as
Table1(change it on the Table Design tab).
| What a table gives you | Why it helps |
|---|---|
| Filter and sort arrows on each heading | Sort and filter without selecting anything |
| Grows automatically when you add a row below it | Formulas, charts and PivotTables include new data |
| Formulas copied down the whole column automatically | No more forgotten rows |
Structured references like =SUM(Table1[Total]) | Formulas that read like English |
| A Total Row (Table Design tab) | Totals, averages or counts with one click |
Sorting
Click the arrow on a heading and choose Sort Smallest to Largest (A to Z for text) or Largest to Smallest. For several levels, such as *by region, then by total*, use Data → Sort (called Custom Sort in some versions) and add levels.
Filtering
Click a heading's arrow, untick Select All, and tick just the values you want, such as *North*. Rows that do not match are hidden, not deleted; the row numbers turn blue to remind you. Filter several columns to combine conditions. Clear Filter shows everything again.
FILTER, SORT and UNIQUE: lists that update themselves
These newer functions return a whole list that spills into the cells below and to the right. Change the data and the list updates. They work in Excel for the web, Microsoft 365, Excel 2021 and later, and Google Sheets.
Worksheet: Sales
| Row | A | B | C | D | E | F | G | H | I | J | K | L |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Region | Salesperson | Product | Units | Price | Total | Regions | North products | ||||
| 2 | West | Asha | Sketchbook | 11 | 300 | 3300 | East | Pen set | ||||
| 3 | North | Meera | Pen set | 4 | 250 | 1000 | North | Notebook | ||||
| 4 | West | Ravi | Sketchbook | 3 | 300 | 900 | South | Pen set | ||||
| 5 | North | Sara | Notebook | 9 | 120 | 1080 | West | Desk lamp | ||||
| 6 | East | Ravi | Notebook | 2 | 120 | 240 | ||||||
| 7 | North | Meera | Pen set | 8 | 250 | 2000 | ||||||
| 8 | East | Meera | Backpack | 2 | 1500 | 3000 | ||||||
| 9 | North | Asha | Desk lamp | 4 | 1200 | 4800 | ||||||
| 10 | South | Kofi | Notebook | 11 | 120 | 1320 | ||||||
| 11 | West | Ravi | Water bottle | 10 | 400 | 4000 |
Formulas (green cells)
- F2 =D2*E2 → 3300
- H2 =SORT(UNIQUE(A2:A11)) → East
- J2 =FILTER(C2:C11,A2:A11="North") → Pen set
- F3 =D3*E3 → 1000
- F4 =D4*E4 → 900
- F5 =D5*E5 → 1080
- F6 =D6*E6 → 240
- F7 =D7*E7 → 2000
- F8 =D8*E8 → 3000
- F9 =D9*E9 → 4800
- F10 =D10*E10 → 1320
- F11 =D11*E11 → 4000
| Formula | Returns |
|---|---|
=UNIQUE(A2:A11) | Each different value once |
=SORT(range) | The range sorted (add ,2,-1 to sort by column 2, largest first) |
=FILTER(range, condition) | Only the rows where the condition is TRUE |
=FILTER(range, (A2:A11="North")*(D2:D11>=5)) | Rows matching both conditions (* means AND) |
Removing duplicates
Select the data and choose Data → Remove Duplicates, then tick the columns that define a duplicate (for example, Email). Excel deletes the extra rows and tells you how many it removed. Work on a copy first if you are unsure, or use UNIQUE to see the result without deleting anything.
Drop-down lists with Data Validation
- Select the cells where people will type, such as the Region column.
- Choose Data → Data Validation.
- Under Allow, pick List. In Source, type
North,South,East,Westor select a range that holds the list. - On the Error Alert tab, write a helpful message, such as *Choose a region from the list*.
Now each cell shows a small arrow with the choices, and anything else is rejected. Other rules allow only whole numbers in a range (such as units from 1 to 100) or only dates.
Practice
Guided exercise
List each salesperson once
Next to the ten orders, list every salesperson once, in alphabetical order, with one formula.
- In H1 type the heading
Salespeople. - In H2 type
=SORT(UNIQUE(B2:B11)).
Show the solution
Worksheet: Sales
| Row | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| 1 | Region | Salesperson | Product | Units | Price | Total | Salespeople | |
| 2 | West | Asha | Sketchbook | 11 | 300 | 3300 | Asha | |
| 3 | North | Meera | Pen set | 4 | 250 | 1000 | Kofi | |
| 4 | West | Ravi | Sketchbook | 3 | 300 | 900 | Meera | |
| 5 | North | Sara | Notebook | 9 | 120 | 1080 | Ravi | |
| 6 | East | Ravi | Notebook | 2 | 120 | 240 | Sara | |
| 7 | North | Meera | Pen set | 8 | 250 | 2000 | ||
| 8 | East | Meera | Backpack | 2 | 1500 | 3000 | ||
| 9 | North | Asha | Desk lamp | 4 | 1200 | 4800 | ||
| 10 | South | Kofi | Notebook | 11 | 120 | 1320 | ||
| 11 | West | Ravi | Water bottle | 10 | 400 | 4000 |
Formulas (green cells)
- F2 =D2*E2 → 3300
- H2 =SORT(UNIQUE(B2:B11)) → Asha
- F3 =D3*E3 → 1000
- F4 =D4*E4 → 900
- F5 =D5*E5 → 1080
- F6 =D6*E6 → 240
- F7 =D7*E7 → 2000
- F8 =D8*E8 → 3000
- F9 =D9*E9 → 4800
- F10 =D10*E10 → 1320
- F11 =D11*E11 → 4000
How to get there: UNIQUE removes repeats and SORT orders the result. One formula spills into as many rows as needed, and it updates if a new salesperson appears in the data.
Your turn
Big orders only
List every order total of 2,000 or more, largest first, with one formula. Hint: FILTER the Total column, then SORT the result largest first.
Show the solution
Worksheet: Sales
| Row | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| 1 | Region | Salesperson | Product | Units | Price | Total | Big totals | |
| 2 | West | Asha | Sketchbook | 11 | 300 | 3300 | 4800 | |
| 3 | North | Meera | Pen set | 4 | 250 | 1000 | 4000 | |
| 4 | West | Ravi | Sketchbook | 3 | 300 | 900 | 3300 | |
| 5 | North | Sara | Notebook | 9 | 120 | 1080 | 3000 | |
| 6 | East | Ravi | Notebook | 2 | 120 | 240 | 2000 | |
| 7 | North | Meera | Pen set | 8 | 250 | 2000 | ||
| 8 | East | Meera | Backpack | 2 | 1500 | 3000 | ||
| 9 | North | Asha | Desk lamp | 4 | 1200 | 4800 | ||
| 10 | South | Kofi | Notebook | 11 | 120 | 1320 | ||
| 11 | West | Ravi | Water bottle | 10 | 400 | 4000 |
Formulas (green cells)
- F2 =D2*E2 → 3300
- H2 =SORT(FILTER(F2:F11,F2:F11>=2000),1,-1) → 4800
- F3 =D3*E3 → 1000
- F4 =D4*E4 → 900
- F5 =D5*E5 → 1080
- F6 =D6*E6 → 240
- F7 =D7*E7 → 2000
- F8 =D8*E8 → 3000
- F9 =D9*E9 → 4800
- F10 =D10*E10 → 1320
- F11 =D11*E11 → 4000
How to get there: FILTER keeps the totals of at least 2,000; SORT(…, 1, -1) sorts them largest first. Five orders qualify. To show whole rows instead, filter the whole table: =SORT(FILTER(A2:F11,F2:F11>=2000),6,-1) sorts by the 6th column.
Common mistakes
Sorting a single selected column
You see: Values move away from their rows and the data is scrambled
Fix: Click one cell and sort from the heading arrow, or press Ctrl+Z immediately.
Forgetting a filter is on
You see: Totals and copies seem to be missing rows
Fix: Look for blue row numbers and filter icons; choose Clear Filter.
Blocking a spill
You see: #SPILL!
Fix: Clear the cells where the list needs to spill.
Blank rows in the middle of the data
You see: Sorting and tables stop at the gap
Fix: Delete empty rows so the data is one solid block.
Recap
- Format as Table adds filters, banding, automatic growth and structured references.
- Sort from the heading arrows so whole rows move; filter hides rows without deleting them.
- FILTER, SORT and UNIQUE return lists that spill and update automatically.
- Data Validation lists stop typing mistakes before they happen.
Key terms
- Table
- A range formatted with Format as Table, with a name, filters and automatic growth.
- Spill
- When one formula returns several values that fill the cells below and beside it.
- Data Validation
- Rules that limit what can be typed into cells, such as a drop-down list.
Check your understanding
Answer all 4 questions, then check your answers to see an explanation for each one.
1. What happens to rows hidden by a filter?
2. What does =UNIQUE(A2:A100) return?
3. You see #SPILL! in a cell. What is the usual fix?
4. How do you stop people typing region names wrongly?
Mark this lesson complete
Finished this lesson?
When you have worked through the examples and exercises, mark it complete to save your progress.