Microsoft Excel Mastery
Part III: Data Management
Sorting, Filtering, Data Validation, Data Cleaning, Tables & Named Ranges ā with real Indian business examples from TCS, Flipkart, Reliance & Zomato.
š 5 Chapters | 77+ Solved Examples | 40+ Exercises | 25 MCQs | 15 Interview Questions | 5 Mini Projects
Sorting and Filtering
šÆ Learning Objectives
- Sort data in ascending (AāZ) and descending (ZāA) order
- Perform multi-level sorting (e.g., by Department then by Salary)
- Sort by cell color, font color, and conditional formatting icons
- Apply AutoFilter to filter data by value, text, number, and date conditions
- Use Advanced Filter for criteria ranges, unique records, and copying results to another location
- Master dynamic array functions:
SORT(),SORTBY(), andFILTER()
š¢ The Flipkart Problem: 150 Million Products
Flipkart's product catalog contains over 150 million listings. When a customer searches for "mobile phone," the system must sort results by relevance, price, rating, and delivery speed ā all in under 200 milliseconds. In your Excel world, sorting and filtering are the foundational skills that mirror exactly what billion-dollar companies do with their databases every second.
| Emp ID | Name | Department | City | Salary (ā¹) | Join Date | Rating |
|---|---|---|---|---|---|---|
| E001 | Amit Sharma | IT | Mumbai | 85000 | 15-Jan-2020 | 4.5 |
| E002 | Priya Patel | HR | Delhi | 62000 | 03-Mar-2019 | 4.2 |
| E003 | Rahul Verma | IT | Bangalore | 92000 | 22-Jul-2021 | 4.8 |
| E004 | Sneha Gupta | Finance | Mumbai | 78000 | 10-Nov-2018 | 4.0 |
| E005 | Vikram Singh | IT | Hyderabad | 95000 | 05-Feb-2022 | 4.7 |
| E006 | Anjali Desai | HR | Pune | 58000 | 18-Aug-2020 | 3.9 |
| E007 | Karan Mehta | Finance | Delhi | 72000 | 30-Apr-2019 | 4.3 |
| E008 | Divya Nair | Marketing | Chennai | 68000 | 12-Jun-2021 | 4.1 |
| E009 | Rohan Joshi | IT | Pune | 88000 | 25-Sep-2020 | 4.6 |
| E010 | Meera Iyer | Marketing | Bangalore | 71000 | 08-Dec-2019 | 4.4 |
Sort Basics & Multi-Level Sorting
Simple Sort: AāZ and ZāA
Sorting arranges your data in a specific order. Ascending (AāZ) arranges text alphabetically, numbers from smallest to largest, and dates from earliest to latest. Descending (ZāA) does the reverse. Think of it like organizing your school register ā names A to Z make it easy to look up any student.
Step-by-Step: Quick Sort
- Click any cell in the column you want to sort (e.g., click on cell E2 in the Salary column)
- Go to Data tab ā Sort & Filter group
- Click Sort A to Z (ā) for ascending or Sort Z to A (ā) for descending
- Excel automatically detects the data range and sorts the entire table by that column
Example 1: Sort employees by Salary (ascending)
Click any cell in the Salary column ā Data ā Sort A to Z. Result:
| Emp ID | Name | Department | Salary (ā¹) |
|---|---|---|---|
| E006 | Anjali Desai | HR | 58,000 |
| E002 | Priya Patel | HR | 62,000 |
| E008 | Divya Nair | Marketing | 68,000 |
| E010 | Meera Iyer | Marketing | 71,000 |
| E007 | Karan Mehta | Finance | 72,000 |
| E004 | Sneha Gupta | Finance | 78,000 |
| E001 | Amit Sharma | IT | 85,000 |
| E009 | Rohan Joshi | IT | 88,000 |
| E003 | Rahul Verma | IT | 92,000 |
| E005 | Vikram Singh | IT | 95,000 |
Custom Sort & Multi-Level Sort
What if you want to sort by Department first, and then within each department, sort by Salary from highest to lowest? That's multi-level sorting ā exactly how HR managers organize payroll reports at companies like TCS and Infosys.
Step-by-Step: Multi-Level Sort
- Click any cell in your data range
- Go to Data tab ā click Sort (the full Sort button, not the quick A-Z buttons)
- In the Sort dialog:
- Sort by: Department ā Order: A to Z
- Click Add Level
- Then by: Salary ā Order: Largest to Smallest
- Click OK
Example 2: Multi-level sort ā Department (AāZ), then Salary (High to Low)
| Name | Department | Salary (ā¹) |
|---|---|---|
| Sneha Gupta | Finance | 78,000 |
| Karan Mehta | Finance | 72,000 |
| Priya Patel | HR | 62,000 |
| Anjali Desai | HR | 58,000 |
| Vikram Singh | IT | 95,000 |
| Rahul Verma | IT | 92,000 |
| Rohan Joshi | IT | 88,000 |
| Amit Sharma | IT | 85,000 |
| Meera Iyer | Marketing | 71,000 |
| Divya Nair | Marketing | 68,000 |
Custom Sort Order
Sometimes alphabetical order isn't what you want. For example, you might want months to sort as Jan, Feb, Mar... not Apr, Aug, Dec. Or departments in a specific business hierarchy: "Management ā IT ā Finance ā HR ā Marketing."
Step-by-Step: Custom Sort List
- Data ā Sort ā In the Order dropdown, select Custom List...
- Type your custom order in the List entries box (one item per line): Management, IT, Finance, HR, Marketing
- Click Add, then OK
Example 3: Sort by custom department order
Custom order: IT, Finance, HR, Marketing. Result: All IT employees appear first, then Finance, then HR, then Marketing ā regardless of alphabetical order.
Sort by Cell Color / Font Color / Icon
If you've used conditional formatting to highlight cells (e.g., red for low performers, green for high performers), you can sort by those colors.
- Data ā Sort ā In Sort On, choose Cell Color, Font Color, or Conditional Formatting Icon
- Select the color/icon you want on top
- Add more levels for each color
Example 4: Sort by cell color
Suppose cells with Salary > ā¹80,000 are highlighted green and Salary < ā¹65,000 are red. Sort by Cell Color ā Green on Top ā Red on Bottom.
- Alt + D + S ā Open Sort dialog (legacy shortcut)
- Alt + A + S + S ā Sort Ascending (AāZ)
- Alt + A + S + O ā Sort Descending (ZāA)
- Alt + A + S + U ā Custom Sort dialog
Example 5: Real-Life ā CBSE Board Results Sorting
A CBSE school coordinator receives mark sheets for 500 students. She needs to sort by: Stream (Science, Commerce, Arts) first, then by Total Marks (highest first) within each stream, then by Name (AāZ) for students with the same marks.
| Roll No | Name | Stream | Total Marks | Rank |
|---|---|---|---|---|
| 101 | Arjun Reddy | Science | 487 | 1 |
| 115 | Kavya Menon | Science | 478 | 2 |
| 203 | Neha Agarwal | Commerce | 472 | 1 |
| 207 | Suresh Kumar | Commerce | 465 | 2 |
| 301 | Fatima Khan | Arts | 458 | 1 |
Sort levels: 1) Stream ā Custom List (Science, Commerce, Arts) 2) Total Marks ā Largest to Smallest 3) Name ā A to Z
Example 6: Real-Life ā Zomato Restaurant Ratings Sort
A Zomato city manager exports restaurant data for Pune. He needs restaurants sorted by Cuisine (AāZ), then Rating (highest first), then Average Cost for Two (lowest first) to recommend affordable highly-rated options.