Filters & Sorting
Not a function, two tools. Filter hides rows that don't match a condition; Sort reorders every row by a column. Neither one calculates anything.
Filter and Sort are easy to lump together since they both live under the Data tab and both reorganize how a table looks, but they do genuinely different things underneath. A filter never deletes, moves, or overwrites anything: it only changes which rows are currently visible, and turning the filter off brings every hidden row straight back exactly as it was. Sort is different; it actually reorders the rows on the sheet, though nothing about any individual row is added, removed, or changed, just rearranged.
Text fields get Equals, Does not equal, and Contains for filtering, and always sort alphabetically; numeric fields add Greater than, Less than, and their "or equal to" variants, and sort numerically. When a sort has ties, two rows sharing the same value in the sorted column, both Excel and LearnExcel use a stable sort, so tied rows keep their original relative order rather than being shuffled.
Syntax
| Argument | Description |
|---|---|
| Field | Required for Filter. The column the filter rule watches. |
| Operator | Required for Filter. Equals, Does not equal, Contains for text; those plus Greater/Less than (or equal to) for numbers. |
| Value | Required for Filter. What the operator compares each row's value in that field against. |
| Column, Direction | Required for Sort. Which column to sort by, and Ascending (A→Z / smallest→largest) or Descending (Z→A / largest→smallest). |
A real example: isolating one region without touching the data
A quick way to focus on one region's rows without deleting or moving anything else on the sheet:
Every other region's row is simply hidden, not removed; clearing the filter afterward brings the full table straight back with nothing changed underneath.
Worked examples
| A | B | |
|---|---|---|
| 1 | Region | Sales |
| 2 | West | 320 |
| 3 | East | 210 |
| A | B | |
|---|---|---|
| 1 | Product | Revenue |
| 2 | Widget | 150 |
| 3 | Gadget | 320 |
| A | B | |
|---|---|---|
| 1 | Product | Revenue |
| 2 | Widget | 150 |
| 3 | Gadget | 320 |
Common mistakes
- Reaching for Equals when the real condition is a range. Greater than / Less than (or Between, back in the Conditional Formatting toolkit) is the right one for a threshold.
- Forgetting Contains is a substring search, not an exact match. It's the right choice when only part of a name is known, or a whole product line shares one word.
- Filtering (or sorting by) the wrong column when a plausible-looking but irrelevant one sits right next to the real one. Read the requirement, not just the nearest number.
- Confusing Sort with the SORT() array formula from Array Formulas. Sort physically reorders the sheet's own rows; SORT() leaves the source alone and returns a separate sorted list elsewhere.
Related functions
- Conditional Formatting
- ISBLANK / ISNUMBER / ISTEXT / ISERROR / COUNTBLANK
- RANK / LARGE / SMALL / MEDIAN / MODE
Try it yourself
A free, graded practice exercise using this exact function: instant feedback, no signup required.
Practice filtering and sorting →