Calculating difference in time - conditional formatting

Mux99

Board Regular
Joined
Apr 15, 2019
Messages
57
Hi all

I would like to calculate Time-in - Time-out and if there is less than a 9 hour difference, highlight the cells. In the example below B4:B5 & C2:C3 would be highlighted.

Time-inTime-outTime-inTime-outTime-inTime-out
08:0018:0009:0022:0006:0017:00
12:0023:0007:0016:0010:0019:00

<tbody>
</tbody>
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi,

Not quite sure about your example

In the example below B4:B5 & C2:C3 would be highlighted.

Where are all these cells exactly ?
 
Upvote 0
Hi,

Not quite sure about your example

Where are all these cells exactly ?

Sorry about that as I did not copy the whole table. I meant to say D2:E2 & B3:C3. Please see the example below

ABCDEF
1Time-inTime-outTime-inTime-outTime-inTime-out
208:0018:0009:0022:0006:0017:00
312:0023:0007:0016:0010:0019:00

<tbody>
</tbody>
 
Last edited:
Upvote 0
Hello,

Thanks for your clarification ...

For your range B2:F3 you can have following formula

Code:
=MOD(B2-A2,1)<0.375

Hope this will help
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,954
Members
448,535
Latest member
alrossman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top