Search code examples
google-sheetscomparisondate-formattinggs-conditional-formatting

Highlight google sheet cell if age is under 18 on a specific date


So I have kind of an odd question, and I don't know if this is possible in google sheets.

I work with a volunteer group that helps staff about six different conventions a year. For a couple of departments, you have to be 18 to work in that department. One of the questions we ask them for is their birth date. I'm curious if there is a way to tell google to highlight a cell red if an applicant will not be 18 by a certain date.

Say for example there is a convention on January 1st, 2017. Is there a way to get the conditional formatting to look at the birth date cell, compare it to January 1st, 2017, and turn the cell fill red if the date is not at least 18 years in the past?


Solution

  • Assuming dates of birth are in ColumnA and the relevant conference date is in F1, please try selecting ColumnA and Format, Conditional formatting..., Custom formula is:

    =datedif(A1,$C$1,"Y")<18  
    

    red fill and Done.