+ Reply to Thread
Results 1 to 14 of 14

Sum a range of cells using HLookup or VLookup, sumifs

  1. #1
    Registered User
    Join Date
    02-07-2020
    Location
    los angeles
    MS-Off Ver
    Office Professional
    Posts
    7

    Unhappy Sum a range of cells using HLookup or VLookup, sumifs

    Hello,

    I am having trouble finding a formula that will sum a range of cells based on a date value that is looked up by HLookup. I need the trailing twelve month values inlcuding this value summed.

    I have years worth of financial date that is sorted in columns by month and year. I want to be able to look up month and year and have the the twelve months prior this date including this date summed. I know I can do a HLook up based on the month and year which will pull up only one value for that month and year instead of adding the trailing twelve month values.
    To clarify, i don't need the formula to search for sales and expenses texts in the table. I want the formula to match the dates and sum based on the date info.

    I am attaching a picture as an example, a worksheet and a worksheet with the results I want automated hardcoded.

    Thank you in advance.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by ExcelNewbie2020; 02-07-2020 at 02:59 AM.

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

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    Attach the file. Not an image

  3. #3
    Registered User
    Join Date
    02-07-2020
    Location
    los angeles
    MS-Off Ver
    Office Professional
    Posts
    7

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    Thank you for the response. i just added the worksheet sample.

  4. #4
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,819

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    In G13 copied across and down:

    =INDEX($G$4:$X$5,MATCH(MID($F13,FIND(" ",$F13)+1,99),$F$4:$F$5,0),MATCH(G$12,$G$3:$X$3,0))
    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.

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,819

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    Or maybe you mean this:

    =SUMPRODUCT(($F$4:$F$5=MID($F13,FIND(" ",$F13)+1,99))*($G$3:$X$3 > =$G$12)*($G$3:$X$3 < EDATE($G$12,COLUMNS($G13:G13)))*$G$4:$X$5)

  6. #6
    Registered User
    Join Date
    02-07-2020
    Location
    los angeles
    MS-Off Ver
    Office Professional
    Posts
    7

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    Hi Ali. That formula did not give me the sum of the twelve months prior. It seems as its giving me only one of the values

  7. #7
    Registered User
    Join Date
    02-07-2020
    Location
    los angeles
    MS-Off Ver
    Office Professional
    Posts
    7

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    Didnt work either.

  8. #8
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,819

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    It works here. Perhaps if you provide a workbook with expected results manually entered? Then we might have a clue what you are trying to do.

    Good luck - I have to go off to work now.

  9. #9
    Registered User
    Join Date
    02-07-2020
    Location
    los angeles
    MS-Off Ver
    Office Professional
    Posts
    7

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    thanks. uploaded worksheeet with the answers hardcoded.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    This returns what your sample results wb shows. In G13 filled down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 02-07-2020 at 01:22 PM. Reason: detail needed
    Dave

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    This also in G13 filled down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    02-07-2020
    Location
    los angeles
    MS-Off Ver
    Office Professional
    Posts
    7

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    Quote Originally Posted by FlameRetired View Post
    This returns what your sample results wb shows. In G13 filled down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave,

    You solved my problem that took me hours with no luck! Thank you so much. I'm not even going to ask how you figured this out but thanks a million.

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    You are welcome. Glad to help. Thank you for the feedback and added rep.

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

  14. #14
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sum a range of cells using HLookup or VLookup, sumifs

    Or in G13 copied right
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In G14 Copied right
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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. [SOLVED] hlookup or match formula to return a range of cells
    By spittingfire in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2019, 05:14 PM
  2. Using SUMIF (or SUMIFS) with HLOOKUP
    By rmj6h in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-26-2019, 11:27 PM
  3. SUMPRODUCT for all cells with VLOOKUP or IF or SUMIFS
    By krishkarthik in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 07-28-2018, 04:22 PM
  4. HLOOKUP to copy range of cells in column found
    By Simon.xlsx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-08-2018, 06:16 AM
  5. [SOLVED] Vlookup + Sumifs based on date range
    By the-analyst in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-02-2015, 06:00 AM
  6. sumifs hlookup using index and Match
    By alexcrofut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-23-2014, 06:09 PM
  7. sumifs/hlookup
    By mickeygoldsmith in forum Excel General
    Replies: 49
    Last Post: 11-29-2010, 05:11 PM

Tags for this Thread

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