Counting words with numbers in them

J

jezzica85

Hi all,
If I have a row of words and numbers like this:

example
1922-example
anotherexample
3311
athirdexample
332

Is there a way to use the COUNTIF function to count how many of these words
are numbers, and how many start with numbers? So, in this example, 1 word
starts with a number, and 2 are numbers. Failing that, is there a way to
just count how many words have numbers in them, so there would be 3 in this
example? Thanks!
 
P

Peo Sjoblom

Start with a number and the rest text


=SUMPRODUCT(--(ISNUMBER(--LEFT(A1:A10))),--(ISERR(--(A1:A10))))


pure numbers

=COUNT(A1:A10)


--

Regards,

Peo Sjoblom

Northwest Excel Solutions

www.nwexcelsolutions.com

(remove ^^ from email address)

Portland, Oregon
 
R

Ron Rosenfeld

Hi all,
If I have a row of words and numbers like this:

example
1922-example
anotherexample
3311
athirdexample
332

Is there a way to use the COUNTIF function to count how many of these words
are numbers, and how many start with numbers? So, in this example, 1 word
starts with a number, and 2 are numbers. Failing that, is there a way to
just count how many words have numbers in them, so there would be 3 in this
example? Thanks!

I can't do it with the COUNTIF function but:

Values that are Numbers:

=SUMPRODUCT(--ISNUMBER(rng))

Values that start with a Number (this includes the values that ARE numbers)

=SUMPRODUCT(--ISNUMBER(-LEFT(rng,1)))

Non-numeric values that start with a number would just be the difference of the
above two:

=SUMPRODUCT(--ISNUMBER(-LEFT(rng,1)))-SUMPRODUCT(--ISNUMBER(rng))
--ron
 
J

jezzica85

Thank you both for the help!

Ron Rosenfeld said:
I can't do it with the COUNTIF function but:

Values that are Numbers:

=SUMPRODUCT(--ISNUMBER(rng))

Values that start with a Number (this includes the values that ARE numbers)

=SUMPRODUCT(--ISNUMBER(-LEFT(rng,1)))

Non-numeric values that start with a number would just be the difference of the
above two:

=SUMPRODUCT(--ISNUMBER(-LEFT(rng,1)))-SUMPRODUCT(--ISNUMBER(rng))
--ron
 
Top