+ Reply to Thread
Results 1 to 8 of 8

Nesting VLOOKUP function

  1. #1
    Registered User
    Join Date
    02-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Nesting VLOOKUP function

    It has been a few years since I have worked with EXCEL but my new job requires everything be done this way, so I am shaking off the rust! I am working on a multi page workbook and am doing a summary sheet. I have created 2 columns that return the two sets of values I need to compare using IF functions. I now need to create a cell that will look at the first column and perform a VLOOKUP if there is a value, and if not then move on to the second column and perform a VLOOKUP if there is a value there. Each VLOOKUP will be to a different sheet in the workbook, and I need to include an =IF(ISNA at the beginning to return nothing if they are empty. Can anyone help me with this?

  2. #2
    Registered User
    Join Date
    02-26-2013
    Location
    Burlington, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Nesting VLOOKUP function

    Hi Did you figure this out? I am trying to do the same thing but with 3 columns of data to lookup.

  3. #3
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Nesting VLOOKUP function

    Assuming your first column is A, your second column is B, and you are in row 2, would this work?

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please click the * icon below if I have helped.

  4. #4
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Nesting VLOOKUP function

    The following should also work:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Nesting VLOOKUP function

    VLOOKUP_Help.xlsxHi,

    I've created an example which I think does what you are after. For the purpose of ease i made two tables called sheet 1 and sheet2 to represent data that would be in different sheets on your spreadsheet.

    The blue table has two columns looking up values and a third column which does what you have asked for (four columns if you include the 1st column with the vlookup value). You will need to edit this so that the "FIRST" and "SECOND" parts of the formula are replaced with the final vlookup you want to do.

    The green table is the same but the first vlookups are now included in the IF formula, this is cleaner from a visual point of view if you do not need to have the results of the first two vlookups visible (or you could just hide the columns).

    Hope this does what you want/makes sense!
    Say thanks, click *

  6. #6
    Registered User
    Join Date
    02-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Nesting VLOOKUP function

    Melvinrobb,

    I tried this but get a REF error, not sure what I am doing wrong......

  7. #7
    Registered User
    Join Date
    02-26-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Nesting VLOOKUP function

    Let me give a little more information:

    I am looking up product codes for different products on two separate sheets, one is always "STLxxx" and the other is always "SITxxx". My IF function for column A is =IF(ISERROR(SEARCH("STL",'Product A'!B13,1) ),"",'Product A'!B13)and for column B is =IF(ISERROR(SEARCH("SIT",'Product A'!B13,1) ),"",'Product A'!B13). On the Product A form it lists the items in the same column but in no particular order. I am needing to now look at column A and if there is a STL code use it to do a VLOOKUP to another sheet to give me a price, if not then look at column B for a SIT code and do the same. Is everyone confused now? I know I am!

  8. #8
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Nesting VLOOKUP function

    Try this assuming you are in row 1:

    Please Login or Register  to view this content.
    Replace FIRST with the vlookup you need to do if Column A has a value and SECOND with the vlookup formula you need to do if Column B has a value.

+ 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