+ Reply to Thread
Results 1 to 11 of 11

Sum peak demand for any 7 day period

  1. #1
    Registered User
    Join Date
    05-12-2011
    Location
    Newport RI
    MS-Off Ver
    Excel 2007
    Posts
    6

    Question Sum peak demand for any 7 day period

    I have thirty days worth of customer demand for parts. I would like excel to find the greatest sum during any 7 day period and give me that value in a cell at the end of a row of data that includes blank cells and date gaps.
    Attached Files Attached Files
    Last edited by Sebastion; 05-18-2011 at 09:48 PM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Sum peak demand for any 7 day period

    Why make life hard?
    See Sheet2
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    05-12-2011
    Location
    Newport RI
    MS-Off Ver
    Excel 2007
    Posts
    6

    Lightbulb Re: Sum peak demand for any 7 day period

    Quote Originally Posted by Marcol View Post
    Why make life hard?
    See Sheet2
    This works but I have thousands of rows of data and I would like to keep it to a formula in one column. I have taken your advice but I believe there may be an easier way by using an array and the sumproducts and/or offset functions. Please review my attachement. You got me half way there. I just need a bit more.
    Attached Files Attached Files

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Sum peak demand for any 7 day period

    I can't say I'm bouncing up and down with joy at the prospect of finding a SUMPRODUCT() solution to this problem.

    Try this workbook Sheet3

    This uses only one helper column and two dynamic named ranges.

    1/. Select a product from the drop-down in B2 to get the results for each product.

    2/. Drag down the dates in Column C. (Note the header changes)
    Now add some figures to the column related to the selected part, the data will update in B4 & B6.

    3/. Drag the header in Row 2 right, or add new part names/numbers in G2 to whatever , check the change in the drop-down B2.
    Now select one of the new options in B2 and add some figures to the matching column.

    This has a trade-off, only one part can be displayed at a time, if you want to compare two or three parts it's no big deal to add more helpers and drop-downs.

    If you need to see all the data for all parts at once we are probably talking VBa, possibly as UDFs, let me know and I'll give it a go if necessary.
    This will almost definitly be easier than a SUMPRODUCT()/COUNTIFS() solution.

    A sample of your actual workbook would be an advantage, perhaps for producing a VBa conversion, or a formula based results sheet.

    Let me know what you think.
    Attached Files Attached Files
    Last edited by Marcol; 05-16-2011 at 09:09 AM. Reason: Typo - I dropped the O in COUNTIFS and the forum didn't over-write it with **** !

  5. #5
    Registered User
    Join Date
    05-12-2011
    Location
    Newport RI
    MS-Off Ver
    Excel 2007
    Posts
    6

    Exclamation Re: Sum peak demand for any 7 day period

    I have attached my actual data. The dates across the top are in Julian Date format YDDD. I would like to replace the grand total in the far right column with a formula that will compute the largest quantity ordered in a seven day period so I can ensure I have enough stock on the shelf to support a 7 day replenishment delivery time. Please try to give me a formula that I can put into a cell and replicate to the last record and avoid using VB if at all possible. I really appreciate your help.
    Attached Files Attached Files

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sum peak demand for any 7 day period

    Well, it took me a while, but I think I may have something you can use...

    Using your posted workbook...
    1) I couldn't get my formulas to work with your Julian dates, so I converted them to Excel dates in Row_1.
    2) Since there are gaps in the dates, but the dates are in ascending order, I'm assuming you want to find totals for 7 consecutive dates...not necessarily consecutive cells.
    Example: Jan-01, Jan-12
    Find the total for Jan-01 through Jan-07

    If that's true, this ARRAY-FORMULA, completed by pressing CTRL+SHIFT+ENTER (instead of just ENTER) returns the maximum total for any seven consecutive days.
    Please Login or Register  to view this content.

    Copy that formula and paste into FD4:FD936

    I've attached an edited version of your workbook with those changes.

    Is that something you can work with?
    Attached Files Attached Files
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  7. #7
    Registered User
    Join Date
    05-12-2011
    Location
    Newport RI
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Sum peak demand for any 7 day period

    This is exactly what I was looking for. I just wish I could understand it. What would you call this function? I looked all over the web and couldn't find anything on this. To me it seems like something warehouse managers would be very interested in.

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sum peak demand for any 7 day period

    1) I have no idea what to call it
    2) I've never seen any other formula do the same thing
    3) It took me quite a while to figure out how to build it
    4) Just because I, or anybody else for that matter, "invented" a formula...doesn't mean it hasn't been done countless other times, but nobody knows about it.
    ...That's why I never call a formula "my formula" or "your formula" and I never give or take credit for any formula.
    Perhaps...some people might say they saw it here first.

  9. #9
    Registered User
    Join Date
    05-12-2011
    Location
    Newport RI
    MS-Off Ver
    Excel 2007
    Posts
    6

    Thumbs up Re: Sum peak demand for any 7 day period

    Regardless, I wish I had half of your skills. Thank you very much for the help.
    Last edited by Sebastion; 05-18-2011 at 09:52 PM.

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Sum peak demand for any 7 day period

    Neat one Ron!

    I was still plugging away with my "expanded" worksheets, then the Julian dates appeared, they in short form at least, I find quite ambiguous.
    I simply don't know the variations and conventions for their use/interpretation.

    Several well respected people offer solutions for converting MJD to Gregorian and even they can give conflicting results, albeit slight, but to me any variation makes the whole proposition a bit dubious.

    Must take some time to try understanding this date system.

  11. #11
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sum peak demand for any 7 day period

    Quote Originally Posted by Sebastion View Post
    Regardless, I wish I had half of your skills. Thank you very much for the help.
    Thanks for the kind words.

    FYI: I found some additional efficiencies for the formula I posted.
    They're included in the attached file.

    Ron

    Side note: I sail in Narragansett Bay most weekends during the summer. We're practically neighbors!
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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