Count Function on True Statements

K

krayziez

I wonder if I can do a count on a specific value, like if I had this:

CAR1
CAR1
CAR2
CAR2
CAR2
CAR3

Is there a way I can count how many "car2" I have? Currently, the only
way I can do this is to set a true/false statement then count the
trues.
 
D

Dave Peterson

=countif(a1:a10,"car2")

This is a function that accepts wildcards, so if you wanted to count any old
car:

=countif(a1:a10,"car*")
(starts with car)

or

=countif(a1:a10,"*car*")
(contains car)
 
C

C01d

=COUNTIF(A1:A6,"=Car2")

This will result in the number of "Car2" instances found in the range
A1 to A6.
 
K

krayziez

Thanks. Actually I wanted to be more specific. If I had 2 sheets and one
was:
car1
car1
car2
car2
car2
car3

and then another column had:
car1
car2
car3

then I wanted to know how I can count using the 2nd column as the
value... I'm thinking it's this:
=COUNTIF(A1:A6,B1)
 
B

Bob Phillips

Use

=COUNTIF($A$1:$A$6,B1)

or if on separate sheets

=COUNTIF(Sheet1!$A$1:$A$6,B1)

and copy down

--
HTH

Bob Phillips

(replace somewhere in email address with googlemail if mailing direct)
 
Top