I am trying to make a shared Google Sheet for the Motel I work at where employees can do a cleanliness check on a room, enter the room number and date into a table, and have the 'Room Check Status' in columns H:K update automatically.
I would like cells in the range H3:K18 to have a black background if they appear in the editable 'Out of Order' list. I would like the remaining rooms to appear red if they have not been checked in more than 14 days, yellow if they have been checked between 8-14 days ago, and green if they have been checked in the past week.
The formula(s) would need to check to see if the Room Number appears in the table and if not, change the cell in the 'Status' range red. If the room does appear in the table, it would then check the Date column to see how many days ago the check was performed, and color the 'Status' cell accordingly.
Here is the format I'm working with
For anyone concerned about cleanliness, the rooms are cleaned regularly, this is more a check on the condition of furniture, paint, appliances, etc.!
I tried setting up 3 conditional formatting rules for the Status range:
(Green) =and(eq(vlookup(H3, A:A, 1, false), H3), (D:D<=today()-7))
(Yellow) =and(eq(vlookup(H3, A:A, 1, false), H3), (D:D>today()-7), (D:D<=today()-14))
(red) =and(eq(vlookup(H3, A:A, 1, false), H3), (D:D>today()-14))
This resulted in 118, 122, 138 turning Green and 110, 130 turning Red. Of these highlights, only rooms 118 and 138 are correct.
I also tried using similar formulas with FLATTEN() applied to the Status range, but no success.
Any help would be greatly appreciated!
