+ Reply to Thread
Results 1 to 5 of 5

conditional vlookup

  1. #1
    Registered User
    Join Date
    03-18-2009
    Location
    West Midlands, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    conditional vlookup

    First post, so hopefully this is the right place for the answer!

    I currently use VLOOKUP to return a value from other spreadsheets.

    However, I need Excel to firstly check the contents of a particular cell, and then decide which spreadsheet to look up.

    So, for example if the vaule in cell C3 = 1 then VLOOKUP spreadsheet "ABC", if value in cell C3=2 then VLOOKUP spreadsheet "XYZ" and so on.

    Any ideas?
    Last edited by NBVC; 03-18-2009 at 12:46 PM.

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

    Re: conditional vlookup

    Are the values is C3 actually literally, 1, 2 or 3, etc.... or is it other label?

    If so, we can use the Choose() function to determine which sheet to look up...else we will need a nested IF().
    Last edited by NBVC; 03-18-2009 at 08:56 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
    03-18-2009
    Location
    West Midlands, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: conditional vlookup

    hi, the values can be whatever I want them to be - they could be numerical or text.
    thanks.

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

    Re: conditional vlookup

    In that case....

    =IF(C3="Value1",Vlookup(..in sheet1),if(C3="Value2",Vlookup(....in sheet2),Vlookup(...in sheet3)

    "Value1" is in double quotes if it is a text string and not in quotes if it numeric

  5. #5
    Registered User
    Join Date
    03-18-2009
    Location
    West Midlands, England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: conditional vlookup

    thanks very much for that, it has done the trick.
    Last edited by yogi150871; 03-18-2009 at 10:14 AM. Reason: 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