Forum Discussion

PPatel19's avatar
PPatel19
Copper Contributor
Jul 27, 2021
Solved

Auto formatting

I have a spreadsheet with DOB. I was wondering if there was a way that on opening the spreadsheet it would highlight the DOB of those turning 12, 18 or 24 years of age within the next 2 months. Any ...
  • HansVogelaar's avatar
    Jul 27, 2021

    PPatel19 

    Let's say the dates of birth are in D2:D100.

    Select this range. D2 should be the active cell in the selection.

    On the Home tab of the ribbon, select Conditional Formatting > New Rule...

    Select 'Use a formula to determine which cells to format'.

    Enter the formula

     

    =OR(AND($D2>EOMONTH(TODAY(),-288),$D2<=EOMONTH(TODAY(),-286)),AND($D2>EOMONTH(TODAY(),-216),$D2<=EOMONTH(TODAY(),-214)),AND($D2>EOMONTH(TODAY(),-144),$D2<=EOMONTH(TODAY(),-142)))

     

    Click Format...

    Activate the Fill tab.

    Select a color.

    Click OK, then click OK again.

Resources