+ Reply to Thread
Results 1 to 5 of 5

count the number of events in an interval

  1. #1
    Registered User
    Join Date
    04-04-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    17

    count the number of events in an interval

    Hi All,

    After trying a chain of unsuccessful, CountIF(AND()) type nested formulas, decided to ask here as couldn't get my head around.

    I have two excel worksheets WS1 and WS2 in a workbook.

    On WS1, I have a list of intervals with 3 columns, A:interval ID, B:intervalBegin C:intervalEnd. Each row is an interval.
    On WS2, I have a list of events with 2 columns; A:eventID B:eventTime. each row is an event
    All times are in dd/mm/yyyy hh:mm:ss format.

    I want to count how many events from WS2 occurred for each interval of WS1.

    I will really really appreciate a quick response... Thanks in advance.
    Last edited by invictus; 06-11-2012 at 05:56 PM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: count the number of events in an interval

    In that case you better added an example of your workbook (without confidential information).

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,466

    Re: count the number of events in an interval

    With Excel 2010, you should be able to use COUNTIFS.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: count the number of events in an interval

    invictus,

    I think what you're looking for is the Countifs() function (Excel 2007 and higher only)
    Attached is an example workbook based on the criteria described. In sheet 'WS1' cell D2 and copied down is this formula:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    04-04-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: count the number of events in an interval

    That's brilliant tigeravatar! Thanks a million and for the example!

    This CountIFs will be pretty useful since I was failing these type of multiple comparison.
    Thanks for the quick responses folks!

+ 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