+ Reply to Thread
Results 1 to 10 of 10

Dynamic Cumulative in a Range

  1. #1
    Registered User
    Join Date
    05-04-2017
    Location
    Toronto, Canada
    MS-Off Ver
    excel 2010
    Posts
    11

    Exclamation Dynamic Cumulative in a Range

    Hi guys,

    I am trying to use a formula or I may need to create a macro to help me solve this problem but here goes:

    I have a dataset that has products sold by date. Each product has a different delivery day and as a result I need to calculate the number of products sold in between the delivery dates. E.g. the delivery date is Monday and therefore need to calculate how many products were sold between the two Monday's. I wanted to know if there was a formula that would detect the delivery days and than calculate the sum between the two days. I have one table with the sales per day over a two week period and than another table with 1's on the day of delivery but I'm stuck on how to construct the formula.

    Thanks guys

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Dynamic Cumulative in a Range

    From the description, it sounds like SUMIFS would work for you. We could do better if we had a sample workbook to look at.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    05-04-2017
    Location
    Toronto, Canada
    MS-Off Ver
    excel 2010
    Posts
    11

    Re: Dynamic Cumulative in a Range

    Sorry I should have attached an example. I have attached an example that outlines what I am trying to do along with the desired results.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: Dynamic Cumulative in a Range

    This proposed solution adds a helper table (AK:AX) populated by the array entered formula*:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The array entered formula* that populates column S (sold) is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    *Array entered formulas are activated by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Note: The conditional formatting applied to the helper table is not needed, however it may help to explain from where the numbers come, as in:
    Green -- Sales table
    Blue -- Sales table corresponding to values of one on the Delivery Schedule table
    Pink -- Delivery Schedule table
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    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: Dynamic Cumulative in a Range

    excelnewbie2407 welcome to the forum.

    Without some data reference to tell what day(s) (see Items 3 and 5) are relevant I don't see how a formula will accomplish what you describe.

    Can you tell us what the determining facts are that lead you to choose those particular days or supply a lookup table enabling a match of the criteria?
    Dave

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Dynamic Cumulative in a Range

    I don't really see what the overall objective is. I get the concept that you want to see if production is in line with sales. But how does limiting the sales between delivery dates accomplish this? There is also an ambiguity here. I see a production figure but I don't know what it represents. Is that per month, per week or some other time period?

    Also where do you define the delivery dates? Is it in another table somewhere?

    If I had this data, I would ignore the delivery dates - you are not associating a quantity with the delivery anyway. I'd use the whole range to get the two-week total for sales and see how that stacks up against the two-week production numbers.

    The data are somewhat "lumpy" (some days you have no sales and others you have 20) so using weekly or bi-weekly totals smooths out some of the lumps. I'd also keep a history to see if there are any trends or if the data are seasonal. I might also look for "internal" trends such as sales by day of week - this may impact on when I schedule my deliveries. Heavy weekend sales may make a Friday or Monday delivery desirable depending on the nature of the product (perishable - I want it on Friday to have as much fresh, on hand for the weekend : non-perishable I want it on Monday to resupply myself for the rest of the week.)

  7. #7
    Registered User
    Join Date
    05-04-2017
    Location
    Toronto, Canada
    MS-Off Ver
    excel 2010
    Posts
    11

    Exclamation Re: Dynamic Cumulative in a Range

    Hey Dflak,

    Maybe I should clarify the objective and I have also attached a new document hoping you could understand what I am trying to achieve.

    We are currently producing items at our warehouse and shipping them to our stores hence the sporadic sales as you mentioned. What we are trying to achieve is to determine if :

    1) Are we overproducing/under producing for each item. We found the best way to determine this is to see how many sales are happening in between delivery days to see if we have enough stock in stores since our shelf life is just enough for delivery days.
    2) Are we sending shipments on the right days or do we need to change days, this is something that will happen down the road not right now.

    What I'm looking for is a formula that will pick up the the shipment days for each item, each item is linked with a unique code, and than look at the sales table and calculate how much we sold, which I can then compare with an arbitrary production schedule that has no change week over week for now.

    I am hoping this clarifies everything!

    Also thank you to everyone who has helped me so far, your help is greatly appreciated!
    Attached Files Attached Files

  8. #8
    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: Dynamic Cumulative in a Range

    I am still not sure I have the concept. Try this formula (in column T(?))
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Are these the numbers you expect?
    Last edited by FlameRetired; 05-09-2017 at 04:59 PM.

  9. #9
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Dynamic Cumulative in a Range

    Now I am catching it. Is the data you presented just for one week or is it an accumulation of weeks. I would suggest getting a quarter's worth of data for the sales. This means 13 data points for each day of the week which should be enough to do fairly accurate trending. You can find the mean (average) and standard deviation and then apply statistics so you can have a 90% confidence level or 95% confidence level or whatever you are comfortable with that you will deliver the right amount of product for the day of the week.

    You can develop profiles for each product and sort them by day of the week requirements. For example Item 1 may peak on Tuesdays and Fridays and Item 2 on Monday and Friday and Item 3 on Tuesday only. You can group products by day of the week and back track for lead time. I notice that some items require packing while others don't. This sorting can be done on a "heuristic" based on what percentage of sales occurs on a given day. You may determine that 33% or better of sales on a given day warrants a delivery on the previous day. If nothing breaks the 33% line then the date with the highest percent prevails. If it's a virtual tie, go with a day that has deliveries but the least amount of deliveries.

    There will be some manual tweaking as you shift things around.

    In any event, we need more than one week's worth of data to feel confident about this.

  10. #10
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Dynamic Cumulative in a Range

    Here is a rough idea of what I described above. I have a lot of helper columns here.

    Column R finds the biggest value for the week.

    Column S is the day of the week associated with this value.

    Column T is the second largest value.

    Column U is the day of the week associated with this value.

    Column V is the total number for the week.

    Column W is for you to fill out. For example, The best days for delivery for Item 1 are Friday and Saturday. It doesn't make much sense to deliver on two consecutive days, so roll them both into Friday. Item 2 indicates Tuesday and Saturday. You will have to make a judgement call based on Columns S and U.

    Column X and Y and Z and AA are used to split the deliveries based on what percentage of sales occur on those days. Column Y is the amount to deliver on the smaller of the days. Column X is the amount to deliver on the bigger of the days (everything that isn't delivered in the other delivery). if there is only one delivery, deliver the total on that day,.

    I can see one tweak to add. For the last item on the list, there is a tie for the day with the most sales. The current model finds the first occurrence. The model has to be modified that in the case of a tie, the second delivery day is based on the second occurrence of the value. I'm not doing that now.
    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)

Similar Threads

  1. Self changing dynamic cumulative total
    By vinzo1309 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-20-2016, 12:23 PM
  2. Dynamic cumulative sum formula (?!)
    By WineFerret in forum Excel General
    Replies: 4
    Last Post: 05-13-2016, 07:49 AM
  3. [SOLVED] Calculate cumulative depreciation over time with a dynamic column range
    By jeremylittman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-07-2015, 09:50 PM
  4. Match ComboBox with dynamic range, then add Textbox1 to dynamic range
    By Lasse Moe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2014, 01:26 AM
  5. [SOLVED] Dynamic cumulative SUM RANGE - different months
    By epsiloni in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-15-2013, 11:36 AM
  6. Replies: 8
    Last Post: 12-06-2013, 01:42 PM
  7. Highlight a sorted cumulative range
    By juniperjacobs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-20-2011, 06:18 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