Countif number or number WITH * asterisk - ignore other symbols or cells with text

little_johnny

New Member
Joined
Jan 29, 2012
Messages
30
Could someone help me with a formula to count cells that ONLY contain a number AND/OR a number with the " * " (asterisk) symbol?

I wish to ignore other symbols, as well as cells which contain text..

It must also ignore blanks.

Eg:

AAA
AAA
AAA
1
2
3*
BBB
BBB
BBB*
BBB**
1
2
3
4
5**

In the above example, I would expect the formula to give me an answer of 8 (includes the 3* and 5**), and ignore the cells with text (even if they contain an asterisk, such as BBB* and BBB**).
 
Sorry, i assume you need the count,
here is the formula to count
CSE formula
=SUM(IFERROR(ISNUMBER(SEARCH("~*",A1:A20))*SUBSTITUTE(A1:A20,"*",""),0))
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
The next logical step is to sum the numbers which can be done with the below (still an array - ctrl + Shift + Enter formula)

=SUM((IFERROR(SUBSTITUTE(IF(A1:A20="", "T", A1:A20),"*","")+0,"T")))

You genius- works perfectly. Thanks! :)
 
Upvote 0
Just realised it can be shorted too, don't need the iferror

=SUM(--(ISNUMBER(SUBSTITUTE(IF(A1:A20="", "T", A1:A20),"*","")+0)))

dispelthemyth,

Nicely done - one for my archives - thanks.
 
Upvote 0

Forum statistics

Threads
1,215,494
Messages
6,125,137
Members
449,207
Latest member
VictorSiwiide

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