How to Sort Data in Excel by Value

Cody Schneider8 min read

Sorting data by value is one of the most fundamental skills in Excel, allowing you to quickly organize numbers and make sense of your information. Whether you're trying to find your top-performing products, identify the lowest test scores, or simply arrange financial data chronologically, knowing how to sort is essential. This guide will walk you through the various ways to sort numerical data in Excel, from the simplest single-click method to more controlled, multi-level sorting that keeps your datasets intact.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Understanding How Excel Sorts Values

Before diving into the steps, it's helpful to understand what "sorting by value" means and the terminology Excel uses. When you sort numerical data, you're usually arranging it in one of two ways:

  • Ascending Order: This arranges your data from the smallest value to the largest value. In Excel's sorting tools, this is often labeled as "Smallest to Largest." For example, sorting the numbers 10, 5, and 25 in ascending order would result in 5, 10, 25.
  • Descending Order: This arranges your data from the largest value to the smallest value. This is labeled as "Largest to Smallest." The same numbers - 10, 5, and 25 - sorted in descending order would be 25, 10, 5.

Excel is smart about different types of values. It correctly interprets and sorts various numerical formats, including integers, decimals, percentages, currency, dates, and times.

Method 1: The Quick Sort for Simple Data Lists

For a basic table or a single column of data, Excel's quick sort buttons are the fastest way to get the job done. This method is perfect when your data is in a simple, continuous block without empty rows or columns.

Let's use an example of a simple list tracking a student's test scores:

Example Data:

How to Use Quick Sort:

  1. Click any cell within the column you want to sort by. In our example, you would click on any cell in the "Score" column (e.g., cell with '95'). You do not need to select the whole column.
  2. Navigate to the Data tab on the Excel ribbon at the top of the screen.
  3. In the Sort & Filter group, you will see two prominent icons:

If we click the "Largest to Smallest" (Z-A) button while a cell in the "Score" column is selected, Excel will automatically detect the entire table and reorder the rows to get this result:

Result (Sorted Descending):

Notice that Excel kept the "Subject" values connected to their corresponding "Score." This is the key. Excel assumes that adjacent columns are part of the same data record, so it sorts the entire row, not just the single column you selected. This behavior prevents your data from getting scrambled.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Method 2: Using the Custom Sort Dialog Box for More Control

The quick sort method is great, but for larger, more complex datasets, you'll want more precision and control. The Custom Sort dialog box is the most powerful and safest way to sort in Excel, ensuring you have full control over how your data is organized without risking errors.

This method is essential when:

  • Your data set is large and has many columns.
  • You want to sort by multiple criteria (e.g., sort by region, then by total sales).
  • You want to explicitly tell Excel which column to sort by to avoid any ambiguity.

Let's use a more detailed sales report as our example:

Example Data Table:

Our goal is to sort this table to see who had the highest total revenue.

Step-by-Step Instructions for Custom Sort:

  1. Select your data range. You can either click a single cell within your data table and let Excel guess the range, or for more safety, click and drag to highlight the entire table, including the headers.
  2. Navigate to the Data tab and click the large Sort button (it has a funnel and A-Z icon). This will open the Sort dialog box.
  3. Check "My data has headers." This is arguably the most important checkbox in this window. When checked, Excel understands that the first row of your selection ("Sales Rep," "Region," etc.) is a header and should not be sorted along with the rest of your data. If unchecked, headers will be sorted into your dataset, creating a mess.
  4. Choose your sorting rules:
  5. Click OK. Your data table will now be sorted based on these rules.

Result (Sorted by Total Revenue - Largest to Smallest):

Method 3: Multi-Level Sorting by Value

What happens if you have duplicate values in the column you're sorting by? For instance, what if two salespeople had the same revenue? How would Excel order them? By default, it maintains their original relative order.

Multi-level sorting allows you to define a secondary (or even tertiary) sorting criterion to handle these ties. A common scenario is to sort by a primary numerical value, and then by a secondary text value alphabetically.

Let's add another entry to our sales table, creating a tie in the 'Region' so we can sort by Revenue within each region.

Updated Example Data:

Our goal is to group the data by Region alphabetically, and then, within each region, show the sales from highest to lowest revenue.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

How to Add Sorting Levels:

  1. Follow the steps above to open the Custom Sort dialog box.
  2. Set the first sorting level:
  3. Add a second level. In the top-left of the dialog box, click the Add Level button. A new row labeled "Then by" will appear.
  4. Set the second sorting level:
  5. Click OK.

Excel first sorts the whole table by Region (East, North, South). Then, for the "North" group and the "South" group, it applies the second rule, sorting those rows by Total Revenue.

Result (Multi-Level Sort):

Common Sorting Pitfalls and How to Avoid Them

While sorting is powerful, a simple mistake can corrupt your entire dataset. Here are the most common issues to watch out for:

Trap #1: Sorting a Single Column By Itself

If you highlight just one column in a multi-column table and click sort, Excel will pop up a "Sort Warning" dialog box. It asks if you want to "Expand the selection" or "Continue with the current selection."

Always choose "Expand the selection" unless you have a very specific reason not to. Choosing "Continue with the current selection" will sort only that one column, permanently misaligning the data from its corresponding rows. For instance, it might shuffle all the sales revenue numbers, but leave the sales rep names in their original order. This can be an irreversible, data-destroying error.

Trap #2: Headers Getting Sorted with Data

This happens when you use the Custom Sort tool and forget to check the My data has headers box. Your thoughtfully-named column headers (like 'Total Revenue') will be treated as regular text data and sorted right into the middle of your rows, breaking your table's structure.

Trap #3: Accidental Sorting of Formulas

If your sorting column contains formulas, be aware that sorting can change the cell references if you’re using relative references (e.g., =A2+B2). This can sometimes lead to incorrect calculations after a sort. Best practice is to sort tables where values are numbers, not formulas. If you must sort formula columns, double-check your calculations after the sort, or convert formulas to static values before sorting by copying and pasting as values (Paste Special > Values).

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Trap #4: Text That Looks Like Numbers

Sometimes, numbers get imported into Excel as text. When you try to sort a column containing these "text numbers" and actual numbers, all text entries (even '900') will be sorted separately from true numerical values. Excel usually treats all numbers sorted as text as zero, so they go to the top or bottom. You can spot these cells often by the small green triangle in the top-left corner. To fix, select the column, click the error icon, and choose "Convert to Number." This ensures all data is treated numerically and sorts correctly.

Final Thoughts

Sorting by value is an indispensable part of working with data in Excel. From the convenient quick sort buttons for simple tasks to the robust Custom Sort dialog for complex tables, Excel provides all the tools you need to organize your data effectively. Mastering these methods will save you time and help you uncover key insights buried in your spreadsheets.

Of course, mastering spreadsheets is just one piece of the puzzle. The real challenge is often the manual, repetitive grind of exporting data from different applications every week, combining it into a spreadsheet, and then performing these sorting and analysis steps again and again. To eliminate that drudgery, we built Graphed. It connects directly to your live data sources and allows you to build real-time dashboards using simple, natural language, turning hours of repetitive analysis into a quick, 30-second conversation.

Related Articles

How to Enable Data Analysis in Excel

Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!