ThisCalculator

Everyday

Sort Numbers and Dates in Google Sheets

Updated · Standard formula, shown below

Sort Numbers and Dates in Google Sheets

To sort numbers and dates in Google Sheets, select the data and use the sort commands in the Data menu, choosing ascending or descending order. For a table with several columns, sort the entire range—not just one column—so each row’s values stay together.

How sorting works

Sorting rearranges rows according to values in a chosen column. Ascending order places smaller numbers before larger ones and earlier dates before later dates; descending order reverses that sequence. Text is generally ordered alphabetically, while blank cells and mixed data types can affect where values appear.

A spreadsheet’s displayed format is not always the value Sheets sorts. A cell may show a date such as “Nov 5, 2026,” but its underlying value is a date serial number. Similarly, a number displayed with a currency symbol is still numeric. When values are stored as text, however, Sheets may sort them alphabetically rather than numerically or chronologically.

Sort a complete table

  1. Make sure the table has a header row and that each row represents one complete record.
  2. Select the whole table, including all columns you want to keep together. If the table is contiguous, clicking a cell inside it may be enough when you use the range-based sort command, but selecting the range explicitly helps avoid mistakes.
  3. Open Data and choose Sort range, then open the advanced range-sorting options if needed.
  4. If the selected range includes headers, check Data has header row. Choose the column to sort by, then select A → Z for ascending order or Z → A for descending order.
  5. For a secondary sort, add another sort column. For example, sort a sales table first by region and then by date to group records by region and order dates within each group.

Menu labels can vary slightly across interfaces, but the key distinction is between sorting a selected range and sorting an entire sheet. A range sort affects the chosen table; a sheet sort can affect the sheet’s rows more broadly. Check what is selected before confirming.

Sort numbers correctly

For genuine numeric values, ascending order runs from the smallest to the largest: 2, 10, 100. If the result instead puts 10 before 2, those entries may be text. This often happens after importing data, entering an apostrophe before a number, or using inconsistent decimal or thousands separators.

  • Check alignment and formatting: formatting alone does not convert text to a number. A cell formatted as “Number” can still contain text.
  • Look for extra characters: spaces, currency symbols typed into the value, or other characters may stop an entry from being recognized as numeric.
  • Convert only when appropriate: use a number-conversion formula or clean the imported column, then copy and paste values if you need to replace the original data. Verify the converted values before sorting.

Do not convert identifiers such as postal codes, product codes, or account numbers just because they contain digits. They may be labels, not quantities; leading zeros can be meaningful, and numeric conversion could remove them.

Sort dates chronologically

When dates are real date values, ascending order places the earliest date first and descending order places the latest date first. The displayed format—such as 11/5/2026 or 5 Nov 2026—does not determine chronological order if the underlying value is recognized as a date.

Imported dates can be ambiguous. For example, 03/04/2026 can mean March 4 or April 3 depending on the date convention used when the data was entered or imported. Check the spreadsheet’s locale and verify a few entries before sorting. Changing how a date is displayed does not necessarily fix a date that was imported as text.

If dates sort unexpectedly, test a suspicious cell with a date-related formula or compare its behavior with a known valid date. Correct the source values or convert the text consistently before sorting; avoid manually rearranging rows, which can introduce errors.

Sort one column without separating rows

A frequent mistake is selecting a single column in a multi-column table and sorting it by itself. That changes the order of those cells without moving their neighboring values, so names, dates, and amounts can become associated with the wrong record.

To keep records intact, select the full table and specify the sort column. If Sheets asks whether to expand the selection, choose the option that includes the adjacent data when those columns belong to the same records. If the column is genuinely independent, sorting it alone is appropriate.

For a quick sort of a whole sheet by a column, use the column’s header menu and choose a sort direction, while confirming that the sheet’s rows should move together. If the first row contains headers, make sure it is treated as a header rather than sorted into the data.

Multiple sort keys and filters

Sorting by more than one column is useful when values repeat. For example, sorting by department and then by employee name groups employees by department and alphabetizes names within each group. The first sort key has priority; later keys resolve ties.

Filters provide another way to sort while working with a table. Turn on a filter for the range, then use the filter control in a column header to sort ascending or descending. A filter can also hide rows that do not meet criteria; hiding rows is not the same as deleting them. Review the selected range and existing filters if some records seem to be missing.

Common problems and safe checks

  • Header moves into the data: mark the header row in the sort options or select only the data rows below it.
  • Rows no longer match: undo immediately if possible, then sort the complete table rather than one column.
  • Numbers or dates appear out of order: check whether values are stored as text, whether separators are consistent, and whether the dates are ambiguous.
  • Only some rows change: check the selected range, blank rows that may split the table, and active filters.
  • Sort order changes after editing: a manual sort is not necessarily an automatically maintained ranking. Reapply the sort when new entries are added, or use a formula-based sorted view when a continuously updated result is needed.

Before sorting important data, make a copy or confirm that undo is available. Sorting changes row order, not the underlying records, but an incorrect range selection can make a sheet difficult to interpret and may require restoring the original order.

Frequently Asked Questions

How do I sort numbers from smallest to largest in Google Sheets?
Select the full data range, open Data → Sort range, choose the numeric column, and select ascending order. If the sequence looks alphabetical, check whether the values are stored as text.

How do I sort dates from oldest to newest?
Sort the full range by the date column in ascending order. Confirm that the cells contain actual date values and that imported dates use the intended locale and date convention.

Can I sort by two columns?
Yes. In the range-sorting options, add a second sort column. The first column groups or orders the main results; the second sorts records that share a value in the first column.

Why does sorting one column scramble my spreadsheet?
The column was probably sorted without its related rows. Undo the change, select the complete table, and sort by the desired column so each record stays intact.

Does sorting change the values in my cells?
Sorting normally changes their row order, not their contents. It can still cause confusion if only part of a table is selected, so check the range and headers before applying a sort.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.