+ Reply to Thread
Results 1 to 7 of 7

Count Function on True Statements

  1. #1
    Registered User
    Join Date
    05-28-2006
    Posts
    60

    Count Function on True Statements

    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.

  2. #2
    Registered User
    Join Date
    05-14-2006
    Posts
    33
    =COUNTIF(A1:A6,"=Car2")

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

  3. #3
    Registered User
    Join Date
    05-28-2006
    Posts
    60
    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)

  4. #4
    Dave Peterson
    Guest

    Re: Count Function on True Statements

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

    krayziez wrote:
    >
    > 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.
    >
    > --
    > krayziez
    > ------------------------------------------------------------------------
    > krayziez's Profile: http://www.excelforum.com/member.php...o&userid=34891
    > View this thread: http://www.excelforum.com/showthread...hreadid=546334


    --

    Dave Peterson

  5. #5
    Joseph R. Pottschmidt
    Guest

    Re: Count Function on True Statements

    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)


    --
    krayziez
    ------------------------------------------------------------------------
    krayziez's Profile:
    http://www.excelforum.com/member.php...o&userid=34891
    View this thread:
    http://www.excelforum.com/showthread...hreadid=546334


  6. #6
    Bob Phillips
    Guest

    Re: Count Function on True Statements

    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)

    "krayziez" <[email protected]> wrote in
    message news:[email protected]...
    >
    > 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)
    >
    >
    > --
    > krayziez
    > ------------------------------------------------------------------------
    > krayziez's Profile:

    http://www.excelforum.com/member.php...o&userid=34891
    > View this thread: http://www.excelforum.com/showthread...hreadid=546334
    >




  7. #7
    Registered User
    Join Date
    05-28-2006
    Posts
    60
    Great info. Thanks alot! This forum is my new home!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1