
Use the DATEDIF function to determine all
friends younger than 30
You have the birth dates of your friends listed in a worksheet and
want to shade those who are currently younger than 30 years old.
Use the TODAY function to determine the actual date and the
DATEDIF function to calculate the exact age, then combine those
functions with conditional formatting.
4
To determine all friends younger than 30:
1. In a worksheet, enter data in cells A2:B10, as shown in
Figure 10-25.
2. Select cells A2:B10.
3. On the Format menu, click Conditional Formatting.
4. Select Formula Is and type the following formula:
=DATEDIF($B2,TODAY(),"Y")<30.
5. Click Format.
6. From the ...