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**).
 

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 below would also count *5 and * 6

<code>=SUM(--(ISNUMBER(IFERROR(SUBSTITUTE(IF(A1:A20="", "T", A1:A20),"*","")+0,"T"))))</code>

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**).
 
Upvote 0
=sumproduct(--isnumber(search("~*",a1:a20)))
 
Upvote 0
this would be

=SUMPRODUCT(ISNUMBER(SUBSTITUTE($O$1:$O$15;"*";"")+0)+0)

This is unfortunately only counting the numbers WITH an asterisk- it's not counting individual numbers :(

thanks anyway, dispelthemyth solved anyway :)

quote_icon.png
Originally Posted by sadath
=sumproduct(--isnumber(search("~*",a1:a20)))
 
Upvote 0

Forum statistics

Threads
1,215,506
Messages
6,125,197
Members
449,214
Latest member
mr_ordinaryboy

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