+ Reply to Thread
Results 1 to 12 of 12

Cross-Validation Rule

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-12-2008
    Location
    Doha-Qatar
    MS-Off Ver
    Excel 2007
    Posts
    137

    Cross-Validation Rule

    Hello Friends,


    Is there any way to create a cross-validation rule between 2 cells?
    For example,

    Cell A5 will have one of the following values (AA, BB, or AB)
    In column K I have values like 111
    222
    333
    444
    Now, I need a code that will allow me to use 111 in B5 if A5 has AA, so if I mistakenly typed 222 In B5 the code will show me a message says that this 222 cannot be used with AA?
    Please find attached for your easy reference.

    Thanks in advance
    Attached Files Attached Files
    Last edited by malnahar; 01-17-2009 at 01:22 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Can each 2 letter code have multiple possible numeric codes or is there a specific Department for each Center? In the first case, a simple VLOOKUP will work. In the second, first you would need to set up those lists showing which Center has which possible departments.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Valued Forum Contributor Rahul Nagar's Avatar
    Join Date
    09-18-2008
    Location
    nasik
    MS-Off Ver
    Excel 2003
    Posts
    465
    Hello ChemistB,

    As per your attachment , please use following formula in B coloum

    =VLOOKUP(A5,$J2:$K17,2,0)

    this might be helpful
    __________________
    Regards
    Rahul Nagar
    Founder of www.myshortcutkeys.com.


    If you get the answer of your questions then please click EDIT in your original post then click on GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the scales icon top right of thier post to show your appreciation.

  4. #4
    Forum Contributor
    Join Date
    02-12-2008
    Location
    Doha-Qatar
    MS-Off Ver
    Excel 2007
    Posts
    137
    Hi,

    For every center there are several specific departments, ie, departments (444,555 and 666) are always to be attached to center AA.

    I have updated the file, would you please have a look

    Thanks
    Attached Files Attached Files

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    See attached.
    Attached Files Attached Files
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor
    Join Date
    02-12-2008
    Location
    Doha-Qatar
    MS-Off Ver
    Excel 2007
    Posts
    137
    Thank you shg,

    Actually I am not worried about the values in column C, rather I am looking to have a formula in column D which says:
    If A4=”AA” and “B4=”444” or “555” or “666” then return (Valid), otherwise (Invalid). And if A4=”BB” and B4=”111” or”222” or “333” then return (Valid), otherwise (Invalid) etc....

    I am sorry for not being clear in my previous posts

    Thanks in advance

  7. #7
    Registered User
    Join Date
    12-15-2008
    Location
    Singapore
    Posts
    38
    This is what I've done. See attachment.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-15-2008
    Location
    Singapore
    Posts
    38
    shg why are you a naughty moderator? (Just curious, not trying to embarrass you!)

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    The admin thinks I have a warped sense of humor ...

  10. #10
    Registered User
    Join Date
    12-15-2008
    Location
    Singapore
    Posts
    38
    Oh... btw I like your solution. Mine works but looks crude. Yours is much more elegant. malnahar please ignore my solution.

  11. #11
    Forum Contributor
    Join Date
    02-12-2008
    Location
    Doha-Qatar
    MS-Off Ver
    Excel 2007
    Posts
    137

    Smile

    Thanks a million Shg & ikugos,

    Both are brilliant, Can I not ignore ikugos’ solution
    I will need both solutions

    Best regards and thanks again

+ 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