+ Reply to Thread
Results 1 to 8 of 8

Countif not totaling correctly

  1. #1
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    449

    Countif not totaling correctly

    Hello All,

    Please see attached.

    Cell N40 is supposed to look at sheet 2 and return a total of 3, but it's returning 5. Why? It's throwing my counts off.

    The formula is counting dates. =COUNTIFS(sheet2!BJ:BJ,"<>0",sheet2!J:J,5)
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Countif not totaling correctly

    Sorry - looked at the wrong formula.

    Cells BJ5 and BJ6 are the reason why.
    Last edited by AliGW; 02-14-2017 at 01:43 PM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Countif not totaling correctly

    Cells BJ5 and BJ6 are the reason why. They are blank.

  4. #4
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    449

    Re: Countif not totaling correctly

    Thank you. What is wrong with those cells? They are empty.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Countif not totaling correctly

    Yes. That's why they are counted. All the other seemingly blank cells contain the 00/01/1900 date which counts as 0. So your formula is working correctly, i.e. those two cells are not equal to 0.

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

    Re: Countif not totaling correctly

    Yes, but the other empty-looking cells in column BJ actually contain zero, which is displayed as 00/01/1900 in the formula bar - you presumably have set up the sheet to display zeros as blanks. You can change the formula in N40 to this:

    =COUNTIFS(sheet2!BJ:BJ,"?*",sheet2!J:J,5)

    Hope this helps.

    Pete

  7. #7
    Forum Contributor
    Join Date
    09-21-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    449

    Re: Countif not totaling correctly

    Quote Originally Posted by Pete_UK View Post
    Yes, but the other empty-looking cells in column BJ actually contain zero, which is displayed as 00/01/1900 in the formula bar - you presumably have set up the sheet to display zeros as blanks. You can change the formula in N40 to this:

    =COUNTIFS(sheet2!BJ:BJ,"?*",sheet2!J:J,5)

    Hope this helps.

    Pete
    Fixed

    What does "?*" do?

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

    Re: Countif not totaling correctly

    Those are wildcard characters - the ? matches any single character (so avoids the blanks) and the * matches any number of (or none) characters.

    Thanks for the rep.

    Pete

+ 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. [SOLVED] COUNTIF not counting correctly
    By helencj in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-24-2015, 07:42 AM
  2. Countif not counting date correctly
    By ciresuark in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-03-2015, 07:27 PM
  3. Replies: 5
    Last Post: 08-21-2013, 12:55 PM
  4. [SOLVED] Help!: Sumproduct is not totaling correctly
    By Trigeek in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-14-2013, 06:40 PM
  5. Replies: 7
    Last Post: 12-16-2012, 08:24 PM
  6. Excel 2007 : Countif function Not working correctly
    By carl.spackler in forum Excel General
    Replies: 12
    Last Post: 04-09-2012, 06:39 PM
  7. Countif not counting correctly...
    By AaronK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2012, 12:43 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