countif a1:a100 not numeric

jsb1921

Board Regular
Joined
Aug 14, 2020
Messages
74
Office Version
  1. 2007
Platform
  1. Windows
  2. Web
A1:a100. will have either a 2 digit number or "--" (hyphen once or twice) or "__" (underscore once or twice)

=countif(a1:a12,">0" works fine.
Looking for a syntax for
1. =countif(a1:a12 "is not numeric") or something like that.
2. instead of using countif(a1:a12,">0") which works, if I can use some thing like countif(a1:a12,"isnumber"), i would be like it better.
3. on row 17, i found the average, by dividing the sumif and countif I have in row 15, and 16. and it does the job. Is there a way to use the excel average function, excluding the non-numeric cells.
thanks
john

countif.a.xlsx
ABC
137
2_1 underscore
3-1 hyphen
444
556
6--2hyphens
728
830
9__2underscores
1047
1188
1262
13
14
158=COUNTIF(A1:A12,">0")countif numeric
16392=SUMIF(A1:A12,">0")sumif numeric
1749=A16/A15avgif numeric
180=COUNTIF(A1:A12,"not number")countif not numeric
Sheet1
Cell Formulas
RangeFormula
A15A15=COUNTIF(A1:A12,">0")
A16A16=SUMIF(A1:A12,">0")
A17A17=A16/A15
A18A18=COUNTIF(A1:A12,"not number")
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
=COUNT(A1:A12)

will count the numeric values, so

=ROWS(A1:A12)-COUNT(A1:A12)

will give the non-numeric.
 
Upvote 0
Solution
Thanks. it works. I marked it as solution. My curiosity is: still, I would like to learn how to use isnumber excel function inside the countif conditon. appreciate, if you can help
 
Upvote 0
You can't use ISNUMBER directly inside COUNTIF. The arguments for COUNTIF are range, pattern (a text value). You can't use FUNCTION(range), and using ISNUMBER on the pattern won't help. There are a few options though. See this:

Book1
ABC
137
2_1 underscore
3-1 hyphen
444
556
6--2hyphens
728
830
9__2underscores
1047
1188
1262
13
14
1588countif numeric
16392392sumif numeric
1749avgif numeric
1844countif not numeric
Sheet5
Cell Formulas
RangeFormula
B15B15=COUNTIFS(A1:A12,"<>-*",A1:A12,"<>_*")
B16B16=SUM(A1:A12)
A15A15=SUMPRODUCT(--ISNUMBER(A1:A12))
A16A16=SUMPRODUCT(--ISNUMBER(A1:A12),A1:A12)
A17A17=A16/A15
A18A18=SUMPRODUCT(--NOT(ISNUMBER(A1:A12)))
B18B18=SUM(COUNTIF(A1:A12,{"-*","_*"}))
 
Last edited:
Upvote 0
Eric, This is EXACTLY what I was looking for, a way to make use of isnumber function in some way or other.
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,652
Members
448,975
Latest member
sweeberry

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