Aug 25 2024 05:30 PM
Hello!
Each week I need to format a call logs report where column A is the date + time of the call.
I have been trying to figure out the conditional formatting formula to highlight rows between 8:30am - 17:30pm in red, but I can only seem to make it work for whole hours (8am-5pm)
I am currently using the following formula:
=OR(HOUR(A1)=8, HOUR(A1)=9, HOUR(A1)=10, HOUR(A1)=11, HOUR(A1)=12, HOUR(A1)=13, HOUR(A1)=14, HOUR(A1)=15, HOUR(A1)=16, HOUR(A1)=17)
Is there a way to get this to work for 8:30-17:30? I have tried making it HOUR(A1)=8,3,0 with no luck.
Thank you!
Aug 25 2024 06:24 PM
SolutionIf anyone else is having the same issue, Copilot ended up figuring it out for me!
Turns out, even though I was formatting column A correctly as "Time", it still had hidden non-printable characters preventing any of the possible time formulas from working correctly.
Here's what I had to do:
=CLEAN(A1)
when I used the clean function, it changed the times in Column A from h:mm:ss to a decimal number, which meant I needed to clean and convert before applying the conditional formatting:
=TIME(HOUR(A1), MINUTE(A1), SECOND(A1))
=AND(A1>=TIME(8,30,0), A1<=TIME(17,30,0))
This ended up working perfectly!!
Aug 25 2024 06:24 PM
SolutionIf anyone else is having the same issue, Copilot ended up figuring it out for me!
Turns out, even though I was formatting column A correctly as "Time", it still had hidden non-printable characters preventing any of the possible time formulas from working correctly.
Here's what I had to do:
=CLEAN(A1)
when I used the clean function, it changed the times in Column A from h:mm:ss to a decimal number, which meant I needed to clean and convert before applying the conditional formatting:
=TIME(HOUR(A1), MINUTE(A1), SECOND(A1))
=AND(A1>=TIME(8,30,0), A1<=TIME(17,30,0))
This ended up working perfectly!!