Don’t use * as a wildcard

markh9999

New Member
Joined
Aug 21, 2007
Messages
49
I have a countif statement that I use to find all exam grades that are A*. I store A* in a cell and use that cell in the countif. Problem is it picks up everything starting with A as it’s treating the * as a wildcard. Is there a way round this?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You need to us this as the criteria A~*
 
Upvote 0
0You need to us this as the criteria A~*8
Ah yes - thank you but I'm not sure how to use that in what I want. I want the countif to look like #countif(a1:a10, b1) where b1 contains A* and all the cells A1 to A10 may contain an A*, A, B, C, D or E. So where would I put the ~ or do I have to put A~* in cell b1 ( I really wanted it to read A* and not A~*).
 
Upvote 0
You would need to put A~* in cell B1
 
Upvote 0
Another option would be to use sumproduct
Excel Formula:
=SUMPRODUCT(--(A1:A10=B1))
 
Upvote 0
You could also use:

=countif(a1:a10, SUBSTITUTE(b1,"*","~*"))
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.

In future when marking a solution please select the post that helped the most, rather than your reply. Thanks
I have changed it for you this time.
 
Upvote 0

Forum statistics

Threads
1,216,124
Messages
6,128,990
Members
449,480
Latest member
yesitisasport

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