+ Reply to Thread
Results 1 to 4 of 4

Match multiple columns to bring back one result

  1. #1
    Registered User
    Join Date
    08-09-2011
    Location
    Noblesville, IN
    MS-Off Ver
    Excel 2007
    Posts
    14

    Match multiple columns to bring back one result

    I'm trying to expand a Vlookup by not comparing just one colomn of data in two different spreadsheets, but I need to EXACTLY match 3 columns of data.

    I need to match: Manufacturer, Location and Item Number in both spreadsheets and then if they all match, I need to bring back the Invoice Amount from the second spreadsheet.

    Thanks for any help!
    Last edited by amyj22x3; 08-22-2011 at 01:03 PM. Reason: Reworded and titled, the first question I asked was misleading.

  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: Match multiple columns to bring back one result

    To use VLOOKUP for this, the values searched would have to all be in one column in the far left column of the table. So insert a new blank column A and create an "index" in that column using something like this... in A2, then copied down:

    =B2 & "-" & C2 & "-" & D2

    Of course you'll have to match the correct columns to get the key to format properly as Manufacturer-Location-Item Number.

    Then you can use a Vlookup in your other sheet normally. You'll use the same technique to create the first parameter lookup value:

    =VLOOKUP(A2 & "-" & B2 & "-" & C2, Sheet2!$A:$Z, 4, 0)

    The red parameter is the column that you'll get an answer back, adjust as needed.
    _________________
    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
    08-09-2011
    Location
    Noblesville, IN
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Match multiple columns to bring back one result

    I've just stumbled across an Index / Match formula that seems like it could work, but I can't quite figure it out. I don't have to use a Vlookup, I was just saying that to give an idea of what I'm trying to do.

    How would I write the Index or Match formula to bring back the results I need?

    Thanks,

    Amy

  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: Match multiple columns to bring back one result

    The "match" part of an INDEX/MATCH is basically the same issue as with a VLOOKUP. Since your match values are in separate columns, I would create a new column in the data to do this match.

    The benefit of an index/match is that you could put this new column out to the far right, or anywhere, actually. VLOOKUP requires the key column be on the left.

    So, same idea, for an index match, create a key column off to the right somewhere, perhaps in AA2:

    =B2 & "-" & C2 & "-" & D2

    ...then copied down the data set.

    Then INDEX the column you want info from, and MATCH to the new column in AA:

    =INDEX(Sheet2!E:E, MATCH(A2 & "-" & B2 & "-" & C2, Sheet2!$AA:$AA, 0))

+ 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