Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel wildcard not working

My situation: Newly installed Excel.

Table:

A |  BS 
A | SDC
A | BS f
A | BS c
B | SDC
B | TIP
B | SDC
C | BS s
C | SDC
D | BS a
E | SDC

theTable

My need: I need to count all the BS* ones.

My formula: =COUNTIF(B1:B11; "BS*")
The result shows 0. Always. I have tried with other tables. =COUNTIF(B1:B11; "BS") returns 1 of course. But I need BS*

I have tried other wildcards in other situations. And none are working. Do I have to turn something on in Excel first?

Hope you can help

like image 388
DemonDarakna Avatar asked Feb 18 '26 05:02

DemonDarakna


1 Answers

From the Microsoft page on COUNTIF:

Make sure your data doesn't contain erroneous characters.
When counting text values, make sure the data doesn't contain leading spaces, trailing spaces, inconsistent use of straight and curly quotation marks, or nonprinting characters. In these cases, COUNTIF might return an unexpected value.

I recreated your error by copying your values from the question, but when I took out the leading spaces using (TRIM) it gave the right results.

like image 92
Gordon K Avatar answered Feb 19 '26 22:02

Gordon K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!