Share via

countif function/formula not working!!!

Anonymous
2016-09-18T17:53:50+00:00

Tearing my hair out here!!  Trying to count the occurrences of a number (coded 1) in a huge data dump.   Am using the formula

=countif(range of cells,"1")   I've tried removing the " " around the 1 - no difference.   Anyone help - I'm clearly doing something stupid!

thanks

I've just highlighted the range of cells in the above formula?????

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. HansV 462.6K Reputation points
    2016-09-18T20:23:54+00:00

    If Excel complains that there is a problem with the formula, try Tom Ogilvy's suggestion of using a semi-colon:

    =COUNTIF(D5:D9;"1")

    or

    =COUNTIF(D5:D9;1)

    Was this answer helpful?

    6 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2016-09-18T19:01:09+00:00

    Just for grins, try this

    =COUNTIF(E:E,"*1*")

    that seems to work with spaces and the non-breaking space character (Char(160))  which can be present if you copied your data from the web. 

    It won't count a number like  1, 123 or 2114  if they are stored as numbers.

    However you statement that there is a problem with the formula would not be raised because of the data.  It generally implies that you have improperly formatted the range argument or are using something like a semi-colon (;) for list separator when you actually need a comma (,)  (the first argument can only be a reference to a single contiguous range)

    --

    Regards,

    Tom Ogilvy

    Was this answer helpful?

    5 people found this answer helpful.
    0 comments No comments
  3. HansV 462.6K Reputation points
    2016-09-18T18:05:32+00:00

    Could there be spaces before or after the 1s in the range?

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2016-09-18T20:11:40+00:00

    =countif(D5:D9,"1")                  i.e is to identify the no of 1's in a particular range................loads more ranges to cover tks!

    Feeling more stupid by the minute

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2016-09-18T18:29:12+00:00

    thanks but I've double checked that!  Infuriating. Error message states that "theres a problem with this formula"

    Was this answer helpful?

    0 comments No comments