Count Function on True Statements

  • Thread starter Thread starter krayziez
  • Start date Start date
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.
 
=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)
 
=COUNTIF(A1:A6,"=Car2")

This will result in the number of "Car2" instances found in the range
A1 to A6.
 
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)
 
Dear Krayziez:

All you have to do is group your COUNTIF statements together by either
Adding them or subtracting them from one list against other.

Example
=CountIf(Sheet1!A1:A6,"Car2")+CountIf(Sheet2!A1:A3,"Car2")

Joe P.


-----Original Message-----
From: krayziez
[mailto:[email protected]]
Posted At: Sunday, May 28, 2006 6:34 PM
Posted To: microsoft.public.excel
Conversation: Count Function on True Statements
Subject: Re: Count Function on True Statements


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top