+ Reply to Thread
Results 1 to 9 of 9

multiple validation rules

Hybrid View

  1. #1
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: multiple validation rules

    If we assume the start shift value is to be entered into C2 (ie that is the cell to which we are applying validation) then perhaps:

    =AND($B2<>"Off",$B2<>"not available",$B2<>"request off",C2>=0,C2<1)
    should only permit time values where B2 not one of those three values, of course this can be circumvented by not having these options in B2, entering time in C2 and then reverting B2 to one of these conditions - this may or may not be an issue... if it is then you will need to use VBA I'm afraid.

  2. #2
    Registered User
    Join Date
    09-22-2009
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: multiple validation rules

    For B2 I have a drop down list of job codes to choose from, I also have the off, request off, and not available options in the list. Scheduling I first assign the job code in b2 then schedule the start and end times in c2 and d2 respectively.

    I input the and function you provide and it seems to be working great so far. Thanks so much for the quick reply.


  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: multiple validation rules

    OK that's good... that's the setup I envisaged, the validation rule for C2 can be copied to D2 also without need for alteration.
    (though I should add that is making the assumption that you are only entering time values and not date time (the use >= 0 and <1 limit, time in XL is decimal)

  4. #4
    Registered User
    Join Date
    09-22-2009
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: multiple validation rules

    I am only entering times, except when I have an employee that is working past midnight. In order for the hours to calculate correctly I have to input the start times like this:

    Start Time End Time
    9/18/09 6:00 pm 9/19/09 12:15 am

    Will I be able to do this with the function you provided?

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: multiple validation rules

    No it wouldn't I'm afraid but to go back one step:

    I am only entering times, except when I have an employee that is working past midnight.
    You can use MOD to calculate the hours using just time assuming no shift ever exceeds 24 hours in length, eg:

    E2: =MOD(D2-C2,1)
    format to h:mm
    will correctly calculate the hours even if shift crosses midnight.. and so using this approach you need only enter time values into both C & D cells (6:00 pm / 12:15 am)

  6. #6
    Registered User
    Join Date
    09-22-2009
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: multiple validation rules

    This works perfect... and it will save me time by not having to enter the dates. Thanks so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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