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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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