Forum Discussion
Using "No" in Countif formula
Hello all,
I was trying to use a countif formula to find how many instances of "No" appeared in a range.
i.e =countif(B2:B5, "=no"). Column B contains multiple instances of "No", but the formula keeps returning 0 as a result. I then used the wildcard (*) i.e =countif(B2:B5, "=no*") and then it returned the right figure. Am I doing something wrong? Or does excel not recognize "no" on its own?
8 Replies
Hello, the COUNTIFS returned 0 most likely because there are extra spaces. You can use TRIM to remove all the spaces as I did and then the COUNTIFS will deliver the correct values.\
- SergeiBaklanDiamond Contributor
Most probably you have space or non-printable character after the No. Did you add them manually or copy/paste from somewhere?
- TobiLufCopper Contributor
hi. thanks for your response.
I just checked, there are no spaces or additional characters after no. its written as (......., "=no")
I typed the formula in manually. When I delete the * from the formula, it doesn't work. but with the * it works.
- SergeiBaklanDiamond Contributor
You may always check by =LEN(cell). If more than 2 you have extra characters.