+ Reply to Thread
Results 1 to 4 of 4

SUMIF based on multiple successive dates

  1. #1
    Registered User
    Join Date
    05-28-2020
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Professional Plus 16
    Posts
    2

    SUMIF based on multiple successive dates

    Hi all,

    Long-time lurker, first time poster for a problem I'm having trouble solving.

    Background:
    I have a data-set for a year's worth of productions for some 100 products. I've limited the attachment to 2 months.
    The data set contains the date of production, week of production, product code, pcs/pack, type of booking and quantity.
    Even though a production run can last for multiple days, system limitations generate a new production order for each day given a distorted overview of the number of production runs and the run size if I use this as a criteria for my sumif and countif formula. If I use the weeknumber as a criteria, I have problems with runs which happen during the transition from one week to the other.
    As an added complexity, there are corrections on the production orders output which might happen days later.

    Possible workaround:
    If there is a product of which there is an output during successive dates, logic determines that this was 1 production run.
    • How to code the criteria in the sumifs function to sum up the productions of the same product code of successive dates?
    • How to avoid having duplicates using this way of working?
    • How to integrate the required corrections on the production orders?

    Another approach generating the same results is of course welcome as well, as is pointing me in the right direction with similar questions from the past. (Haven't been able to find them yet)
    Hopefully the knowhow here limits the ever increasing bald spot on my head that was creating from scratching my head trying to resolve this issue.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUMIF based on multiple successive dates

    So, not sure if I fully understand but, if you can sort your data this would allow to (potentially) add a basic Boolean test, for use in subsequent SUMIFs or a Pivot (as a Page filter)

    e.g. sort by Product Order, Type & Date -- then:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    so, for PO19/001890 you would get Output of 118,800 (i.e. the 408 entry would be FALSE), and the Correction of -264

    if the above is correct, but you want to achieve the same thing without the sort it will be a little more expensive, computationally, especially with big datasets.

    alternatively you might consider using Power Query.

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUMIF based on multiple successive dates

    @Ramsel, apologies, my prior suggestion requires a correction, assuming I followed the required logic in the first instance of course !

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-28-2020
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Professional Plus 16
    Posts
    2

    Re: SUMIF based on multiple successive dates

    Thanks Xlent.
    Believe you might have pointed me to the right approach using a Boolean test.
    Will have to sort by product code instead of production order to avoid problems as below where the same product code produced on the same day was logged under 2 different production orders.
    In reality this will have been 1 production run.

    Date Week Product code Pcs/Carton Production order Type Quantity
    11/05/2019 19 605603 12 PO19/003153 Output 66.240
    11/05/2019 19 605603 12 PO19/003154 Output 27.252

    Will check if I can build on this approach, possibly using duplicate data sets sorted differently depending on the sumif-criteria I require.

+ 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. Replies: 1
    Last Post: 05-12-2017, 02:53 AM
  2. Macro or rule to color fill an entire row based on successive dates within data
    By ferretdance03 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2013, 02:20 PM
  3. Based on previous and successive values, create rolling sum
    By mastro78 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2012, 02:04 PM
  4. [SOLVED] sumif based on dates
    By holycowbanana85 in forum Excel General
    Replies: 3
    Last Post: 07-23-2012, 01:46 PM
  5. [Solved] SUMIF based on dates (month)
    By Russell719 in forum Excel General
    Replies: 4
    Last Post: 10-19-2010, 01:30 PM
  6. Autofill dates in successive worksheets
    By maui1girl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2007, 11:41 AM
  7. Combining Totals on Successive Rows Based on Two Criterion
    By razorsharpe in forum Excel General
    Replies: 1
    Last Post: 08-18-2006, 10:30 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