+ Reply to Thread
Results 1 to 10 of 10

Creating a three way lookup with columns and row lookup matches

  1. #1
    Registered User
    Join Date
    07-14-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    9

    Creating a three way lookup with columns and row lookup matches

    Hello,

    I'm trying to create a lookup/match function that displays a value if certain criteria are met/matched.
    Capture.JPG

    What I want is to be able to enter a formula under Price (D) that will match the Hour (C) and Date (B) and Name (A) to the index table from (F) to (K) and pull in the value for that Day/Hour/Name.
    For example, the formula in (D,2) would pull in the Price of 8 for December 17, 2014, Hour 1 and the A name.

    Is this possible?

    Thanks for the help!
    Attached Files Attached Files

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: Creating a three way lookup with columns and row lookup matches

    Put in D2
    =INDEX($H$3:$K$10,MATCH(1,($F$3:$F$10=$B2)*($G$3:$G$10=$C2),0),MATCH($A2,$H$1:$K$1,0))

    and press CTRL+SHIFT+ENTER button together (array formula) and then copied down
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-14-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    9

    Re: Creating a three way lookup with columns and row lookup matches

    Thanks for the quick response! This works, but I forgot to mention that the original file is a bit different. Basically, the Names and Hour formats don't match between the lookup values and the index values, and it is not time worthy to make them match (this is a changing file) so there needs to be some sort of match/vlookup built in as well (I think that's what it needs)? Here is a more accurate picture of what I'm working with:
    Capture2.JPG
    Is there any way to make this work so that the Names don't have to be identical (the formula would look it up and match it to the correct one) and the Hour formats as well?


    Thanks again and sorry for leaving this out of the original post!

  4. #4
    Registered User
    Join Date
    07-14-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    9

    Re: Creating a three way lookup with columns and row lookup matches

    Thanks for the quick response! This works, but I forgot to mention that the original file is a bit different. Basically, the Names and Hour formats don't match between the lookup values and the index values, and it is not time worthy to make them match (this is a changing file) so there needs to be some sort of match/vlookup built in as well (I think that's what it needs)? Here is a more accurate picture of what I'm working with:
    Capture2.JPG
    Is there any way to make this work so that the Names don't have to be identical (the formula would look it up and match it to the correct one) and the Hour formats as well?


    Thanks again and sorry for leaving this out of the original post!

  5. #5
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: Creating a three way lookup with columns and row lookup matches

    Ok fix it, but Im confused, you have duplicates dates and hours in data table, what exactly your wanted results? My formula just return the first match, not second or third and so on.

    Regards
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-14-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    9

    Re: Creating a three way lookup with columns and row lookup matches

    Ok. Your formula worked perfectly! The only problem was that it only worked for one day's worth of data when I tried to drag it down in my original file...

    I've updated the spreadsheet and basically how the document works is that on the 'Paste' tab, new data comes in on a daily basis for every hour of the rolling last 7 days (I've shortened it to 2 days in the file, and sometimes it will be up to 31 days). The 'Upload' tab then needs to look up and bring in the correct price from the 'Paste' tab based on the day/hour/name matching between the two tabs. The 'Lookup' tab is used to match the names and hour formats that are on the 'Paste' tab to the ones that are on the 'Upload' tab because the names aren't exact matches (it's to much work to change all of them to match) and the hour formats aren't the same (can't change these because of the data source).

    The last thing is that if there is a blank price/day in the 'Paste' tab, it owuld be nice if the 'Upload' tab returned a blank instead of a N/A value.


    Once again, thank you very much for the help and sorry for my lack of proper explanation!
    Attached Files Attached Files

  7. #7
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: Creating a three way lookup with columns and row lookup matches

    Check this out, hope this works

    Cheers
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-14-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    9

    Re: Creating a three way lookup with columns and row lookup matches

    Thanks you very much! This is perfect!

  9. #9
    Registered User
    Join Date
    07-14-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    9

    Re: Creating a three way lookup with columns and row lookup matches

    Sorry... one more "issue". If there is no data in the Paste tab for the price, is there a way for the formula to leave it blank on the Upload tab instead of insert a 0?

    Thanks again!

  10. #10
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: Creating a three way lookup with columns and row lookup matches

    Yes possible but longer formula :

    =IF(INDEX(Paste!$C$3:$F$50,MATCH(1,(Paste!$A$3:$A$50=$B2)*(Paste!$B$3:$B$50=INDEX(Lookup!$E$2:$E$25,MATCH($C2,Lookup!$D$2:$D$25,0))),0),MATCH(INDEX(Lookup!$B$2:$B$5,MATCH($A2,Lookup!$A$2:$A$5,0)),Paste!$C$1:$F$1,0))=0,"",INDEX(Paste!$C$3:$F$50,MATCH(1,(Paste!$A$3:$A$50=$B2)*(Paste!$B$3:$B$50=INDEX(Lookup!$E$2:$E$25,MATCH($C2,Lookup!$D$2:$D$25,0))),0),MATCH(INDEX(Lookup!$B$2:$B$5,MATCH($A2,Lookup!$A$2:$A$5,0)),Paste!$C$1:$F$1,0)))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  2. [SOLVED] Multiple lookup adding columns, then multiplying, then lookup, add, and subtract
    By mamig in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-08-2013, 12:55 AM
  3. Replies: 7
    Last Post: 06-19-2011, 12:51 PM
  4. Lookup several possible matches
    By Jasonr in forum Excel General
    Replies: 2
    Last Post: 12-06-2010, 09:56 AM
  5. Lookup adjacent column to multiple lookup columns.
    By JAMES4228 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-13-2009, 03:19 PM

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