+ Reply to Thread
Results 1 to 17 of 17

Countif to Count Activities in a time interval on a Specific Date

  1. #1
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Unhappy Countif to Count Activities in a time interval on a Specific Date

    Guys,

    I am a Novice, need you help on the below table. Data Represented from Row A to E and Column 1 to 14.



    TABLE.

    (A) (B) (C) (D) (E)
    (1) Date Start Time End Time Duration Refrence Number
    (2) 21-Dec-11 16:32:05 16:32:07 00:00:02 123456
    (3) 21-Dec-11 16:32:05 16:32:07 00:00:02 123456
    (4) 21-Dec-11 16:32:08 16:32:09 00:00:01 123456
    (5) 22-Dec-11 16:32:05 16:32:07 00:00:02 123456
    (6) 22-Dec-11 16:32:08 16:32:09 00:00:01 123456
    (7) 22-Dec-11 16:32:05 16:32:07 00:00:02 123456
    (8) 22-Dec-11 17:34:37 17:34:38 00:00:01 123456
    (9) 22-Dec-11 17:34:39 17:34:40 00:00:01 123456
    (10) 22-Dec-11 17:34:41 17:34:41 00:00:00 123456
    (11) 23-Dec-11 18:21:43 18:21:44 00:00:01 123456
    (12) 23-Dec-11 18:21:45 18:21:45 00:00:00 123456
    (13) 23-Dec-11 19:02:02 19:02:03 00:00:01 123456
    (14) 23-Dec-11 19:02:03 19:02:04 00:00:01 123456



    What I am looking for is a formula that sorts the data in the below intervals
    So when I type the date in cell "B1" , I want the formula such that "C3" scands the table above for only the selected date and returns me the count of refrence numbers in the corresponding interval.
    EG. "C3" for 21st Dec shoudl give "0" and "C4" should give "4"



    (A) (B) (C)
    (1) ENTER DATE 21-Dec-11

    (2) INTERVAL INTERVAL Count
    (3) 16:00:01 16:30:00 ___
    (4) 16:30:01 17:00:00 ___
    (5) 17:00:01 17:30:00 ___
    (6) 17:30:01 18:00:00 ___
    (7) 18:00:01 18:30:00 ___
    (8) 18:30:01 19:00:00 ___

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Countif to Count Activities in a time interval on a Specific Date

    Hi rajxkumar and welcome to the forum,

    This looks like a Pivot Table answer that is filtered by date and grouped by hour. See the examples. I'm not sure 2003 Excel has the capability to show what is needed, so I've included the .xlsx example also.

    The attach feature of the forum is not letting me give you the example....
    Attached Files Attached Files
    Last edited by MarvinP; 12-27-2011 at 02:21 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

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

    Re: Countif to Count Activities in a time interval on a Specific Date

    With your posted data in a sheet named: MyData
    and
    the analysis on a sheet named: Analysis

    This regular formula begins the list of date/range_activity counts:
    Please Login or Register  to view this content.
    Copy that formula down through C8

    Using your example, the formulas return these values:
    C3: 0
    C4: 3...Note: There are only 3 rows for 21-Dec...so the max count for that date would be 3
    C5: 0
    C6: 0
    C7: 0
    C8: 0

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

  4. #4
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif to Count Activities in a time interval on a Specific Date

    Guys,

    I am extremely thankful to the immediate response i got.
    Excuse me for not being able to understand the excel language.
    I have attached the excel sample herein.
    Sheet - Rawdata is where my data will be entered.
    Sheet named Working in C Column (highlighted in yellow) I need the formula that gives me the count for the already pre defined intervals.
    On this sheet I would only change Cell B1 and the below should populate the refrence data.

    Thanks in Advance.
    Attached Files Attached Files

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Countif to Count Activities in a time interval on a Specific Date

    Hi,

    I was just able to attach my sample file. See if it helps.

  6. #6
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif to Count Activities in a time interval on a Specific Date

    Hi Marvin, I dont think it works on 2003. Did you get a chance to see the sample excel I attached, probably a formula might best suite my need.

    Quote Originally Posted by MarvinP View Post
    Hi,

    I was just able to attach my sample file. See if it helps.

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Countif to Count Activities in a time interval on a Specific Date

    See if you can open this attachment...
    Attached Files Attached Files

  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: Countif to Count Activities in a time interval on a Specific Date

    Using your sample workbook, I entered the formula I posted (adjusted for different ranges and sheet names)
    The new formula, copied down, returns the counts you are looking for.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif to Count Activities in a time interval on a Specific Date

    Marvin, Yes this attachment opened and the function also works. Now how do I get it to show the count at every half hour interval and not hourly as you have. And the mail think, the povit would refrest with new data hence the rouls would add more. Now wouldnt that disturb the grouping. I assume the grouping would only work till the time the data is in the defined selection only.

    Quote Originally Posted by MarvinP View Post
    See if you can open this attachment...
    Last edited by rajxkumar; 12-27-2011 at 02:39 PM.

  10. #10
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Thumbs up Re: Countif to Count Activities in a time interval on a Specific Date

    RON, Thanks a TON !!
    Yup that does it. That exactly how I wanted.
    You guys are wonderful.

    Quote Originally Posted by Ron Coderre View Post
    Using your sample workbook, I entered the formula I posted (adjusted for different ranges and sheet names)
    The new formula, copied down, returns the counts you are looking for.
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Thumbs up Re: Countif to Count Activities in a time interval on a Specific Date

    Thanks RON,

    Thats exactly how and what i wanted.
    You guys are superb.
    Appreciate the value of such forums for amaetures like us.
    You would be seeing more of me now on.


    Quote Originally Posted by Ron Coderre View Post
    Using your sample workbook, I entered the formula I posted (adjusted for different ranges and sheet names)
    The new formula, copied down, returns the counts you are looking for.
    Please Login or Register  to view this content.

  12. #12
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Countif to Count Activities in a time interval on a Specific Date

    I'd create a new column that rounds the minutes to a half hour and use it in my Pivot Table.
    Look at http://www.excelforum.com/excel-gene...half-hour.html or
    http://www.fanhow.com/knowhow:Round_...Excel_34292849

  13. #13
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif to Count Activities in a time interval on a Specific Date

    Thanks Marvin. Still The formula way that Ron suggested works better for me.

  14. #14
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif to Count Activities in a time interval on a Specific Date

    Thanks marvin, however the formula way that Ron shared works best for me.
    Cheers !!
    Quote Originally Posted by MarvinP View Post
    I'd create a new column that rounds the minutes to a half hour and use it in my Pivot Table.
    Look at http://www.excelforum.com/excel-gene...half-hour.html or
    http://www.fanhow.com/knowhow:Round_...Excel_34292849

  15. #15
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Countif to Count Activities in a time interval on a Specific Date

    RON,

    IF you around, using the same formula as below, how could I sum up the value instead of counting it?

    Quote Originally Posted by Ron Coderre View Post
    Using your sample workbook, I entered the formula I posted (adjusted for different ranges and sheet names)
    The new formula, copied down, returns the counts you are looking for.
    Please Login or Register  to view this content.

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

    Re: Countif to Count Activities in a time interval on a Specific Date

    Try this regular formula:
    Please Login or Register  to view this content.
    copied down through C33

    Is that what you need?

  17. #17
    Registered User
    Join Date
    06-25-2009
    Location
    new delhi
    MS-Off Ver
    Excel 2003
    Posts
    10

    Thumbs up Re: Countif to Count Activities in a time interval on a Specific Date

    Thanks Ron, Yup it worked.
    Cheers
    QUOTE=Ron Coderre;2671295]Try this regular formula:
    Please Login or Register  to view this content.
    copied down through C33

    Is that what you need?[/QUOTE]

+ 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