Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

COUNTIF with a question mark symbol

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.

like image 265
Spider Avatar asked Feb 21 '14 21:02

Spider


People also ask

What does question mark mean in Excel formula?

A question mark matches any single character; an asterisk matches any sequence of characters.

How do you do asterisk in Countif?

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.


1 Answers

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,"~?")
like image 185
pnuts Avatar answered Oct 01 '22 07:10

pnuts