Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Google Sheets Sort by Time: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To sort by time in Google Sheets, select your data range, go to the Data menu, and choose Sort range > Advanced range sorting options to select the specific column containing your time values. The key to success is ensuring your cells are formatted as "Time" rather than plain text, as Google Sheets cannot chronologically order strings of text that look like times but aren't recognized as numerical values.

Sorting by time is essential for organizing schedules, logs, time-tracking sheets, and appointment calendars. When data is entered correctly, Google Sheets treats time as a fraction of a 24-hour day, allowing it to mathematically determine which time comes before another. If you simply type "9:00 AM" without the proper formatting, the software might treat it as a word, leading to a sort order where "10:00 AM" comes before "2:00 PM" simply because the number 1 comes before 2 alphabetically. This guide ensures your data is structured for a perfect chronological sort every time.

What You'll Need

  • A Google account with access to Google Sheets.
  • A dataset containing a column of time values (e.g., 08:30, 14:45, 11:00 PM).
  • A desktop browser (Chrome, Firefox, Safari, or Edge) for full access to the sorting menus.

Step-by-Step

  1. Prepare Your Data: Before sorting, ensure your data is in a clean table format. Each column should have a clear header (e.g., "Appointment Time", "Client Name", "Duration"). Ensure there are no completely empty rows or columns within the dataset, as these can break the range selection during the sort process.
  2. Apply Time Formatting: Highlight the column that contains your time entries. Go to the Format menu > Number > Time. This step is critical because it tells Google Sheets to treat the entries as temporal data. If you see the times align to the right side of the cell, they are recognized as numbers/times; if they align to the left, they are likely being treated as text.
  3. Select the Entire Data Range: Click and drag your mouse to highlight all the cells you want to sort, including the headers and all associated columns. If you only highlight the time column and sort it, the times will move but the corresponding names or data in the other columns will stay put, effectively scrambling your data. To select everything quickly, click the top-left cell of your data and press Ctrl+A (Windows) or Cmd+A (Mac).
  4. Open Advanced Sorting: With the range selected, click on the Data menu in the top toolbar. Hover over Sort range and then select Advanced range sorting options. Avoid using the simple "Sort sheet by column" option if you have a header row, as that will sort your header into the middle of your data.
  5. Configure the Sort Settings: In the pop-up window that appears, check the box labeled "Data has header row." This ensures your titles (like "Time") stay at the top. In the "Sort by" dropdown menu, select the name of the column that contains your times.
  6. Choose the Order: Select "A → Z" for ascending order (earliest time to latest time) or "Z → A" for descending order (latest time to earliest time).
  7. Execute the Sort: Click the Sort button. Your data will now be reorganized chronologically based on the time values.

Common Mistakes

The most frequent error users encounter is mixing time formats within a single column. For example, if some cells use a 24-hour clock (14:00) and others use a 12-hour clock with AM/PM (2:00 PM), Google Sheets may struggle to interpret them consistently if the cell formatting isn't unified. Always apply a single format to the entire column before sorting.

Another common mistake is sorting only the time column. Users often click the letter at the top of the column (e.g., Column B) and select sort. This only moves the values in that specific column, disconnecting the time from the person or event it belongs to. Always use the "Sort range" feature or select the entire table to keep your rows intact.

Hidden spaces are also a silent killer of sort accuracy. If a cell contains " 9:00 AM" (with a leading space), Google Sheets may treat that specific cell as text rather than a time value. This results in that row appearing at the very bottom or top of the list regardless of the actual time.

Tips

Use Data Validation: To prevent future sorting errors, use Data Validation to force users to enter times in a specific format. Go to Data > Data validation > Add rule. Set the criteria to "Is valid time." This prevents text entries from entering your time column, ensuring your sorts always work perfectly.

Creating a Helper Column: If you are sorting times that span across multiple days but your time column only shows the hour, you will find that 1:00 AM on Tuesday sorts before 11:00 PM on Monday. To fix this, create a "Timestamp" column that includes both the date and the time (e.g., 2026-12-04 14:00). Sort by this helper column instead to get a true chronological sequence.

Using the SORT Function: If you want a dynamic list that sorts itself automatically as you add new data, use a formula instead of the menu. For example, =SORT(A2:C10, 2, TRUE) will sort the range A2:C10 by the second column (the time column) in ascending order. This is ideal for dashboards where the source data is updated frequently.

Troubleshooting

If the times are sorting alphabetically (e.g., 10:00 comes before 2:00): This means Google Sheets thinks your times are text. First, select the column and go to Format > Number > Time. If they still don't move, you may have non-numeric characters in the cells. Try using the Find and Replace tool (Ctrl+H) to remove any accidental spaces or unusual symbols. If all else fails, re-type a few cells to see if the manual entry triggers the correct formatting.

If the header row is being sorted into the data: You likely forgot to check the "Data has header row" box in the Advanced range sorting options. To fix this, press Ctrl+Z to undo the sort, then repeat the sorting process, making sure that the header checkbox is ticked.

If the sort doesn't seem to happen at all: Check if your sheet is protected. If the owner of the sheet has locked certain ranges or the entire sheet, the sort function will be greyed out or will simply fail to execute. You will need to request edit permissions for those specific ranges.

If the times are sorting in a way that seems random: Check for "ghost" data. Sometimes cells that look empty actually contain a space or a hidden character. This can confuse the sorting algorithm. Highlight the area below your data and delete the rows entirely to ensure the range is clean.

Frequently Asked Questions

Can I sort by time on the Google Sheets mobile app?

Yes, but the options are more limited. You can tap the column letter to select it and look for the sort options in the three-dot menu. However, for complex ranges with headers, using the desktop browser is highly recommended to avoid scrambling your data.

Does Google Sheets support sorting by duration (e.g., 5 hours, 10 minutes)?

Yes. You must format the column as Format > Number > Duration. Once formatted as duration, Google Sheets will sort by the total length of time rather than the time of day.

How do I sort times from latest to earliest?

In the Advanced range sorting options menu, select "Z → A" instead of "A → Z." This will put the most recent or latest time at the top of your list.

Why does my time sort incorrectly when I have dates in the same cell?

If a cell contains both a date and a time, Google Sheets sorts by the date first and then the time. If you only want to sort by the time regardless of the date, you must extract the time into its own column using the =TIMEVALUE() function before sorting.

Can I sort by multiple columns, such as Date then Time?

Yes. In the Advanced range sorting options, after selecting your first column (Date), click "Add another sort column" and select the Time column. This creates a primary and secondary sort order.