+ Reply to Thread
Results 1 to 15 of 15

HLOOKUP with 2 lookup values

Hybrid View

  1. #1
    Registered User
    Join Date
    12-22-2017
    Location
    Detroit, MI
    MS-Off Ver
    2016
    Posts
    19

    HLOOKUP with 2 lookup values

    Hello everyone,

    I have a huge list of data with 2 headers (row 1 and row 2). I need help figuring out a formula that will spit out all of the data in a column if it matches row 1 and row 2 criteria. Please see the attached "Test File" for an example of what I need help with. I have created array INDEXMATCH formulas for multi-criteria vertical lookups before, and tried the same thing for horizontal look up, but couldn't figure it out.

    Thank you so much!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,800

    Re: HLOOKUP with 2 lookup values

    Try this:

    =LOOKUP(2,1/(($A$1:$I$1=$M$7)*($A$2:$I$2=$M$8)),$A3:$I3)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-22-2017
    Location
    Detroit, MI
    MS-Off Ver
    2016
    Posts
    19

    Re: HLOOKUP with 2 lookup values

    Quote Originally Posted by AliGW View Post
    Try this:

    =LOOKUP(2,1/(($A$1:$I$1=$M$7)*($A$2:$I$2=$M$8)),$A3:$I3)
    It is giving me an error.

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: HLOOKUP with 2 lookup values

    Try this in M9:

    =IFERROR(1/(1/INDEX(A:I,ROWS($1:1)+2,INDEX(MATCH(M$7&M$8,A$1:I$1&A$2:I$2,0),0))),"")

    Drag down as far as needed.

  5. #5
    Registered User
    Join Date
    12-22-2017
    Location
    Detroit, MI
    MS-Off Ver
    2016
    Posts
    19

    Re: HLOOKUP with 2 lookup values

    Quote Originally Posted by 63falcondude View Post
    Try this in M9:

    =IFERROR(1/(1/INDEX(A:I,ROWS($1:1)+2,INDEX(MATCH(M$7&M$8,A$1:I$1&A$2:I$2,0),0))),"")

    Drag down as far as needed.
    This is also giving me an error. Did it work when you tried it in the Test File?

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,800

    Re: HLOOKUP with 2 lookup values

    Is it? What error?

    It's working here (see attached).
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-22-2017
    Location
    Detroit, MI
    MS-Off Ver
    2016
    Posts
    19

    Re: HLOOKUP with 2 lookup values

    Quote Originally Posted by AliGW View Post
    Is it? What error?

    It's working here (see attached).
    I'm not sure. It shows up as "#NA", I'm guessing there is a problem with the lookup vector, but I can't seem to figure it out.

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: HLOOKUP with 2 lookup values

    You have spaces at the end of the words in row 1. Delete those and both formulas will work fine.

  9. #9
    Registered User
    Join Date
    12-22-2017
    Location
    Detroit, MI
    MS-Off Ver
    2016
    Posts
    19

    Re: HLOOKUP with 2 lookup values

    You are right 63falcondude. It works now. Thanks everyone!!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,800

    Re: HLOOKUP with 2 lookup values

    Yes, that's true - I forgot about the trailing spaces. I had removed them!

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: HLOOKUP with 2 lookup values

    Cant count the number of times I have done that, then forgot to note it here lol
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  12. #12
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: HLOOKUP with 2 lookup values

    Quote Originally Posted by AliGW View Post
    Yes, that's true - I forgot about the trailing spaces. I had removed them!
    Quote Originally Posted by FDibbins View Post
    Cant count the number of times I have done that, then forgot to note it here lol
    Mark that as +1 for me. Meant to make that clear and completely forgot to mention it!

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,800

    Re: HLOOKUP with 2 lookup values

    See post #7.

  14. #14
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: HLOOKUP with 2 lookup values

    You're welcome. Glad we could help!

    Thanks for the rep!

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,800

    Re: HLOOKUP with 2 lookup values

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Need help copying HLOOKUP down entire column of lookup values
    By konatown in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-16-2015, 04:28 PM
  2. [SOLVED] Lookup, VLookup, HLookup
    By jmcole in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-05-2013, 12:00 PM
  3. Lookup where v & hlookup just won't work!
    By Wilgoss in forum Excel General
    Replies: 11
    Last Post: 06-03-2011, 01:49 PM
  4. How to use a lookup, hlookup
    By kryt0n in forum Excel General
    Replies: 5
    Last Post: 06-14-2010, 11:13 AM
  5. Lookup:Vlookup and Hlookup
    By PaxtonK in forum Excel General
    Replies: 2
    Last Post: 03-14-2007, 08:23 PM
  6. HLOOKUP - Adjusting the lookup value...
    By Regnab in forum Excel General
    Replies: 3
    Last Post: 05-22-2006, 06:20 AM
  7. [SOLVED] Multiple lookup values in =HLOOKUP
    By Peter in forum Excel General
    Replies: 1
    Last Post: 09-17-2005, 04:05 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