+ Reply to Thread
Results 1 to 10 of 10

COUNTIFS formula as a range

  1. #1
    Registered User
    Join Date
    06-06-2006
    Posts
    14

    COUNTIFS formula as a range

    Hello,

    I'm trying to get a list of items that has two versions, and want to make a table that will count he total number of items, and them within that list, count the total of version 1 and the total of version 2.


    I tried doing:
    =COUNTIFS(COUNTIFS(sheet1!B:B, B2), ver1)

    as you can see, I try using another countifs as the range criterion. I'm doing it like this, because I have 200 places with these items, and cell B2 defines the place name, so the inner countifs gives me the total items in a certain place, and the outer countifs should give me the specific version from the total items of this certain place.

    why isn't it working? can't I have another countifs as a range critertion?

    Thanks

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    The Countifs needs a range specified not a number... so that won't work.


    Are you trying to count based on 2 criteria (i.e that column B contains item in B2 and that another column contain "ver1")?
    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.

  3. #3
    Registered User
    Join Date
    06-06-2006
    Posts
    14

    Yes!

    That Ver1 is in another column, in the range found before (IE. Column B contains Item B), like 'Find' and then 'Find in this search'

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    still don't quite understand what you are trying to do... perhaps you can provide an example showing what you have and what you want to achieve?

  5. #5
    Registered User
    Join Date
    06-06-2006
    Posts
    14
    Ok,

    I have a column like 'clinic1' with clinics 1-200.

    I have the column F with 'main' and 'reg'.

    I need to count the number of occurrences of clinic1 in the table (which is 37 (out of about 7000)) and the the number of times 'main' appears (which is 5)

    I found something, but I can't get it to work: this is from excel's help, "Count how often multiple number values occur by using functions"

    =COUNT(IF((A2:A11="South")*(C2:C11="Meat"),D2:D11))


    But I can't get it to work; I don't understand what the last range is for.

    Thanks

    sorry: this is what I tried

    =COUNT(IF((A1:A37="Clinic1")*(F1:F37="Reg"),G1:G37))
    Attached Files Attached Files
    Last edited by yadaaa; 07-04-2008 at 12:50 PM.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try either:

    =Countifs(A:A,"Clinic1",F:F,"Main") - If you have XL2007

    or

    =Sumproduct((A1:A7000="Clinic1")*(F1:F7000="Main")) - if you have other versions... note you can't use whole column references here like A:A....

    Not sure why you need column G.. it is empty... are you trying to sum based on 2 criteria or count?

  7. #7
    Registered User
    Join Date
    06-06-2006
    Posts
    14
    Do I feel dumb....

    Thank you a lot.

    I have XL2007
    If I save it for someone who uses excel 2003, I need to use the 2nd option?

  8. #8
    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 yadaaa
    Do I feel dumb....

    Thank you a lot.

    I have XL2007
    If I save it for someone who uses excel 2003, I need to use the 2nd option?
    Yes, you'll have to use the second option...

  9. #9
    Registered User
    Join Date
    06-06-2006
    Posts
    14
    How do I "lock" the ranges not to change? the B:B became C:C etc...

  10. #10
    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 yadaaa
    How do I "lock" the ranges not to change? the B:B became C:C etc...
    Put $ signs in front... e.g $B:$B

+ 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