Lesson 6 of 8 · see all lessons
Formulas from zero
Answer questions with conditions and lookups
Organize and summarize the month
10 min
How to sort, filter and make a table in Excel
Sort rows without scrambling them, filter to the rows you need, and turn your data into an Excel table with Ctrl+T so formulas grow with it.
By the end of this lesson you can
- Sort by one or two columns and keep every row together
- Filter by two columns and read what SUM does with hidden rows
- Turn a range into a named table and use a structured reference
- Use a total row that follows your filter
From earlier lessons · 1 of 2
What does XLOOKUP return when it finds no match and has no if_not_found?
Pick one answer.
From earlier lessons · 2 of 2
In =XLOOKUP(C2,$S$2:$S$9,$T$2:$T$9), which part returns the cost?
Pick one answer.
Thirty rows fit on one screen, but the manager still asks: what was our biggest line? Show me just Ben's food. Scrolling and squinting isn't an answer. Sorting and filtering are.
Take a guess
You sort the sheet by Total, largest to smallest. Which order line lands in row 2?
No pressure. Guess now, and the lesson will show you if you were right.
Sort without scrambling rows
Click one cell in the Total column, such as H5. Don't select the whole column. On the Data tab, choose Sort Largest to Smallest. Excel finds the edges of your data and moves whole rows. The empty column O is the edge, so your report panel stays where it is.
If you do select just one column, Excel warns you. Choose Expand the selection. Continue with the current selection sorts that column alone, and each Total ends up beside the wrong item.
Click H5 > Data > Sort Largest to Smallest
Predict, then reveal
Before sorting, =XLOOKUP("Latte",C2:C31,A2:A31) returned 2026-03-02. What does it return after this sort?
To sort by two columns, open Data > Sort, sort by Category (A to Z), then choose Add Level and sort by Total (Largest to Smallest). Rows group by category, biggest first inside each group. Before you go on, press Ctrl+Z once for each sort you did, until row 2 is the 2 March latte again. Later lessons point at rows by number, such as E2.
You sort by Category A to Z, then by Total largest to smallest. What is in row 2?
Pick one answer.
Filter: show only the rows you need
The manager asks: show me Ben's food sales. Click any cell in the data and choose Data > Filter. Arrows appear in the header row. Open Category, untick (Select All), tick Food, and choose OK. Then do the same in Staff for Ben. Filters are additive: each one narrows what the last one left.
Category = Food, then Staff = Ben
With that filter on, what does =SUM(H2:H31) in Q6 show?
Pick one answer.
Make it a table with Ctrl+T
Turn the filters off: click any cell in the data and choose Data > Filter again. Click any cell in the data and press Ctrl+T (Cmd+T on a Mac). Tick My table has headers and choose OK. The range A1:N31 becomes an Excel table. On the Table Design tab (the Table tab on a Mac), click in the Table Name box, type Sales and press Enter.
Now you can write structured references: Sales[Total] means every data cell in the Total column. It grows when the table grows.
=SUM(Sales[Total])
Tick Total Row on the Table Design tab. In the new bottom row, open the drop-down under Total and pick Sum. Excel writes a SUBTOTAL formula there, and SUBTOTAL skips rows a filter hides.
In the table, you filter Category to Food. What does the total row under Total show?
Pick one answer.
Match
Match each job to where you do it in Excel.
Pick an item on the left, then its match on the right.
In Google Sheets: sort with Data > Sort range, and filter with Data > Create a filter. A filter there is visible to everyone who can open the file. Sheets has tables too: Format > Convert to table.
FlashcardsIndex cardsFlashcards ⚡
Card 1 of 15Worth keeping
- Click one cell before sorting so whole rows move; if Excel warns, expand the selection.
- Filters hide rows; SUM still adds them, but a table's total row doesn't.
- Ctrl+T makes a named table, and Sales[Total] grows with new rows.
- Sorting changes which match is first, never the totals.
Filters answer one question at a time: Ben's food, then Chloe's coffee, then the next. The manager wants every staff member against every category, all at once. Writing nine SUMIFS would work. A pivot table builds the whole grid in about five clicks.
Embed this practice on your site
Free for classrooms, blogs and study groups. Paste this into any page that accepts HTML.
Report a copyright problem with this lesson
Sources for this lesson (12)
Each fact in the lesson is marked with the number of the page it comes from.
- [3]Microsoft Support: Keyboard shortcuts in Excel
- [4]Microsoft Support: SUM function
- [6]Microsoft Support: XLOOKUP function
- [19]Google Docs Editors Help: Sort & filter your data
- [20]Google Docs Editors Help: Use tables in Google Sheets
- [21]Microsoft Support: Filter data in a range or table
- [22]Microsoft Support: Sort data in a range or table
- [23]Microsoft Support: Using structured references with Excel tables
- [24]Microsoft Support: Overview of Excel tables
- [31]Microsoft Support: Rename an Excel table
- [32]Microsoft Support: Resize a table by adding or removing rows and columns in Excel
- [33]Microsoft Support: Total the data in an Excel table