Time difference (conditional format)

trevolly

Board Regular
Joined
Aug 22, 2021
Messages
124
Office Version
  1. 365
Platform
  1. Windows
HI all.

I have a form where three durations of minutes are entered for an engine run (cells I29, I30 and I31) and they are added up and converted in to hours and mins and placed in to "Total Engine run time" (cell D31) using a formula.

The engineer has to put in a start and finish time of the test (cells D29 and D30). Is there any way to compare the two times in cells D29 and D30 to the "total engine run time" in cell D31, and using conditional formatting highlight if there is a difference and a cell would change colour to highlight this error ( or an error box show?)

i;e the screenshot I've attached would be wrong.

Capture.JPG


The idea is to stop engineers just slapping in any durations and times for the tests - I need accuracy that the three engine run tests add up to the duration between the actual start time and actual finish time.

Thank you all
Trevor
 

Excel Facts

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

MrExcelPlayground23.xlsx
ABCD
1Start12:00T116
2End13:30T212
3Time1:13T345
Sheet16
Cell Formulas
RangeFormula
B3B3=SUM(D1:D3)/24/60
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B3Expression=INT(60*24*B3)<>INT(60*24*(B2-B1))textNO
 
Upvote 0
Solution
Thank you - it works when I recreate your demo but when I apply it to my form the conditional formatting stays red no matter what Strange, Ill keep playing.
 
Upvote 0
The thing with the time difference is funny. Sometimes when you subtract, you might get a difference including .00001 or a .999999 - but it looks normal. Sorting that out is the key. I try to solve it with "INT" - but since they are all less than 1, some multiplication. Maybe it's better to check ABS(B3-(B2-B1))<1/24/60 or such.
 
Upvote 0

Forum statistics

Threads
1,223,880
Messages
6,175,154
Members
452,615
Latest member
bogeys2birdies

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