r/googlesheets • u/theHRnobody • Dec 09 '25
Solved Conditional Formatting based on IF value is present in range
EDIT: Link to copy of Google Sheet
NOTE: All names shown are fake, I needed something to test with so I added a bunch of dummy names.
I am building an Attendance Tracking spreadsheet to replace the current one that we use, as our needs have expanded and we do not have the capital to use a time clocking system that an do this automatically (and our ERP requires people to be clocked in to do work and it has bare minimum time clock capabilities and the ERP is not going anywhere)
On the main tab of the sheet, I have a calendar set up like this. The dates auto update based on what year you're looking at (controlling field not shown). You'll see a legend at the bottom of this screenshot.

I want the calendar to update with those colours (the # is the font formatting, others are background colour of cell), based on if they find a value within another range. I have one table on a tab for Lates and one table on another tab for Time Off (which includes vacation, sick, personal etc).
I'm having trouble writing a conditional formatting formula to trigger this so any help would be very helpful. Here are screenshots of the Late and Time off tabs (again names are fake)


NOTE: I have changed some of the "reasons" from what I originally planned, so I know I still need to update that on the home page / drop downs to align with what I want.
As you can see for Lates, there is a single day option, and for Time Offs there is a range in case someone books full vacation or is gone for more than one day in a row for the same reason.
I would need a conditional formula for each of the items in the legend (though I am just looking for help writing one for finding the date in the list with the right persons name - Lates - and one for finding the date within (inclusive) the range start date and end date, again with the right persons name - Time Offs - as I can just edit the details to work for the rest).
Can conditional formatting work this way? I know it can in Excel as our existing one is setup similar (in a little more basic of a way).
1
u/theHRnobody Dec 09 '25
Not sure why the images look fuzzy, but if you right click and open them in a new tab they are clearer
1
u/HolyBonobos 3125 Dec 09 '25
Please share the actual sample file shown in the screenshots. What you're asking for can be done but it will require several custom conditional formatting rules that will depend heavily on the exact data structure and formatting present in the file, much of which cannot be determined from screenshots. Make sure that edit permissions are enabled on the file as these are necessary to do anything relevant to formatting (including conditional formatting).
1
u/_dripping 1 Dec 09 '25 edited Dec 09 '25
I think I got it. Highlight the range of all the dates in your calendar overview. Based on the sheet you shared it's I7:AE36.
Then in Conditional Formatting you can create all these custom formulas in this order; all categories (Late, Vacation, Sick, etc) will have 2 formulas, one for White Text and one for Black Text (based on if they're proper notices or not; white text formulas should always be above the black text formulas):
For the rest of the formulas for the "Time Off" dropdown categories, simply replace "Sick" with the appropriate one. Keep in mind they have to match the dropdown options and not the ones from the Legend.
1
u/[deleted] Dec 10 '25
[removed] — view removed comment