+ Reply to Thread
Results 1 to 5 of 5

HLookup for two rows of values

  1. #1
    Registered User
    Join Date
    09-14-2020
    Location
    London
    MS-Off Ver
    Office 365 Enterprise
    Posts
    88

    HLookup for two rows of values

    Good morning

    I think a HLookup formula would work best in this instance but struggling to get it to work. So, the attached example shows values in row 2 and the value I want returned in cell C5 is the sum of values in row 2 where the reference in row 1 matches the reference in row 4. I have presented the desired results in cells C5:E5 (I've coloured the cells to make it clearer).

    Any assistance would be gratefully appreciated.

    Regards

    Ben
    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 (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,428

    Re: HLookup for two rows of values

    Are you still on Excel 2016?

    In C5 copied across:

    =SUMIF($C$1:$N$1,C4,$C$2:$N$2)

    When there is summing involved, it's SUMIF, SUMIFS or SUMPRODUCT that you will need. This is why your title shoud tell us WHAT you are trying to do, not HOW you think it should be done (which is oftern incorrect).
    Last edited by AliGW; 06-22-2023 at 05:59 AM.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,790

    Re: HLookup for two rows of values

    C5=IF(C$4<>"",SUMIF($C$1:$N$1,C$4,$C$2:$N$2),"")

    Copy across

  4. #4
    Registered User
    Join Date
    09-14-2020
    Location
    London
    MS-Off Ver
    Office 365 Enterprise
    Posts
    88

    Re: HLookup for two rows of values

    Thanks for responding swiftly.

    Yes I am up to date (ish) Excel as have Office 365 for Enterprise and can utilise SUMIFS, etc.

    I've successfully input the formula, so once again thank you.

    Regards

    Ben

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,428

    Re: HLookup for two rows of values

    as have Office 365 for Enterprise
    But you haven't updated your profile, which still says 2016 - please do this NOW.

    Thanks.

    Glad to have helped.

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

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

+ 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. HLOOKUP on multiple rows
    By radma011 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-08-2021, 02:41 PM
  2. HLOOKUP finding rows above lookup value.
    By GPMan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2018, 09:49 AM
  3. [SOLVED] Hlookup with rows (an array)
    By [email protected] in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-03-2015, 02:42 AM
  4. [SOLVED] HLOOKUP cheapest value from multiple rows
    By jamiegfinch in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-01-2014, 10:43 PM
  5. HLOOKUP Multiple Rows
    By njfeathe85 in forum Excel General
    Replies: 6
    Last Post: 08-19-2011, 07:43 AM
  6. hlookup 2 values on 2 rows and sum column
    By dexter87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2011, 09:50 PM
  7. Hlookup failing when inserting new rows
    By churnedprism in forum Excel General
    Replies: 2
    Last Post: 07-19-2010, 10:55 AM

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