+ Reply to Thread
Results 1 to 5 of 5

Sum of occurrences between date ranges

  1. #1
    Registered User
    Join Date
    10-20-2016
    Location
    israel
    MS-Off Ver
    office 2007
    Posts
    6

    Sum of occurrences between date ranges

    Hi
    I need to summarize the occurrences of some risks according to the time slots below
    a) less that 6 months
    b) more than 6 months but less that 12 months
    c) more than 12 months

    I have a simple excel with a risk level and the number of days open.

    I need a table that surmises the the excel I provided based on the . - I attached a sample too.

    thanks

    David.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Sum of occurrences between date ranges

    I think you mean count rather than sum.

    Also, it looks like your sample has error for Moderate Between 6-12 months. You have 2, but your raw data show only 1 that fall in that range.

    Assumption made: Month = 30 days

    See attached sample. table sheet shows formula approach. pivot sheet shows pivot table based approach.

    Pivot is first created by using # Day Open in row labels and then grouped by 1 to 361 by 180.
    Then grouped field is moved to Columns, Count of ID in value field, Risk in row.
    You can over ride Column labels manually but I left it as is.
    Attached Files Attached Files
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,721

    Re: Sum of occurrences between date ranges

    Assuming you take 180 days as being equivalent to 6 months, put the following formulae in the Table sheet in the cells stated below:

    B2: =COUNTIFS('raw data'!$B:$B,$A2,'raw data'!$C:$C,"<=180")

    C2: =COUNTIFS('raw data'!$B:$B,$A2,'raw data'!$C:$C,">180",'raw data'!$C:$C,"<=365")

    D2: =COUNTIFS('raw data'!$B:$B,$A2,'raw data'!$C:$C,">365")

    then copy the formulae down to row 5.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    10-20-2016
    Location
    israel
    MS-Off Ver
    office 2007
    Posts
    6

    Re: Sum of occurrences between date ranges

    perfect - thanks for your time to reply.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,721

    Re: Sum of occurrences between date ranges

    Not sure who you are replying to, but if that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of any post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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. Counting text occurrences (minus duplicates) in different ranges
    By RnTheAndrian in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-02-2019, 04:47 PM
  2. need help counting occurrences by date
    By tranquil2000 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-23-2018, 10:04 AM
  3. [SOLVED] making all occurrences of a value match the change made in one of those occurrences
    By GAZZYMAN in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 03-23-2017, 10:51 PM
  4. [SOLVED] Formula to count occurrences, multiple ranges, multiple criteria, with wildcard
    By TMMc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2017, 03:27 PM
  5. [SOLVED] Count number of occurrences for a number of ranges from a find loop
    By ANDREWA in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-23-2012, 07:53 PM
  6. Most occurrences in specific date ranges
    By audiofreak in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-21-2012, 02:04 PM
  7. Occurrences of a date in a column
    By Phyllis Blans in forum Excel General
    Replies: 1
    Last Post: 02-10-2005, 04:06 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