+ Reply to Thread
Results 1 to 6 of 6

V-Lookup with 2 options

  1. #1
    Registered User
    Join Date
    05-28-2009
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    40

    V-Lookup with 2 options

    I am wanting to do a V-Lookup but have the option on which varible is used.

    My columns include the building number, address, system, alarm number...

    If the building number is selected through a drop down I want it to autopopulate the address, Commander and Inspector

    If the alarm number is selected through a drop down I want it to autopopulate the building number, address, system, commander and inspector

    The data would be pulled from three seperate sheets

    See the attached example

    Is this something that is doable or can you only autopopulate using only one varible (bldg number)
    Last edited by Huddle; 12-21-2010 at 04:35 PM.

  2. #2
    Registered User
    Join Date
    05-28-2009
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: V-Lookup with 2 options

    Here's the example
    Attached Files Attached Files

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: V-Lookup with 2 options

    You can use VLOOKUPs within an IF function....

    e.g. IF(X1<>"",VLOOKUP(X1,.....),IF(Y1<>"",VLOOKUP(Y1,.....),""))

    this will take X1 as priority.. if it has an entry, then it will use that value and lookup the items as defined by the first Vlookup, otherwise it will look if Y1 has a value, then lookup that based on the 2nd Vlookup parameters... if both X1 and Y1 are blank, then the cell will stay blank.

    Modify to suit.
    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.

  4. #4
    Registered User
    Join Date
    05-28-2009
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: V-Lookup with 2 options

    That works. I used the below formula.
    =IF($C172<>"",VLOOKUP($C172,LookupTbl_Facilities!$A:$H,2,),IF($K172<>"",VLOOKUP($K172,tbl_AlarmAccts!$A:$I,3,)," "))

    One problem I have is if there is an alarm number but not a building number known entering the alarm number fills in the address but I'd like it to autofill the building number from the alarm list.

    If I put a VLookup formula in the building number cell (C172) for this it messes up the other formulas.

    Somehow I think this can be done in the IF statements but I just can't grasp it.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: V-Lookup with 2 options

    If you mean that the building number column can either have a hard coded entry or a formula result, then that cannot be done with native Excel. It is one or the other, or use 2 separate columns.

    If you have to have it in one column, you would be looking into using event macros (VBA).

  6. #6
    Registered User
    Join Date
    05-28-2009
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: V-Lookup with 2 options

    Thanks so much for your help

+ 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