+ Reply to Thread
Results 1 to 4 of 4

Data Validation with 24:00 times Excel 2007

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    Darlington, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Data Validation with 24:00 times Excel 2007

    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 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 attached a sample spreadsheet to illustrate...

    Is there any way round this?

    Thanks in Advance

    Excel Forum Help example.xls

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Data Validation with 24:00 times Excel 2007

    Try this formula for validation of I4 cell.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-03-2013
    Location
    Darlington, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Data Validation with 24:00 times Excel 2007

    Hi

    That works great! - however is there a way to keep the I2 and A2 in the formula - when I copied the formula down the colum all cell references changed therefore the data validation won't work except in I4.

    My actual spreadsheet has 100 rows and would need the validation entered on every day of the week

    Thanks

  4. #4
    Registered User
    Join Date
    12-03-2013
    Location
    Darlington, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Data Validation with 24:00 times Excel 2007

    I completely missed the obvious to add absolute referencing to the formula!

    =I4+$I$2-B4-$A$2>=0.5

    And it works!! Thanks you for your assistance

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 2007 - Data validation list from another worksheet
    By supergirl21 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-23-2013, 10:30 PM
  2. data validation in excel 2007
    By rohit43 in forum Excel General
    Replies: 7
    Last Post: 12-30-2012, 03:29 PM
  3. Excel 2007/2010 Data Validation changes???
    By drooke in forum Excel General
    Replies: 2
    Last Post: 12-06-2011, 12:37 PM
  4. Excel 2007 Data Validation Issue
    By dgaller in forum Excel General
    Replies: 1
    Last Post: 03-02-2011, 04:04 PM
  5. Data Validation in Excel 2007
    By jguillen in forum Excel General
    Replies: 1
    Last Post: 04-27-2008, 08:07 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1