+ Reply to Thread
Results 1 to 7 of 7

Countifs and time

  1. #1
    Registered User
    Join Date
    06-30-2018
    Location
    Denmark
    MS-Off Ver
    2013
    Posts
    44

    Countifs and time

    Thank you all :-)
    Attached Files Attached Files
    Last edited by Vibov; 07-20-2021 at 07:13 AM.

  2. #2
    Registered User
    Join Date
    07-16-2021
    Location
    Centurion, South Africa
    MS-Off Ver
    2019
    Posts
    9

    Re: Countifs and time

    Hi,

    You need to use something like this =COUNTIFS($B$3:$B$400,">="&$D$3,$B$3:$B$400,"<"&$E$3)

    Use ">="&FROM_TIME and "<="&TO_TIME as criteria in the COUNTIFS function

    Good luck,
    Johann

  3. #3
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2019
    Posts
    4,542

    Re: Countifs and time

    Cell I2: =COUNTIFS($D$2:$D$25,">="&INT(D2)+TIMEVALUE(LEFT(H2,5)),$D$2:$D$25,"<"&INT(D2)+TIMEVALUE(RIGHT(H2,5))), copy down.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Countifs and time

    1. add a helper column (I used F, and you can hide this column if you want)to break out just the time from your date/time column (you could do the whole count in just the 1 cell, but this way is easier to understand and trouble-shoot)

    F2=MOD(D2,1)
    copied down

    2. Split your to and from times into separate cells (I used J and K), then this becomes simple.

    then for the extract...
    I2=COUNTIFS($F$2:$F$19,">="&J2,$F$2:$F$19,"<"&K2)
    copied down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    06-30-2018
    Location
    Denmark
    MS-Off Ver
    2013
    Posts
    44

    Re: Countifs and time

    Thanks FDibbins Itīs works perfect, only one problem is that one record seams missing. Believe itīs the format of time but how to find the missing one without going through 900 records?
    Attached Files Attached Files

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

    Re: Countifs and time

    If you change the formula in I3 to this:

    =COUNTIFS($F$2:$F$79993,">"&K2,$F$2:$F$79993,"<"&K3)

    and copy down it will give you the correct total. the difference occurs in the range 14:00 - 14:59, where a value of 14:00:00 exactly is not being counted.

    Hope this helps.

    Pete

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Countifs and time

    Pete, thanks for the assist

+ 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. Date and time tracking countifs
    By leydet4 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-28-2019, 11:17 AM
  2. [SOLVED] Countifs Help (adding a time argument in)
    By Pritirus in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-18-2017, 06:35 AM
  3. [SOLVED] COUNTIFS not recognising time
    By Streaky in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 10-14-2014, 08:48 AM
  4. COUNTIFS - Time Issue
    By kjcdude in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2013, 06:48 PM
  5. Countifs with restrictions on time
    By joppert87 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-30-2012, 02:00 PM
  6. COUNTIFS (Date and Time)
    By deadlypawn in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-12-2012, 09:04 AM
  7. Replies: 0
    Last Post: 12-16-2011, 09:01 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