+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Conditional Vlookup

  1. #1
    Registered User
    Join Date
    03-07-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    17

    Conditional Vlookup

    Hi,

    I have an auditing tool that I have created that calculates call rates etc, however I now have to add in a second vlookup, if that is possible.

    Basically if a cell J3=1 then I need the vlookup in cell W3 to look up the first 2 columns (Names is A and Data in B), and if cell J3=2 then I need the vlookup in W3 to select data from the 3rd and 4th column, (Names in F and data in G).

    the current vlookup is = VLOOKUP(N3,A1:B845,2) where N is the column that changes depending on the country etc that I select.

    The names in column 1 and 3 remain constant, but a different value is present for each name depending on the supplier price. I cannot change the names to add something in, as there are over 800 entries at the moment, and this would not be practical.

    please can you help?

    thanks in advance.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional Vlookup

    This is just an IF/THEN....or if W3 is only 1 or 2, a CHOOSE is even better...

    =CHOOSE(J3, VLOOKUP(N3, A:B, 2, 0), VLOOKUP(N3, C:D, 2, 0))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-07-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Conditional Vlookup

    Thanks very much, that worked a treat

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Conditional Vlookup

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ 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