+ Reply to Thread
Results 1 to 5 of 5

"Multiple joins" in Excel with Vlookup

  1. #1
    Registered User
    Join Date
    08-18-2009
    Location
    Cincinnati
    MS-Off Ver
    Excel 2007
    Posts
    96

    "Multiple joins" in Excel with Vlookup

    I have table column with "Customer Group", "Item", and "Price"

    I have another table that pulls (Customer Group & Item) with a vlookup to get price from this table into another one.

    I concatenate information in a column, and then look up the concatenated value with this:
    =VLOOKUP(B12&E12,I:L,4,0)

    Is there a better way?

    Thank you much,

    Roger!
    Attached Files Attached Files
    Last edited by bluerog; 08-19-2009 at 04:25 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: "Multiple joins" in Excel with Vlookup

    As long as there is one unique combination for each... then you can use this formula:

    =SUMPRODUCT(--(J:J=B10),--(K:K=E10),L:L)
    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
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: "Multiple joins" in Excel with Vlookup

    or
    =INDEX($L$2:$L$27, MATCH(B10 & E10, INDEX($J$2:$J$7 & $K$2:$K$7, 0), 0))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    08-18-2009
    Location
    Cincinnati
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: "Multiple joins" in Excel with Vlookup

    Thank you both. These work great and I don't have to add the dumb concatenated column.

    I am going to pick the brains of NBVC someday and figure out what the "--" really does in Excel. But I need the explanation simplified if possible.

    Somehow you've taken the "SUMPRODUCT" function and made it useful for things other than...well... summing and multiplying.

    You all rule.

    Roger!

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

    Re: "Multiple joins" in Excel with Vlookup

    The "--" is usually called double negative or double unary... it serves to coerce arrays of TRUE/FALSE resulting from the individual conditional checks to 1/0 arrays so that SUMPRODUCT() can do it's math as designed...

    There was a good link at Xldynamic.com that explained it all well, but no longer accessible...

    Many examples exist on the net though if you google Excel and Sumproduct or similar...

+ 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