How to Compare Dates in Google Sheets (With Examples)

Comparing dates in Google Sheets is a straightforward process that requires the use of the =DATEVALUE and =IF functions. By inputting the dates into the =DATEVALUE function, you can compare them in the =IF function and determine which date is earlier or later. You can then return a result based on the comparison. Using this method, you can quickly compare dates in Google Sheets and make decisions based on the results.


You can use the following methods to compare date values in cells A1 and B1 in Google Sheets:

Method 1: Check if Dates are Equal

=A1=B1

Method 2: Check if Dates are Not Equal

=A1<>B1

Method 3: Check if First Date is Greater than Second Date

=A1>B1

Method 4: Check if First Date is Less than Second Date

=A1<B1

Method 5: Find Which Date is Latest

=IFS(A1>B1, "First Date", A1<B1, "Second Date", A1=B1, "Equal")

The following example shows how to use each method in practice.

Example: Compare Dates in Google Sheets

Suppose we have two columns in Google Sheets that each contain date values:

The following screenshot shows how to use the formulas defined earlier to compare the values in the date columns:

Google Sheets compare dates

  • Column C: If the dates are equal, a value of TRUE is returned. Otherwise, FALSE is returned.
  • Column D: If the dates are not equal, a value of TRUE is returned. Otherwise, FALSE is returned.
  • Column E: If the first date is greater (i.e. later), a value of TRUE is returned. Otherwise, FALSE is returned.
  • Column F: If the first date is less (i.e. earlier), a value of TRUE is returned. Otherwise, FALSE is returned.

The following screenshot also shows how to use an IFS() function to determine which date is latest:

Note that these formulas will only work if the values in the first two columns are both formatted as dates.

To convert the values in each column to date, simply highlight all of the date values, then click the Format tab along the top ribbon, then click Number, then click Date.

The following tutorials provide additional information on how to work with dates in Google Sheets:

x