How to Sort by Date in Google Sheets

Have you ever struggled to organize your data by date in Google Sheets? Sorting your data by date can make it much easier to analyze and understand. In this article, we will explore four different methods to sort your data by date in Google Sheets, complete with real-world examples and use cases.

Method 1: Using the Sheet Sort Option

If your data is in a single column, the “Sort sheet” option is a quick and convenient way to sort by date. Let’s use a sample dataset to demonstrate how to use the “Sort sheet” option. Check out this dataset extracted from HubSpot into Google Sheets with the help of Coefficient.

Coefficient

Before sorting, ensure that all values in the column are in a valid date format to avoid any errors. To do this, select the range of cells (F3:F18), click on the “Data” tab in the top menu, and choose “Data validation”. In the “Data validation rules” sidebar, set “Is a valid date” as the criteria, and click “Done”.

Coefficient

If any values are not valid dates or if your data is in an incorrect format, an error message will appear. Next, click on the “View” option in the top menu. Hover over “Freeze” and select the header row to freeze it in place.

Coefficient

Select a cell in the column containing the dates you want to sort. Then, click on “Data” > “Sort sheet” > “Sort sheet by column F (A to Z)”.

Coefficient

Now, the “Date Created” column (or column F) should display the oldest dates at the top and the newest dates at the bottom.

Coefficient

If you want to organize the column from the most recent date to the oldest, select the “Sort sheet by column F (Z to A)” option. You can use this same sorting option to alphabetize in Google Sheets as well.

Coefficient

The “Sort sheet” option is a quick and easy method to sort by date, especially when the dates are contained within a single column.

Method 2: Using the SORT Function

The SORT function is another way to sort by date in Google Sheets. With this function, you can sort one or multiple columns within a formula. The SORT function also keeps the sorted data dynamic. If your original dataset changes, the output of the SORT function will automatically update.

Here’s how to leverage the SORT function. First, add an empty column next to the dates you want to sort.

Coefficient

Then, enter the SORT formula below in cell G3.

=SORT(F3:F18,1,TRUE)

Coefficient

The function instantly sorts the dates from oldest to newest. The above SORT function consists of three arguments:

  • The range of cells you want to sort (F3:F18)
  • The column to sort by, relative to the given range (1)
  • The order of sorting the data, in this case, ascending order (TRUE)

You can also sort multiple columns into a single column. To do this, add two empty columns next to the “Date Created” and “Date Closed” columns. Enter this formula (in cell H3) to sort both columns based on the “Date Created” column:

=SORT(F3:G18,1,TRUE)

Coefficient

Press “Enter”, and you will see the empty columns filled with the sorted “Date Created” and “Date Closed” columns.

Note that the SORT function can only return the output in empty cells. Otherwise, Google Sheets will show an error message. Removing or modifying the cells where you applied your SORT formula will result in errors. To modify the cells, you need to convert them to values before making any changes.

Method 3: Using the Range Sort Tool

You can also use the range sort tool to sort dates in Google Sheets. This is a good option if you only need to sort the dates once and don’t require dynamic dates.

Here’s how the range sort tool works. First, select the data to be sorted (F3:G18). Then, click on “Data” in the top menu. Hover over the “Sort range” option in the dropdown list. Click on “Sort range advanced options”.

Coefficient

If your selected data has a column header, check the “Data has header row” option in the “Sort range” dialog box. Otherwise, leave this box unchecked.

For this example, select column F as the “Sort by” option. Then, choose “A→Z” to sort your data in ascending order, or “Z→A” to sort the column in descending order. Finally, click “Sort”.

Coefficient

To sort multiple columns, click on the “Add another sort column” option before selecting the “Sort” button.

Coefficient

And there you have it! The range sort tool sorts the column by date.

Coefficient

Method 4: Using Filters

Another way to sort by date in Google Sheets is by creating filters. To set up filters, select the header cells containing the data you want to sort. Then, click on “Data” > “Create a filter”.

Coefficient

To sort your column data by date, click on the inverted triangle icon in the cell. Then, select “Sort A→Z” to organize the data under the date column from oldest to newest.

Coefficient

To disable the filter, choose “Data” and then “Remove filter”. It’s as simple as that!

Additional Examples: Sorting by Month and Sorting by Date with ARRAYFORMULA

Here are two additional options for sorting by date in Google Sheets. Let’s use an ARRAYFORMULA formula to sort months as text. We’ll use a simple array, such as the dataset below, with months of the year in random order.

Use this SORT ARRAYFORMULA formula in cell B2:

=SORT(A2:A13,MONTH(A2:A13&"1"),1)

Coefficient

The formula sorts the months in the correct order. In the formula, the MONTH function has a range as input. This produces an array of numbers, from 1 to 12, representing each month, sorted in ascending order.

And what if you want to sort specific dates based on the month? There’s a formula for that too. Let’s take the example table below.

To sort the dates in the proper order, enter the following formula in cell B2:

=SORT(A2:A,MONTH(A2:A),TRUE)

You will see that your data is now sorted starting from January (1). The MONTH function sorts the dates in your range from oldest to newest, and the SORT function creates a new array in column B based on that list.

Common Errors When Sorting by Date in Google Sheets

Here are some common errors you might encounter when sorting by date in Google Sheets:

  • Incorrect formatting: Make sure that the cells containing the dates are formatted as “Date” or “Date/Time”. If the cells are formatted as “Text”, the sort function may not work correctly.
  • Inconsistent order: If the dates in your sheet are not consistently sorted in the same manner, the sort function may not work. For example, if some dates are sorted as “mm/dd/yyyy” and others are sorted as “dd/mm/yyyy”, the sort may produce incorrect results.
  • Empty cells: If your sheet contains empty cells, the sort function may consider them as the oldest date in your dataset. To avoid this, use the “Sort sheet by column” option and choose “Sort sheet A→Z”. This will sort the empty cells to the bottom of the column.

If your dataset is not sorting correctly, chances are one of these errors occurred prior to sorting.

Sorting by Date in Google Sheets Made Easy

Sorting by date helps you analyze your spreadsheet data more efficiently. The methods for sorting by date in Google Sheets are all simple, so you can easily organize your data with just a few clicks.

Coefficient makes data sorting, reporting, and analysis even easier in Google Sheets with one-click data connectors.

Get started with Coefficient today for free to automatically extract data from your business systems into Google Sheets.

Discover more “How-To” articles on Google Sheets:

  • How to Add a Dropdown List in Google Sheets
  • How to Format Text in Google Sheets
  • How to Password Protect Google Sheets
  • How to Insert Multiple Rows in Google Sheets
  • How to Merge Cells in Google Sheets
  • How to Search in Google Sheets

Related posts