
Use the IF function to check whether a date
is in the past or future
In this example we want to check whether a particular date is in the
past or the future. To do so, the TODAY() function is used with IF
to compare dates with the actual date and show its result.
4
To compare dates — variant A:
1. Select cell B2:B11 and type the following formula:
=IF(NOT(A2>TODAY()),"past","future").
2. Press <Ctrl+Enter>.
4
To compare dates — variant B:
1. Select cell B2:B11 and type the following formula:
=IF(A2>=TODAY(),IF(A2=TODAY(),"Today",
"Future"),"Past").
2. Press <Ctrl+Enter>.
Logical Functions 55
2
Figure 2-16