+ Reply to Thread
Results 1 to 5 of 5

Conditional counting?

  1. #1
    Registered User
    Join Date
    10-08-2007
    Location
    San Diego
    Posts
    5

    Conditional counting?

    Hello. I bet this is an easy one for the pros...

    I have a long column that has either an A or B in the column. I want to write a function that says "check the column, find the A's, take note, and count the total number of A's". Same for the B's. Is this an IF/THEN thing? I can't get it working at all.

    Thanks.

    Matt

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =COUNTIF(A:A,"A")
    or

    =COUNTIF(A:B,"A")
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    =countif(A1:A100, "A")

    I know you can sort out the second formula ...

  4. #4
    Registered User
    Join Date
    10-08-2007
    Location
    San Diego
    Posts
    5
    Thanks...worked as expected!

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by teafan
    could this be used for adding up the values of another column?

    for example substitute "A" for "Paid" which sits in a column next to a value... it is the value i want totaling but only if it has been paid
    Use Sumif() for that:

    e.g. =Sumif(A:A,"Paid",B:B) will sum B where A has "Paid" in it.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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