+ Reply to Thread
Results 1 to 8 of 8

Why does the "CountIF" function fails on value "Monday Week 1"?

  1. #1
    Registered User
    Join Date
    03-21-2015
    Location
    London, England
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Why does the "CountIF" function fails on value "Monday Week 1"?

    Hi, I have got this spreadsheet and to the right I have used the "CountIF" function. The very first function on "Monday Week 1" fails to count the correct number. It returns 26, while it should be 27. Any idea why?Assets New.xlsx

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Why does the "CountIF" function fails on value "Monday Week 1"?

    Monday Week 1 in row 294 has extra space. Remove it and it will work.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Why does the "CountIF" function fails on value "Monday Week 1"?

    Hi,

    The last one on row 294 has a trailing space.

    I can't help thinking that if you're working with dates you'd be better off listing actual dates. They can always be formulated to present as you wish but they would be more useful for all sorts of analysis.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    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
    44,447

    Re: Why does the "CountIF" function fails on value "Monday Week 1"?

    The entry in cell C294 has a trailing space.

    Either fix it, and any others, or use
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    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


  5. #5
    Registered User
    Join Date
    03-21-2015
    Location
    London, England
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Re: Why does the "CountIF" function fails on value "Monday Week 1"?

    Hi again,
    Thanks very much for pointing me the problem. I spent about 3 hours trying to find the culprit to the problem.

    How did you find the so called trailing space in row 294? Is there a command that makes spaces visible?

    Does anybody know a variation of "CountIF" with a value that can single out "Monday Week 1" even if there is an additional text or spaces?

    Regards
    Last edited by kashbg; 06-01-2015 at 05:14 PM.

  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
    44,447

    Re: Why does the "CountIF" function fails on value "Monday Week 1"?

    Does anybody know a variation of "CountIF" with a value that can single out "Monday Week 1" even if there is an additional text or spaces?
    I've given you one

    I put =LEN(C2) in a spare column and copied it down. I then switched on AutoFilter and filtered on Monday Week 1. Most were length 13, one was 14. Bingo! Then you select the cell and press F2 to go into Edit mode to see what's in the cell.

    Regards, TMS



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.
    Last edited by TMS; 06-01-2015 at 05:30 PM.

  7. #7
    Registered User
    Join Date
    03-21-2015
    Location
    London, England
    MS-Off Ver
    MS Office 2013
    Posts
    7

    Re: Why does the "CountIF" function fails on value "Monday Week 1"?

    Thanks a lot for the help.
    I am overwhelmed by the level of attention and professionalism.
    Thanks guys.

  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
    44,447

    Re: Why does the "CountIF" function fails on value "Monday Week 1"?

    You're welcome.

+ 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. modification to the "IF(SUM(COUNTIF" formula or "and" function
    By Tamar81 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-10-2013, 12:29 PM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. Simple? Formula for "for the week starting Monday May Xxth"
    By nmorse in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-27-2006, 12:52 PM
  5. IF(COUNTIF(Thursday,"John Doe")>1,"error"," ")
    By jayd77 in forum Excel General
    Replies: 3
    Last Post: 10-26-2005, 09:17 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