Sei sulla pagina 1di 2

Example 3.

Advanced IF formulas for future


and past dates
Suppose, you want to mark only the dates that occur in
more than 30 days from now. In this case, you can express
the logical_test argument as A2-TODAY()>30. The complete
IF formula may be as follows:
=IF(A2-TODAY()>30, "Future date", "")

To point out past dates that occurred more than 30 days


ago, you can use the following IF formula:
=IF(TODAY()-A2>30, "Past date", "")

If you want to have both indications in one column, you will


need to use a nested IF function like this:
=IF(A2-TODAY()>30, "Future date", IF(TODAY()-A2>30, "Past date", ""))

Potrebbero piacerti anche