How to Sort Data in Excel – Custom Order, Filters & Pro Tips

Sorting in Excel goes beyond simple A-Z or 1-100. This guide walks you through the easiest to most advanced sorting methods like custom order sorting, multi-level filters, and formula-based dynamic sorting so you can take control of your data with precision.

Sort Data in Excel

Sorting is one of the most essential operations in Excel, and it transforms raw data into actionable insights. Whether you’re organizing sales data, managing employee records, or preparing datasets for analysis, Excel’s sorting functionality allows you to streamline your workflow and improve data clarity.

This tutorial offers expert-level tips and techniques to help you sort data in Excel more effectively beyond just clicking the “Sort A to Z” button.

Why Sorting Data Matters in Excel

Sorting helps you:

  • Quickly identify top-performing metrics (e.g., highest sales, top grades)
  • Spot outliers or duplicates
  • Prepare structured datasets for further analysis (e.g., pivot tables, charts)
  • Facilitate reporting and auditing processes

Proper sorting improves not only data readability but also the accuracy of downstream operations.

1. Basic Sorting in Excel

Employee Performance Dataset
Employee IDNameDepartmentSalary
E001Anjali MehtaSales65000
E002Ravi KumarMarketing72000
E003Sneha RaoHR58000

A. Single-Column Sort (Alphabetical or Numerical)

Steps:

  1. Select a single column (e.g., “Employee Name”).
  1. Go to the Home tab → Click Sort & Filter.
  1. Choose Sort A to Z (ascending) or Sort Z to A (descending).

This method works well for unsorted lists where each row is independent.

B. Multi-Column Sort

For datasets with multiple dimensions (e.g., Department and Salary), use custom sorting:

  1. Select any cell in your data.
  1. Go to the Data tab → Click Sort.
  1. In the dialog box, add sorting levels:
    • First by Department (A to Z)
    • Then by Salary (Largest to Smallest)
  1. Click OK.
  2. Output:

Pro Tip: Excel sorts from top-level to sub-levels. Order your sorting levels carefully for accurate grouping.

2. Custom Sort Order (Advanced)

Default sorting in Excel is alphabetical or numerical, but you can define custom orders (e.g., “High”, “Medium”, “Low”).

How to Set Custom Order:

  1. Select your data range.
  2. Go to DataSort → Under “Order”, select Custom List.
  3. Define a new list: Type “High, Medium, Low” and click Add.
  4. Apply it to your sorting level.

This is especially useful for sorting priority levels, status labels, or categorical rankings.

3. Sorting by Cell Color, Font Color, or Icon

Conditional formatting makes your data visually intuitive. Excel lets you sort by:

  • Cell Color
  • Font Color
  • Icon Set

Steps:

  1. Select your range.
  2. Go to DataSort.
  1. Under “Sort On,” choose:
    • Cell Color
    • Font Color
    • Cell Icon
  2. Set the order (e.g., bring red cells to the top).

This is particularly useful for dashboards and visual reporting.

4. Sorting with Formulas

If your dataset includes dynamic values from formulas, be cautious:

  • Excel sorts based on visible values, not the underlying formula.
  • Sorting can disrupt cell references if not handled properly.

Solution: Use INDEX/MATCH or SORT functions (available in Excel 365 and Excel 2019+) to create dynamic sorted lists without altering the source data.

=SORT(A2:B10, 2, -1)  // Sort by second column in descending order

5. Sorting with Filters (AutoFilter)

Filters allow you to sort interactively without modifying the entire sheet.

How to Use:

  1. Select your data → Press Ctrl + Shift + L or use DataFilter.
  2. Click the dropdown in any column header.
  3. Choose sorting options.

Use Case: Temporarily sort or filter without affecting the global data order.

6. Common Pitfalls and How to Avoid Them

MistakeConsequenceSolution
Sorting only one columnData misalignmentAlways select the full dataset or use “Expand the selection”
Header row gets sortedColumn titles get mixed with dataEnsure My data has headers is checked
Sorting affects formulasIncorrect results or broken referencesUse structured references or helper columns

Conclusion

Sorting is more than a basic tool, when used effectively, it becomes a powerful mechanism for data preparation and analysis in Excel. From simple alphabetic ordering to advanced multi-level, custom, or conditional sorts, mastering Excel’s sorting options can greatly boost productivity and data clarity.

Want to go beyond basic sorting? Learn data analysis with Excel including custom sorting, filters, and formulas with this advanced course designed for real-world applications.

Learn More

To sharpen your Excel skills further, explore these resources:

Already know the basics? Take your skills further with this advanced Excel course and master techniques like multi-level sorting, conditional filters, and data structuring from scratch to pro.

Frequently Asked Questions(FAQ’s)

1. Can I sort Excel data automatically when new data is added?

Yes. You can create dynamic ranges using Excel Tables (Ctrl + T). Once your data is in a table, sorting rules are retained, and new rows added will automatically conform to the existing sort logic. For fully automated sorting, combine tables with Power Query or use the SORT() function in Excel 365.

2. How do I preserve the original row order before sorting?

Add a “Row ID” column before sorting. You can use Excel’s ROW() function to generate sequential numbers: =ROW()-1

3. Why is my sort not working correctly with numbers stored as text?

Numbers stored as text sort alphabetically (e.g., 1000 before 200). To fix this:

  • Use Text to Columns or VALUE() to convert them to real numbers.
  • Alternatively, go to Data → Text to Columns → Finish without changes to auto-correct numeric formatting.

4. How can I sort horizontally (i.e., sort columns instead of rows)?

Go to Data → Sort → Options → Sort Left to Right. Then, choose the row to base the sort on. This is useful in transposed datasets or matrix formats (e.g., months in columns, metrics in rows).

5. Can I lock certain rows or columns while sorting the rest?

Not directly. Excel sorts all selected data. To “lock” specific rows (like totals or headers), you must exclude them from the sort range or move them to a different section, sort the main dataset, and then move them back.

→ Explore this Curated Program for You ←

Avatar photo
Great Learning Editorial Team
The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.

Recommended Data Science Courses

Data Science and Machine Learning from MIT

Earn an MIT IDSS certificate in Data Science and Machine Learning. Learn from MIT faculty, with hands-on training, mentorship, and industry projects.

4.63 ★ (8,169 Ratings)

Course Duration : 12 Weeks

PG in Data Science & Business Analytics from UT Austin

Advance your career with our 12-month Data Science and Business Analytics program from UT Austin. Industry-relevant curriculum with hands-on projects.

4.82 ★ (10,876 Ratings)

Course Duration : 12 Months

Academy Pro Subscription

Grab 50% off
unlimited access to top courses!

Subscribe for ₹1599/month
₹799/month*

Start 7-day Free Trial

No credit card required

×
Scroll to Top