+ Reply to Thread
Results 1 to 12 of 12

countif with 3 arguments?

  1. #1
    Registered User
    Join Date
    02-07-2005
    Location
    Minneapolis
    Posts
    36

    Question countif with 3 arguments?

    Hi Excel Experts!
    I am going out of my mind trying to figure this out!! Please help!
    Basically I need to add a 3rd argument to the "countif" function. I know, i know...can't do that!! Which is why I'm asking y'all to lend me hand! Let me try and lay out the scenario for you: this worksheet is calculating "special" commissions, if that helps you any!

    I need Excel to look down column A and recognize a specific salesperson's name (it will be in the list a number of times). Then i need it to look across to the amounts in columns C through G and tell me the count...not the sum...of numbers in column C, D, etc. everytime it sees that specific name. If Excel allowed a 3rd argument for the "countif" function i think it would look like this:
    =countif(a3:a100,"jim",c3:c100) ...I have already used "sumif" to give me the totals...but i need to know HOW MANY were counted for each of those sums!! Is this possible!? Please help! Please help!

    Thanks in advance!!
    Jenny

  2. #2
    Registered User
    Join Date
    02-07-2005
    Posts
    1
    I have a similar problem which I cant seem to find a solution to - in column A I have a list of sales people, and I use the spreadsheet to count the number of add ons they have to their sales.

    Column A lists their names, Column B and Column C has either "yes" or "no" to indicate whether or not they added Product 1 or Product 2 to their sale.

    What I am looking for is a formula to count how many Product 1's and how many Product 2's each of the sales people sold.

    i.e. in the following case:

    Names Product 1 Product 2
    Jenny yes yes
    Paul yes no
    Jenny no yes
    Paul yes no
    Tom yes yes
    Jenny no no

    the results I would want to see are:

    Names Product 1 Product 2
    Jenny 1 2
    Paul 2 0
    Tom 1 1

    Is this even possible? Any help would be appreciated!!

  3. #3
    Registered User
    Join Date
    02-07-2005
    Location
    Minneapolis
    Posts
    36
    That is EXACTLY what i am trying to do as well! Please help us if you can!!

  4. #4
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    firstly, why not just count the ocurances of "Jim" in column A?

    Otherwise, see this link - it should help

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

    or else

    =count(if(a3:a100="Jim",c3:c100))

    entered with control+shift+enter
    not a professional, just trying to assist.....

  5. #5
    Registered User
    Join Date
    02-07-2005
    Location
    Minneapolis
    Posts
    36
    Well thank you soooo very much for the help Duane, but I couldn't get that forumula to work either!?

    ...and i can't just the occurances of "Jim" in column A because I need to know how many products jim sold from column C, how many in D, etc...

    Do you....or anyone else!!... have any more advice for me??

  6. #6
    Registered User
    Join Date
    02-02-2005
    Posts
    35

    Sumproduct is the way

    Duane gave you all a good pointer with the sumproduct link

    It is a bit tricky to get yer head round but is the way

    assume the first example from hirenk is located from A1 on

    Names Product 1 Product 2
    Jenny yes yes
    Paul yes no
    Jenny no yes
    Paul yes no
    Tom yes yes
    Jenny no no

    then to count instances of Jenny and Product 1

    {=SUMPRODUCT(--(A2:A6="Jenny"),--(B2:B6="yes"))}
    Note: it is an array formulae so Ctrl, Shift Enter

    If you wanted to count all double yes sales for Paul

    {=SUMPRODUCT(--(A2:A6="Paul"),--(B2:B6="yes"),--(C2:C6="yes"))}
    Note: it is an array formulae so Ctrl, Shift Enter

    For more detail on how it works follow the link shown in the earlier post

    good luck
    RES

  7. #7
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    In the last correct example -

    =SUMPRODUCT(--(A2:A6="Jenny"),--(B2:B6="yes"))

    If doenst have to be an array formula.

  8. #8
    Registered User
    Join Date
    02-02-2005
    Posts
    35
    Matt good spot and a surprise to me

    Cheers RES

  9. #9
    Registered User
    Join Date
    02-07-2005
    Location
    Minneapolis
    Posts
    36
    Ok, please be patient with me!! I feel like an idiot because i am still struglling with this!! The information you all have provided is incredibly helpful though!!...as is that link! I just can't get any of the suggested formulas to work for this specific scenario...maybe i am doing something wrong!?...let me explain again quick:

    Column A Column B column c column d....
    Jim 205 115
    Jenny 530 200
    Jim 330 200
    Jim 530 115
    Paul 350 330
    Jenny 200
    Paul 530 400

    What formula should I use to use to find Jim's name and then tell me the number of times there is any number at all in column b, c, d...(instead of recognizing a specific word or number)

    The answers it should give me are:
    Column B
    Jim: 2
    Jenny: 1
    Paul: 2

    Column C
    Jim: 3
    Jenny: 0
    Paul: 1
    etc...

    Sorry if i'm making it hard to understand! Thank you all again for your help!!!

  10. #10
    Registered User
    Join Date
    02-07-2005
    Location
    Minneapolis
    Posts
    36
    I am sorry! The last response i entered made no sense! My table didn't turn out as I'd hoped! Let me make it a shorter question:

    this is the formula recommended to us:
    =SUMPRODUCT(--(A2:A6="JENNY"),--(B2:B6="YES"))

    Is there a specific command I can use in place of "yes" to make Excel recognize & count just any entry in column b? My entries in column B,C, D... will be a variety of different numbers & I need to know how many entries Jenny has in column B, C, D...etc.....

  11. #11
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    how about this?

    =SUMPRODUCT(--(A2:A6="JENNY"),--(B2:B6<>""))

    give a count of the number of times Jenny is in column a and column b is not blank

  12. #12
    Valued Forum Contributor
    Join Date
    07-11-2004
    Posts
    851
    or for many columns (b:z)

    =SUMPRODUCT(--(A2:A100="JENNY"),--(B2:z100<>""))

+ 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