COUNTIF(RANGE,"?") and search for contains

B

BlueWolverine

How do I perform a countif with the criteria being I want to count the number
of question marks?

Also, can I do countifs in a if it contains something versus equals something?

Say a cell contains "Guadalajara, Mexico"

can I get somrhting like =countif(cell,contains"Mexico") to return a 1?

Thank you!

(Excel 2003 on XP Pro. Also curious how to do it in Excel 2007 on XP Pro)

Thanks
 
J

JE McGimpsey

One way:

To count single question marks

=COUNTIF(A:A,"~?")

To count the number of cells in a range that contain a question mark
anywhere within their content:

=COUNTIF(A:A,"*~?*")

Similarly,

=COUNTIF(A1,"*Mexico*")
 
J

JE McGimpsey

Your last example will count any cell that contains a single character -
the question mark acts as a wild card.

To look for the question mark itself, you need to escape it with the
tilde character:

=COUNTIF(A1:A30,"~?")
 
B

BlueWolverine

Let me clarify, that fixes my problems. I just reread my post that makes it
sound like I am being a smart @$$ and telling you your fix locks my computer
up. ALL GOOD!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top