+ Reply to Thread
Results 1 to 14 of 14

COUNTIFS not recognising time

Hybrid View

  1. #1
    Registered User
    Join Date
    03-20-2014
    Location
    London, England
    MS-Off Ver
    MS Office 365 (Version 2412)
    Posts
    51

    COUNTIFS not recognising time

    Hi,

    I'm creating a tracker for work and all I'm trying to do is simply count the amount of times (in column E of the 'tracker' tab) each agent has gone over their 'break' allowance (in the Data Dump tab) in the attached file using the formula =COUNTIFS('Data Dump'!E:E,">00:50:00",'Data Dump'!B:B,B2)

    I cannot for the life of me figure out why it is not returning a result for any of them, I thought it might be something to do with the cell formatting but despite attempting different things nothing is returning a proper result and they are all just counting '0' despite this not being the case.

    What am I doing wrong?
    Attached Files Attached Files

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: COUNTIFS not recognising time

    Do you mean?

    =COUNTIFS('Data Dump'!E:E,">&00:50:00",'Data Dump'!B:B,B2)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    03-20-2014
    Location
    London, England
    MS-Off Ver
    MS Office 365 (Version 2412)
    Posts
    51

    Re: COUNTIFS not recognising time

    Quote Originally Posted by Fotis1991 View Post
    Do you mean?

    =COUNTIFS('Data Dump'!E:E,">&00:50:00",'Data Dump'!B:B,B2)
    that's worked perfectly, thanks.

    I was using the autosum/insert function tool to create it which is where I was going wrong...thanks again

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,940

    Re: COUNTIFS not recognising time

    Select Entire E Column in Data Dump Sheet
    Select Text to Columns under Data
    Select Delimited in Convert Text to Column Wizard
    Then select Finish (Don't go with next button)
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,940

    Re: COUNTIFS not recognising time

    with Fotis 1991 formula

    Chelsea Long, No Times Over Breaks showing as 11 but as per data it is 9 only

  6. #6
    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,252

    Re: COUNTIFS not recognising time

    that's worked perfectly
    Are you sure?


    The problem is that the times in the breaks column (E) are not actually times, they are text values that look like times. You can check this out by changing the format to General ... the displayed value doesn't change; it should display a decimal value. You can change them to time values using a Helper column and adding zero (0).

    See the attached file.

    The formula should be:
    Formula: copy to clipboard
    =COUNTIFS('Data Dump'!E:E,">" & TIMEVALUE("00:50:00"),'Data Dump'!B:B,B2)
    after converting the times.


    Regards, TMS
    Attached Files Attached Files
    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


  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,700

    Re: COUNTIFS not recognising time

    ....also there's nothing wrong with the original formula

    =COUNTIFS('Data Dump'!E:E,">00:50:00",'Data Dump'!B:B,B2)

    You should get correct results with that as long as you convert the data in column E to real time values using methods suggested by TMS or nflsales
    Audere est facere

  8. #8
    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,252

    Re: COUNTIFS not recognising time

    And, just to prove DLL's point, the formula:
    Formula: copy to clipboard
    =COUNTIFS('Data Dump'!L:L,">00:50:00",'Data Dump'!B:B,B2)
    has been adjusted to refer to column L which has the converted times ... and it does work perfectly.

    I have to say, I think I prefer the TIMEVALUE function approach as, for me, it is clearer what is intended. No big deal though. Not sure which, if either, is more efficient but, in relatively small volumes I would guess it doesn't make a lot of difference.

    Regards, TMS

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,700

    Re: COUNTIFS not recognising time

    Quote Originally Posted by TMS View Post
    I have to say, I think I prefer the TIMEVALUE function approach as, for me, it is clearer what is intended.
    I agree, Trevor. It's even more important with dates where ">5/3/2005" could refer to 5th March or 3rd of May depending on your region, but ">"&DATE(2005,3,5) is unambiguous and universal.

    I was referencing the original formula here, not because that version is preferable but to re-inforce the point that the fault here is caused by the data, not the formula.

    btw, Fotis' suggested formula is equivalent to this:

    =COUNTIFS('Data Dump'!E:E,"<>",'Data Dump'!B:B,B2)

    i.e. it's counting any non-blank value in column E (where the name also matches in B), regardless of the actual time value (assuming times in original text format)

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: COUNTIFS not recognising time

    Even that(i think) it's obvious i have to say that i had a quick look and of course i didn't noticed the format of the time column. That's why i had this suggestion and i didn't looked forward as OP reply was that everything was ok. My bad!!
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-20-2014
    Location
    London, England
    MS-Off Ver
    MS Office 365 (Version 2412)
    Posts
    51

    Re: COUNTIFS not recognising time

    apologies for causing a mini riot here, I was meant to quote the second response as that got my original formula working.

    As stated in my OP I thought it was a formatting issue. The formula didn't seem to like me just selecting 'time' and I had to change it in the custom list to 'hh\:mm\:Ss' and it's worked (after doing nflsales's text conversion)

    It's all doing what it supposed to now and returning the correct results....too bad I've now got to manually run and cut data from daily reports in SAP dating back to the beginning of the financial year to populate the whole thing so I can begin to pull some of the agents in for taking too long for their breaks

  12. #12
    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,252

    Re: COUNTIFS not recognising time

    @DLL: thanks for the feedback and also explaining how the results from Fotis's formula are calculated. I guessed it was a string comparison but couldn't quite put my finger on how it worked.

    Regards, TMS

  13. #13
    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,252

    Re: COUNTIFS not recognising time

    The formula
    Formula: copy to clipboard
    =E2+0
    copied down will convert the values to "proper times".

    If you want, I can provide a short VBA subroutine that will convert them all for you.

    Regards, TMS

  14. #14
    Registered User
    Join Date
    03-20-2014
    Location
    London, England
    MS-Off Ver
    MS Office 365 (Version 2412)
    Posts
    51

    Re: COUNTIFS not recognising time

    Quote Originally Posted by TMS View Post
    The formula
    Formula: copy to clipboard
    =E2+0
    copied down will convert the values to "proper times".

    If you want, I can provide a short VBA subroutine that will convert them all for you.

    Regards, TMS
    thanks for the offer but there's no need, I've just tested it with the next lot of data being copied in and it's all updating how I wanted it to.

    Again, thanks for the assistance everyone

+ 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. COUNTIFS - Time Issue
    By kjcdude in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2013, 06:48 PM
  2. Countifs with restrictions on time
    By joppert87 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-30-2012, 02:00 PM
  3. COUNTIFS (Date and Time)
    By deadlypawn in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-12-2012, 09:04 AM
  4. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  5. recognising 24hr time
    By dodger999 in forum Excel General
    Replies: 2
    Last Post: 04-23-2011, 06:21 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