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
Method 2: Check if Dates are Not Equal
Method 3: Check if First Date is Greater than Second Date
Method 4: Check if First Date is Less than Second Date
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:
Here’s how each formula works:
- 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:
How to AutoFill Dates in Google Sheets
How to Add & Subtract Days in Google Sheets
How to Calculate the Difference Between Two Dates in Google Sheets