How To Sort by Date in Google Sheets (6 Easy Examples)

Google Sheets has really easy tools to use when it comes to sorting data.

And these same tools can also be used when you need to sort by date in Google Sheets.

Since a date is nothing but a number in the backend, when you sort by date, you’re essentially sorting a numerical dataset. However, since Date format can take many different formats, sometimes it becomes a pain to sort by date.

In this tutorial, I will show you how to sort by date in Google Sheets, some common issues that you may face when working with a date dataset, and a way to convert any text value to a date value.

So let’s get started!

How To Sort by Date in Google Sheets

Here’s how to sort your data by date in Google Sheets:

  1. Select the data range you want to sort.
  2. Go to “Data” > “Create a Filter.”
  3. Click on the filter icon.
  4. Select “Sort A – Z” (ascending) or “Sort Z – A” (descending).

How To Validate Your Data

You must validate your data to ensure you’re using the correct format. Here’s how:

  1. Select the data.
  2. Go to “Data” > “Data Validation.”
Sort by date Google Sheets—Go to Data > Data Validation.

 

  1. In the data validation window, click “Add rule.”
  2. Go to “Criteria” and choose “Is valid date.”
Go to Criteria and choose “Is valid date”

 

  1. Check on the option for “Show a warning” and click “Done.”
Check on the option for “Show a warning” and click Done.

 

If there are any invalid dates, you’ll get a warning, and you had better fix them.

How To Sort by Date in Google Sheets Using Filters

You can also use filters to sort by date in Google Sheets. Let’s look at our example sheet below:

Let’s look at our example sheet below

 

Here’s how to sort it using filters:

  1. Select the data range you want to sort.
  2. Go to “Data” > “Create a Filter.”
Go to Data > Create a Filter

 

  1. Click on the filter icon.
Click on the filter icon

 

  1. Select “Sort A – Z” (ascending) or “Sort Z – A” (descending).

Sort Function Syntax

The syntax for the SORT function is:

SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])
  • range: The data to be sorted.
  • sort_column:  The column ID for the values by which to sort either inside or outside the selected range. It must be a single column with the same size as the range.
  • is_ascending:  Indicates whether the range should be arranged in ascending or descending order. It uses TRUE or FALSE, where TRUE sorts in ascending order and FALSE in descending order.
  • sort_column2, is_ascending2 …[ OPTIONAL ]: Any additional columns to be sorted.

Take a Course

Do you find yourself visiting sites like ours a lot? Sometimes it’s better to take a full Google Sheets course so you can problem-solve on your own. That will save you a lot of time in the long run.

Sort by Date Using the SORT Function

The easiest way to sort the data in Google Sheets is by using the “Google Sheet sort by dateSORT function.

It takes the original dataset and gives you sorted date data as the output. You can have single or multiple columns sorting where you can specify the date column to be the one to use for sorting.

The best part about using the SORT function is that your result is dynamic. If something changes in your original dataset, the resulting sorted data will automatically adjust to reflect the changes.

Now let me show you how to organize Google Sheets by date using a couple of examples for sorting by date using the SORT function.

Suppose you have a dataset, as shown below, and you want to sort this column based on the dates.

Dataset for sorting dates in Google Sheets

 

Here’s how to organize a Google Sheet by date for the above data:

  1. Click on an adjacent empty cell.
  2. Type in the =SORT formula.
  3. Select the range you want to sort, which is from A2:A9.
  4. Type the column ID we’ll be sorting by, which is 1 for column A.
  5. After a comma, type TRUE if you want to sort in ascending order and FALSE for descending.
=SORT(A2:A9,1,TRUE)
SORT formula to sort by date in Google Sheets

 

The above SORT function takes three arguments:

  1. A2:A9: This is the range that needs to be sorted.
  2. 1: This tells the SORT function to sort based on the first column in the given range. Since there is only one column in our example, this value can only be 1.
  3. TRUE: This makes the sorting order ascending.

If you have a dataset with multiple columns (with dates in one column), you can also sort this dataset based on the date using the SORT function.

Suppose you have a dataset as shown below:

Sort Multiple Columns by date in Google Sheets

 

The below formula will sort this dataset based on the date column.

=SORT(A2:B9,1,TRUE)
SORT formula when you have multiple columns

 

When using the SORT function, make sure the cells where the output of the SORT function will be placed are empty. If there is something in any of the cells, the result would be an error (but Google Sheets is kind enough to tell you why it’s giving an error).

Also, since this is an array formula, you can’t change one array element. For example, after using the SORT formula, you can delete or change any of those cells. If you do that, it will remove all the results and show you an error. If you want to change these cells, you must convert these cells to values and then make the changes.

Spreadsheet fundamentals screenshot

 

Related Reading: Sort by Color in Google Sheets

Sort by Date Using the SORT Range Functionality

If you don’t need the resulting data to be dynamic and only need to sort by date once, you can also use the inbuilt sorting functionality in Google Sheets.

Suppose you have a dataset, as shown below, and you want to sort this data based on the date.

Sort Multiple Columns by date in Google Sheets

 

Here’s how to organize by date in Google Sheets:

  1. Select the data to be sorted.
  2. Click the “Data” option in the menu.

 

Click the Data option in the menu.

 

  1. Click the “Sort range” option.
Click on 'Sort range' option

 

  1. Go to “Advanced range sorting options.” In the “Sort range” dialog box:
    • Select the option “Data has header row” (if your data doesn’t have a header row, leave this unchecked).
    • Select the column you want to sort by (Date in this example).
    • Click on the “A-Z” option (which is in ascending order).
      Sort Range dialog box
  1. Click on the “Sort” button.
    Click the SOrt Button

The above steps would sort the data instantly.

Note: In case you may need the original dataset, it’s best to create a backup copy of the dataset and then perform the sorting.

Related: How To Change the Date Format in Google Sheets

How To Sort Dates by Day of the Week in Google Sheets

We can also sort the dates by the day of the week using the SORT function together with the SORT function.

Here’s

  1. In you’re spreadsheet, make two columns for “Day of the Week” and “Day of Week number.”
  2. In the column for “Day of the Week number,” type =WEEKDAY (“your date cell“).
Sort with the weekday function

 

  1. To copy the formula to the rest of the cells in the column, click the blue square at the bottom right corner of the cell and drag it down to the other cells.
  2. In the column for “Day of Week,” enter the formula:
=CHOOSE(weekday(D2), "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
Sort with the choose function

 

  1. Now select your data range.
  2. Go to “Data” > “Sort Range.”
Go to Data > Sort Range and choose Advanced range sorting options.

 

  1. Go to “Advanced range sorting options.”
  2. If you’ve selected your header rows, make sure to check the option “Data has header row.”
  3. Go to sort by and choose the column for “Day of week number.”
Advanced sorting options

 

  1. Click “Sort.”
Sorted data

 

Your table should now be sorted by the day of the week.

How To Sort by Date in Google Sheets Using Column Filters

Sometimes you may want to sort a single column. Below is how to sort a column by date in Google Sheets, but it also works if you select a whole range too.

Choose the type of sorting

 

Once you have ensured all of your data in a particular column are valid dates (Data > Data validation > Date) and frozen the header rows, you can also use the “Sort sheet by column Xoption to alphabetize and sort the sheet by date. Here’s how to sort Google spreadsheets by date:

  1. Select an empty row in the column with the dates in it.
  2. Navigate to “Data” > “Sort sheet by column X.”
    • A -> Z is the earliest date to the latest.
    • Z -> A is the latest to earliest.

You can also sort by multiple columns if you wish.

Common Issue When Sorting by Date in Google Sheets

The most common issue people face when working with dates in Google Sheets is that the date is not in the proper format.

In Google Sheets, all dates are nothing but numbers in the backend. For example, the date January 01, 2020, is actually a number 43831 in Google Sheets. While you may see it as a date, Google Sheets sees it as a number. All it has done is format it in a way that looks like a date.

Since these are numbers being formatted as dates, if Google Sheets recognizes a format that can be converted into a number, it will consider it as a proper date. Everything else is considered a text value.

And if you have such formats that are not valid date formats, you will not be able to sort the data using the SORT formula or the in-built sort functionality.

For example, in the below dataset, all the date formats in column A are valid, and Google Sheets can convert this into dates (i.e., the number associated with the date).

But sometimes, you may get a date in a format that Google Sheets doesn’t understand.

Below are two examples where Google Sheets won’t be able to convert the given date into a date number it recognizes and would consider these as a text value.

If you have such dates in your dataset, the sorting would be incorrect.

To make sure your data is correct, you need to make sure the dates are in the right format.

Below are two ways to find out whether the date is in the right format or not:

Check the Alignment of the Date

By default, all dates are aligned to the right in a cell in Google Sheets, and all text is aligned to the left.

If you notice that dates are aligned to the left, it’s likely an incorrect format.

Dates in text format are aligned to the left

Check the DATEVALUE Function

If you have a cell that contains a date and you use the DATEVALUE function (with that date cell as the argument), it will give you the numeric value of the date.

For example, in the below case, the DATEVALUE function returns 43831, which is the numeric value for the date January 01, 2020. But if there is a format that Google Sheets doesn’t recognize as a date (such as 01.01.2020), the DATEVALUE function gives an error.

Date format with DateValue function result

 

To check the dates in a dataset, quickly use the DATEVALUE function in the adjacent column and check for an error. If there is an error, it means the cell has a date in the wrong format.

Sort Your Spreadsheets by Date in Google Sheets

Sort spreadsheets by date

 

Here’s how to sort Google Sheets by date. You must click the A-Z logo on the Google Sheets main screen and select “Last Modified.”

Frequently Asked Questions

How Do I Sort Google Sheets by Date and Keep Rows Together?

Here’s how to sort by date in Google Sheets without mixing data:

  1. Select a cell in the cell range you want to sort.
  2. Highlight the entire range by clicking and dragging from the initial cell.
  3. Go to “Data” > “Sort range.”
  4. Choose either A to Z or Z to A, depending on the order you want.

Can You Sort Rows by Date in Google Sheets?

Yes, you can. There are several different ways, including using the SORT function or using the sort range option in the data menu. We have shown you all these methods in our guide with examples. You can look at our guide for how to sort horizontally in Google Sheets.

Why Is My Google Sheet Not Sorting by Date?

Google Sheets does not sort data by default, as there are many use cases where people don’t want their spreadsheets sorted by date. You must have a Google spreadsheet sorted by date by highlighting the data and heading to “Data” > “Sort range.”

How Do I Sort Google Sheets From Oldest to Newest?

Highlight the range you want sorted by date and navigate to “Data” > “Sort Range.” From the sort range menu, choose “Sort range by columns A (A to Z)” to sort in ascending order or from old to new.

How Do I Sort by Date in Google Drive?

To sort by date in Google Drive, Click the “Last modified” header above your files and select any of the options that pop up.

Wrapping Up 

In this article, we’ve shown you how to sort by date in Google Sheets. There are two methods to have Google Sheets sort by date: Using the SORT function and using the SORT option in the data menu.

Love learning new tricks to make better spreadsheets? Analyzing Data with Excel is a noteworthy online course offered by IBM, which focuses on providing fundamental knowledge for performing basic data analysis using Excel. While the emphasis is on Excel, those interested in learning about Google Sheets would find a lot of cross-over value in the content.

Related:

Most Popular Posts

6 thoughts on “How To Sort by Date in Google Sheets (6 Easy Examples)”

  1. I found one problem I was having was that you need to have the dates to the right of the names. For example, I had products I have sold in the first column with the dates in the column on the right in the second column. When using this function, it will sort your data but sort alphabetically based on the product name but not by date. I solved this problem by moving the dates into the first column and having product names in the second column. Also, I didn’t heed your warning when you said the dates needed to be formatted properly in date form, very important!

    Reply
  2. HI thanks for the tutorial. I want to sort dates horizontally in the month for my personal budget. I cant fig out how to do this automatically? so column A, line 2 is Dec1,Line 3 is Dec 2 and so on.. thanks so much!!

    Reply
    • Once you’ve sorted your data vertically. You can use the TRANSPOSE function to move a vertical table into a horizontal one.

      Reply
  3. This is very helpful! Thank you for publishing it.

    One question… when I sort dates across 4 years worth of data, it groups all the Januaries together, Februaries together, etc. So I have a list of data for January 2018, January 2019, January 2020, February 2018, February 2019, February 2020, and so on.

    How do I get it to sort chronologically?

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts

Thanks for visiting! We’re happy to answer your spreadsheet questions. We specialize in formulas for Google Sheets, our own spreadsheet templates, and time-saving Excel tips.

Note that we’re supported by our audience. When you purchase through links on our site, we may earn commission at no extra cost to you.

Like what we do? Share this article!