+ Reply to Thread
Results 1 to 4 of 4

Using SumIf to create monthly total. Qty and Date next to each other on row.

  1. #1
    Registered User
    Join Date
    01-22-2019
    Location
    Toronto, Canada
    MS-Off Ver
    MS 2013
    Posts
    2

    Using SumIf to create monthly total. Qty and Date next to each other on row.

    Hello,

    I have an interesting challenge which I am unable to solve.

    My data runs across (attached data set larger in attached file).

    Data Below

    123ABC-ZZ 10 2/13/2019 10 2/20/2019 30 2/27/2019 50 3/13/2019 20 3/27/2019 30
    456DEF-ZZ 30 2/13/2019 30 2/20/2019 20 2/27/2019 20 3/6/2019 10 3/13/2019 30 100 1/4/2020 50 2/14/2020

    Output I require:

    Jan-19 Feb-19 Mar-19 Apr-19 May-19 Jun-19 Jul-19 Aug-19 Sep-19 Oct-19 Nov-19 Dec-19 Jan-20 Feb-20
    123ABC-ZZ 50 70
    456DEF-ZZ 80 70 100 50


    Example.PNG

    Results can be set up in a different tab. I can also setup template of numbers to drive results on row. I just can't figure out how to total the quantities next to the date into one cell.

    Thank you in advance,
    Joe
    Attached Files Attached Files

  2. #2
    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
    52,936

    Re: Using SumIf to create monthly total. Qty and Date next to each other on row.

    1st, I would have set that table up going down, not across - there are far more rows than columns, and it is easier to calc that way.

    Try this, copied across and down as needed...
    =SUMIFS($E2:$AY2,$F2:$AZ2,">="&F$10,$F2:$AZ2,"<="&EOMONTH(F$10,0))
    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

  3. #3
    Registered User
    Join Date
    01-22-2019
    Location
    Toronto, Canada
    MS-Off Ver
    MS 2013
    Posts
    2

    Re: Using SumIf to create monthly total. Qty and Date next to each other on row.

    Good morning Ford,

    Thank you very much for your quick reply and solution. I really appreciate your expertise and help.
    It works perfectly based on my sample data and thank you for the suggestion regarding the setup of raw data.
    Unfortunately, the raw data out is provided in this manner across rather than down.

    I will take a closer look at the formula to better understand it so I can use it for future scenarios.

    In the meantime, I can work with the data based on your solution.
    Thank you again very much!
    Have a great day and week ahead,
    Joe

  4. #4
    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
    52,936

    Re: Using SumIf to create monthly total. Qty and Date next to each other on row.

    Joe, happy to help and thanks for the feedback

    1st, the syntax for SUMIFS (I could have used SUMIF) is
    =sumifs(range-to-sum, criteria-range1, criteria1, criteria-range2, criteria2..............)

    I presume that your file will grow over time?

    If you look closely, you will see that I offset some ranges by 1 column.
    =SUMIFS($E2:$AY2,$F2:$AZ2,">="&F$10,$F2:$AZ2,"<="&EOMONTH(F$10,0))

    This is so that it picks up the dates from 1 range, and the sum data from a slightly different (but still the same size) range.

    Then I threw in a EOMONTH() formula, which, as you figured, returns the end-on-month date for any date chosen. The 0 at the end allows you to add months (1, 2 etc) or go back months (-1, -2 etc)

    Hope that helps?

+ 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] Total monthly cost calculated based on start and end date
    By NS4Excel1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-02-2018, 02:17 PM
  2. Replies: 8
    Last Post: 12-20-2015, 11:46 PM
  3. Monthly total values for date-sorted data
    By LCNxls in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-19-2014, 12:26 PM
  4. Total Monthly Hours from a date range rollup
    By crab007 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-25-2012, 06:14 AM
  5. [SOLVED] Linking a monthly total to the last date of each month
    By bite_tony in forum Excel General
    Replies: 3
    Last Post: 04-24-2012, 08:21 AM
  6. Attributing Monthly Total to Date Ranges
    By MikeMc79 in forum Excel General
    Replies: 3
    Last Post: 02-06-2012, 01:33 AM
  7. Need to save Running Total and generate Weekly and Monthly Report based on date
    By soready42012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-04-2012, 09:10 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