I need to count the cells that contains the actual ?
symbol inside. How do I do a
CountIF(range, "?")
I tried "\?"
but it returns 0.
A question mark matches any single character; an asterisk matches any sequence of characters.
To count the number of asterisks in a range of cells, you can use the COUNTIF function. For example, if cells A1:A5 contain "*", the formula =COUNTIF(A1:A5,"*") returns 5. To count the number of asterisks in a worksheet, you can use the COUNTIF function with the wildcard character (\*) as the criterion.
Even inside double quotes a search with ?
will return more than just cells fully occupied by a single question mark. To make the search more literal rather than, in part, have the question mark as a wild card, 'escape' it with a tilde (swung dash ~
), like so:
=countif(A:A,"~?")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With