+ Reply to Thread
Results 1 to 6 of 6

Data validation based on several fields

  1. #1
    Registered User
    Join Date
    08-26-2007
    Posts
    9

    Data validation based on several fields

    Hi,
    I've tried several options with no luck and I would truly appreciate any help.
    I have something similar to this:

    A B C
    1 3 Y
    2 5 N
    3


    If the user enters 15:30 or less in C1, C2,C3...etc then accept it unless
    (A1 is equal to (6 or 7)) and (B1 equal to Y)
    A2 is equal to 6 or 7 and B2 equal to Y
    ...ETC

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try this formula in the Formula field of the Data Validition Custom option:

    =AND(C1<="15:30"+0,NOT(AND(OR(A1=6,A1=7),B1="Y")))

    you can then copy the data validation to the other cells via Edit|Paste Special >> Validation
    Last edited by NBVC; 08-27-2007 at 08:52 AM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-26-2007
    Posts
    9

    Thank You!

    Thank you very much!! This is perfect.
    I will try to understand the logic.

    God bless Canada
    I'm Canadian after all

  4. #4
    Registered User
    Join Date
    08-26-2007
    Posts
    9

    Thumbs up

    Your solution works perfect

  5. #5
    Registered User
    Join Date
    08-26-2007
    Posts
    9
    Hi,
    What is the +0 next to "15:30"?

    Thank you.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    It converts the text value "15:30" into the numeric value (ie. 0.645833333333333 , which is the serial number Excel uses for 15:30) so that the comparisons can be done.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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