The Analyst's Path

Multi-level sort in Excel

Real sorting is usually layered: region, then salesperson within each region, then date descending within that. Levels apply from the top down. The first level is the primary sort, the next breaks ties within it, and so on. Tick My data has headers so the header row isn't dragged into the sort. You can Sort On Cell Color, Font Color or Conditional Formatting Icon as well as Values, which lets you pull all the red-flagged rows to the top.

3 min readPart of Data Tools & IntegrityOpen in course mode

Advertisement

Sorting and filtering are the two data operations you'll use most after typing. Both go deeper than the one-click buttons.

How do you sort by more than one column in Excel?

Multi-level sort. The A→Z / Z→A buttons sort by a single column. Real sorting is usually layered: region, then salesperson within each region, then date descending within that. Open Data ▸ Sort (keyboard Alt, A, S, S) to get the full dialog, then click Add Level for each further key. Levels apply from the top down. The first level is the primary sort, the next breaks ties within it, and so on. There are finer points too. Tick My data has headers so the header row isn't dragged into the sort. You can Sort On Cell Color, Font Color or Conditional Formatting Icon as well as Values, which lets you pull all the red-flagged rows to the top. And Order ▸ Custom List lets you sort by a non-alphabetical sequence you define, such as High, Medium, Low or Q1, Q2, Q3, Q4, which alphabetical sorting would mangle.

Advertisement

AutoFilter vs the FILTER function: what is the difference?

Filter (AutoFilter). Data ▸ Filter (Ctrl+Shift+L) drops a dropdown arrow onto each header. From it you can tick values and apply text/number/date filters like greater than, contains, this month. You can filter by colour as well. AutoFilter hides non-matching rows in place. It's manual and doesn't recalculate on its own, so if the source data changes you have to re-apply it. For a person exploring one sheet by hand, it's perfect.

The FILTER function versus AutoFilter. M365's FILTER(array, include, [if_empty]) is a different animal. It returns a new, live array of the matching rows, spilling into a fresh range and recalculating automatically whenever the source changes. =FILTER(A2:D100, C2:C100="West", "none") produces a self-updating extract of all West-region rows and leaves the original alone. To choose between them, ask who consumes the result:

  • AutoFilter when a person is eyeballing one table and will change the filter as they think. It works in place and it's temporary. It needs no spare space either.
  • FILTER when a formula or a report needs the matching rows as live input, like a dashboard block that must always show today's breaches or a spilled list feeding a chart. It leaves the source untouched and updates itself.

So they aren't really rivals. AutoFilter answers "let me look", and FILTER answers "keep this extract current forever".

Advertisement

Part of the course

This page is part of Data Tools & Integrity (EX2.01), in Phase 2: Financial statement analysis and quality of earnings. The module's flashcards and its quiz are in the app.