+ Reply to Thread
Results 1 to 19 of 19

countifs issue

  1. #1
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    countifs issue

    Hi folks,

    I'm sure there is a very simple solution to this issue.

    See the attached sample spreadsheet.

    In cell F3 I am attempting to retrieve a count of cells that have todays date. Trouble is the date field is actually date & time. I do not want to seperate the date from the time into two columns.

    How do i modify the query to return the correct number?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: countifs issue

    Hi

    a possible approach

    Please Login or Register  to view this content.


    Another formula could be:

    Please Login or Register  to view this content.
    Regards
    Last edited by canapone; 03-23-2017 at 11:15 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: countifs issue

    Try

    =SUMPRODUCT(--(INT(E5:E21)=A1))

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,907

    Re: countifs issue

    Try this ...

    =COUNTIFS(E:E,">="&A1,E:E,"<"&A1+1)

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,996

    Re: countifs issue

    Two replies while I was away making a pot of tea... My effort was the same as John's... so I've removed mine!!
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  6. #6
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: countifs issue

    I count three rows where todays date appears. Neither of those formulas work guys. :-(

  7. #7
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: countifs issue

    Sorry my bad, the dates in the rows are a month out. Tested Johns and it works. Thank you.

  8. #8
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: countifs issue

    My next question is how would I incorporate times as well....Say 23/02/2017, before 09:00 ?

  9. #9
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: countifs issue

    Hi,

    Please Login or Register  to view this content.
    Last edited by canapone; 03-23-2017 at 11:31 AM.

  10. #10
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,907

    Re: countifs issue

    =COUNTIFS(E:E,">="&A1,E:E,"<"&A1+TiME(9,0,0))

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,996

    Re: countifs issue

    ... or
    =SUMPRODUCT(--(INT(E5:E21)=$A$1)*(MOD(E5:E21,1)<=9/24))

  12. #12
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: countifs issue

    Quote Originally Posted by canapone View Post
    Hi,

    in data you shared I spot three "Feb 23, 2017", but any March 23, 2017.
    Yes I have noticed this. John's formula works. All I need now is how to add the time value, so say pre 09:00

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,996

    Re: countifs issue

    See posts 9, 10 & 11

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: countifs issue

    Try

    =SUMPRODUCT((INT(E5:E21)=A1)*(MOD(E5:E21,1)<9/24))


    ....wasn't even making a cup of tea!!

  15. #15
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: countifs issue

    WOWSERS guys, you are all legends. Thank you so much. Glenn - your formula works like magic.

  16. #16
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: countifs issue

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  17. #17
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: countifs issue

    One last thing !

    How would I incorporate a further criteria from a differernt column. So for example, 23/02/2017, pre 9am and is COMPLETED.

  18. #18
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: countifs issue

    Try

    =SUMPRODUCT(--(INT(E5:E21)=$A$1)*(MOD(E5:E21,1)<=9/24)*(I5:I21="COMPLETED"))

  19. #19
    Registered User
    Join Date
    08-31-2011
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Re: countifs issue

    Quote Originally Posted by JohnTopley View Post
    Try

    =SUMPRODUCT(--(INT(E5:E21)=$A$1)*(MOD(E5:E21,1)<=9/24)*(I5:I21="COMPLETED"))
    Nailed it ! thanks. CLosing thread.

+ 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 Issue?
    By Silez in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-24-2016, 03:31 PM
  2. Countifs issue!
    By mrsdeapsleap in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-12-2016, 04:09 PM
  3. COUNTIFS issue
    By Fletch161 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-29-2015, 10:51 AM
  4. [SOLVED] Issue with countifs
    By grkchakri in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2015, 01:13 AM
  5. [SOLVED] COUNTIFS Issue
    By hegleg88 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 05-29-2014, 02:24 AM
  6. COUNTIFS issue
    By Glen- in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-11-2014, 08:29 PM
  7. COUNTIFS - Time Issue
    By kjcdude in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2013, 06:48 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