Data Validation with 24:00 times Excel 2007

KJ2607

New Member
Joined
Aug 28, 2013
Messages
36
Hi

I have a spreadsheet which monitors the hours employees work - one of the rules is that an employee must have 12 hours rest between shifts...

I am using the below Data Validation formula in column I to highlight when an employee has less than 12 hours rest and an alert to appear

=OR(AND(I4-B4<0,"24:00"-B4+I4>=0.5),AND(I4-B4>=0,I4-B4>=0.5))

Now this works perfectly with the exception of when an employee finishes at say, 18:00hrs on a Friday, and starts at 22:00hrs on a Saturday - Excel Calculates the Rest hours as 04:00, when it should be 28:00

I've had a suggestion to use the following:

=I4+I2-B4-A2>=0.5

(I2 being the saturday date, A2 being the Friday date) - this does work but only for Cell I4, If I copy the Data
Validation down the column all cell references change - is there a way to keep the I2 and A2 in the formula without having to retype in every row?

Alternatively can anyone suggest a different solution to my problem?




 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
If you select I2 or A2 you can manually change them to $I$2 or $A$2 the dollar sign constrains column or row, these example would constrain it to only A2 or I2, the other way is to highlight the values. you can press Function F4 and it will provide the same changes

if the date is input with the time then it becomes easier to ensure the correct separation, if your are typing live then you can try this

select a cell, hold down CTRL amd press ; then press space bar, then hold down CTRL and SHIFT and press :
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,953
Members
449,198
Latest member
MhammadishaqKhan

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