How-To

How to Sort by Date in Google Sheets

Spreadsheet featured

You’ve created a great spreadsheet packed with useful data. There’s just one problem: your dates aren’t in order.

If you’re trying to analyze data where dates are important, being able to sort by date is important. Thankfully, Google Sheets makes it easy to sort your data into date order.

You’ll need to be sure all your dates are in a valid date format first. Once that’s done, you can sort your dates in seconds.

If you’re unsure, here’s what you’ll need to do to sort by date in Google Sheets.

How to Convert Text to Dates in Google Sheets

Before you can sort by date in Google Sheets, you’ll need to make sure that Google Sheets recognizes your date values as dates (not text).

The simple way to spot these non-valid dates is by their alignment. Valid dates will align to the right of cells, while text will align to the left.

Aligned date examples in Google Sheets

When you come to sort these cells, having invalid dates will leave your data out of order.

Example of text date values in Google Sheets

If you find any invalid dates, you can convert these into dates so that they will sort correctly.

To convert text to dates in Google Sheets:

  1. Open the Format menu.
    The format menu in Google Sheets
  2. Press Number > Date.
    Formatting date values in Google Sheets

Google Sheets will automatically convert your number to a valid date value (if it recognizes it as one).
Setting valid date values in Google Sheets

How to Sort Data in Google Sheets Using the Sort Range Tool

Now that you’re sure that all of your data is in a valid date format, you can sort your data by date in Google Sheets. A good way to do this is to use the sort range tool. The way that you do this will depend on how your data is laid out.

Sorting Data By Dates in the First Column

If your dates are in the first column of your selected data, you can sort your data based on this column in just a couple of clicks.

To sort by dates in the first column in Google Sheets:

  1. Highlight the cells you want to sort, with the dates in the first column of your selected data.
  2. Open the Data menu.
    Opening the data menu in Google Sheets
  3. Press Sort Range > Sort Range by Column X (A to Z) to sort from earliest to latest or Sort Range by Column X (Z to A) to sort from latest to earliest. The X will change, depending on the letter of the first column in your selected cells.
    Sorting data ranges by column in Google Sheets

Sorting Data By Dates That Aren’t in the First Column

If you want to sort by date, but the dates aren’t in the first column of the data that you want to sort, then you’ll need to use a slightly different method.

To sort by dates using any column in Google Sheets:

  1. Highlight the cells you want to sort.
    Selecting data in Google Sheets
  2. Open on the Data menu.
    Opening the data menu in Google Sheets
  3. Press Sort Range > Advanced Range Sorting Options.
    Opening the advanced sorting menu in Google Sheets
  4. If your data has column headings, press the Data Has Header Row checkbox.
    Data row header in Google Sheets
  5. Open the Sort By dropdown.
    Sorting data in Google Sheets
  6. Select the column title containing your dates.
    Sorting data by column in Google Sheets
  7. If you want the dates in ascending order, select A-Z. If you want the dates in descending order, choose Z-A.
    Sorting data in ascending order in Google Sheets
  8. Click Sort.
    Sorting data in Google Sheets

How to Sort Data in Google Sheets Using the SORT Function

If you want to leave your original data untouched, but create a new table in date order, then you can use the SORT function. This will add the sorted data into your spreadsheet, starting from the cell where you type the formula.

To sort data using the SORT function:

  1. Click in the cell where you want the top-left value of the new data to appear.
  2. Type =SORT( and type your data range (or select the cells using your mouse).
    Using the SORT function in Google Sheets
  3. Type a comma, the number of the column containing your dates, and another comma. For example, if your dates are in the second column of your highlighted data you would  type ,2,
    Using the SORT function in Google Sheets
  4. If you want to sort your dates in ascending order, type TRUE. For descending order, type FALSE. Type a closed bracket to complete your formula.
    Using the SORT function in Google Sheets
  5. Press Enter and your sorted data will appear.
    Sorted data in Google Sheets using the SORT function

Organizing Your Google Sheets Data

Need to rearrange your data? Knowing how to sort by date in Google Sheets is a good way to start by following the steps above.

There are other ways you can use Google Sheets to sort your data, however. For example, you could alphabetize data in Google Sheets or sort your data using custom number formats.

If you want to look at specific data without the need for sorting it, consider using Google Sheets filters. You could also use conditional formatting in Google Sheets to highlight any data you’re interested in automatically.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

 

To Top