# Compare Two Dates

HomeExcel FormulasCompare Two Dates

Table of Content

In Excel, you can compare two dates by using a simple and quick formula that can return TRUE or FALSE in the result.

Or you can also use the IF function to get the custom message in the result while comparing two dates.

In the following example, we have two different dates in cells A1 and B1.

2. Now refer to cell A1 where you have the first date.
3. Next, enter the “=” equal sign again.
4. After that, refer to cell B1 where you have the second date.
5. In the end, hit enter.

=A1=B1

Further in this tutorial, we are going to look at a few different examples to understand it.

## Compare IF a Date is Greater than Another Date

In the following example, we have compared the first date with the second, if the first date is greater than the second date.

=A1>B1

In the formula, we have used the greater than operator to do this.

## Compare a Date with Today’s Date

In the same way, if you want to compare a date with today’s date you can use the TODAY function.

In the following example, we have used the TODAY function and then compare it to another date.

=A5=TODAY()