I am trying to put some conditional formatting into a spreadsheet but I have become stuck, I have three things I need to check:
- Does the name in column A match with one in D
- Is the date in column E today or earlier
- Is the date in column G today or later
If all of these conditions are met then the corresponding cell in column A will change colour.
Here’s whats in the table:
- There is a list of staff in column A
- If they are out of office at any time during the week their name will be in column D
- Column E is the start of their time off
- Column G is the end of their time off
So far I can only get it to highlight if the names match, I’m struggling to add the other conditions even after Googling for hours:
I also tried this, to no effect:
You’re close. I tried the following formula and it appears to work:
The result of this is:
@jsheeran’s answer will work. However, if you apply it to many cells, it could become slow due to the VLOOKUP. INDEX/MATCH is a one to one replacement for VLOOKUP and it is faster, more adaptable, and doesn’t break if you were to insert a column between D and E.
=AND( IFERROR( INDEX($E:$E, MATCH($A1,$D:$D,0))<=TODAY(), FALSE ), IFERROR( INDEX($G:$G, MATCH($A1,$D:$D,0))>=TODAY(), FALSE ) )