Why does this code =COUNTIF($V$2:$V$100, "*"&AB1) not count all the (NG)

Anonymous
2025-04-01T15:29:21+00:00

Using the above code, it will pick out all the info I require, but for some reason it doesn't pick all (NG) in yellow, showing. The example here 4 shows but should be 6!

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
Answer accepted by question author
Rory Archibald 19,315 Reputation points Volunteer Moderator
2025-04-01T15:38:23+00:00

Most likely some of those items have trailing spaces or other hidden characters at the end. If you use "*"&AB1&"*" as the criteria, does that fix it?

Was this answer helpful?

0 comments No comments
Answer accepted by question author
Anonymous
2025-04-01T15:38:19+00:00

I would guess that some of your entries have extra spaces before after.... try

=COUNTIF($V$2:$V$100, "*"&AB1 & "*")

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful