Very weird problem, need help.

bomberman411

Board Regular
Joined
Oct 23, 2007
Messages
169
Hello all,

I have a weird problem that I can't figure out... might be a fluke in Excel, I just don't know.

In my spreadsheet, I have 3 different/separate cells to calculate totals that I need. All 3 checks the same long column for different things:

- one to check for zeros ("0") using
Code:
=COUNTIF($F$11:$F$5000;0)
- one to check for question marks ("?) using
Code:
=COUNTIF($F$11:$F$5000;"?")
- one to check for dashes ("-) using
Code:
=COUNTIF($F$11:$F$5000;"-")

All of these use to work fine, but recently I have noticed something. When I add a "?", the total is incremented like it should. BUT if I write a "-", I have BOTH totals (total for the question marks & total for dashes) increment at the same time...? I really don't know what could be wrong.

Please help.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
The question mark is a wildcard with COUNTIF. To count the actual character you have to precede it with a tilde:

=COUNTIF($F$11:$F$5000,"~?")
 
Upvote 0
? is a wildcard, =COUNTIF($F$11:$F$5000;"?") is counting all cells with a single character in them. Try =COUNTIF($F$11:$F$5000;"~?")
 
Upvote 0
Thank you very much guys...

I knew it had to be something like that, I suspected as much.
Thanks for letting me know.
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top