How to Sort Data by Date Values in Google Sheets

Data can be sorted based on text, numbers, color, or date values. Date values could be in different date formats but in the backend, it always gets stored as number values. So, whenever you sort the data by dates, it got sorted in their number format

 In this tutorial, we will show how to validate the dates and sort data based on date values.

Sort Data by Date in Google Sheets

  • First, select the data range and then go to the “Data” tab.
  • After that, hover the mouse on “Sort range” and then click on “Advanced range sorting option”.
sort-data-by-date
  • Now, in the “Sort range” dialog box, checkmark the “Data has header row” and then select the header name (where in you have date values) based on which you want to sort the data.
  • Once done, choose (A-Z) to sort the data in ascending order or (Z-A) for descending order, and then click on the “Sort” button.
checkmark-data-has-header-row
  • At this point, your selected range has been sorted based on the date values of the column “Date” in ascending order.
data-sorted-by-date

Sort Data by Dates Using Filters

Applying and using Filters to sort the data is another good option to sort the data.

  • Click anywhere in the data set and then go to the “Data” tab and click on “Create a filter” to apply the filters on the data set.
sort-by-date-using-filters
  • Now, click on the filter icon of the column that has date values and then click on “Sort A-Z” or “Sort Z-A” to sort the data based on date values in ascending or descending order.
sort-in-ascending-or-desending-order

Validate if the Date is in Date Format

If you enter the dates manually in the data, sometimes you might have some date values entered incorrectly or not in a date format due to which sorting could be incorrect. You can find the incorrect dates and correct them before sorting.

  1. First, select the column that contains the dates.
  2. After that, go to the “Data” tab and then click on the “Data validation” option from the drop-down menu.
validate-if-date-format-is-correct
  • Here, in the “Data validation rules” dialog box, click on the “Add rule” button to add the data validation condition.
  • Now, click on the “Criteria” field drop-down icon to open the criteria list and choose “Is valid date” from it.
  • In the last, checkmark the “Show a warning” option and then finally click on the “Done” button.
criteria-is-valid-date
  • At this point, you will find the triangular red icons in the top right corner of the cells that have incorrect dates and when you move your cursor on them, it will show the message to enter the valid date.
invalid-date-warning

Sort Data by Date Using Sort Function

The sort function helps to sort the data without manipulating the original data structure by creating a separate copy of the sorted data. So, if you want to maintain the original data set and a copy of the sorted data set, then the Sort function is the best option. With this, you can copy the sorted data output within the same sheet or the different sheet. Link to “Sort data using Sort function”