+ Reply to Thread
Results 1 to 5 of 5

Countifs distinct values

  1. #1
    Registered User
    Join Date
    01-04-2013
    Location
    Southern Indiana
    MS-Off Ver
    Excel 2010
    Posts
    3

    Countifs distinct values

    Hello.

    what I'm trying to accomplish is to count specific values in two columns in a worksheet (say, column A, and column B).

    = countifs(column A, "Complete", column B, "Joe")

    The above formula works for counting values in A, and B. Where my problem lies, is I want to only count values from the above formula based off distinct values in another column (say, column C). So, I want to count A = complete, and B = Joe, but if the value (numeric) is repeated in column C, then only return 1 for the count of "Complete, "Joe".

    I hope the above makes sence. Thanks in advance for your help.

  2. #2
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Countifs distinct values

    ARRAY formula:

    Please Login or Register  to view this content.
    or this one to include non-numeric values in column C:

    Please Login or Register  to view this content.
    or, this non-array formula, which handles both numeric and non-numeric values in column C:

    Please Login or Register  to view this content.
    Last edited by icestationzbra; 01-04-2013 at 01:41 PM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  3. #3
    Registered User
    Join Date
    01-04-2013
    Location
    Southern Indiana
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Countifs distinct values

    Thanks for your help.

    I tried using all three formula's you provided and the array formula's are giving me a if ( typeof(autoid) === 'undefinded') error of some sort. I'm using named ranges for the source for this formula. Not sure if that's the problem. For the array I am doing CTRL + SHIFT + ENTER.

    The non array formula returns the value of 1, but is not counting the other distinct values of column C.

    Below is a sample of the data that I'm refering to. I'm wanting to count all "Complete"/"Joe", but only count them once if column C is repeated. So the formula would return the value of 3 for the below data, instead of 4.

    A B C
    Complete Joe 1
    Complete Joe 2
    Complete Joe 2
    Complete Joe 3

    Code I entered
    Returns error
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Returns 1, when should be 3
    Please Login or Register  to view this content.
    Thanks again for your help!

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Countifs distinct values

    @mpeter:

    Are all three named ranges the same size? If they are not the same size, or if they include an entire column you will likely get an error.
    I tested all three formulas and they work just fine based on your example data.

    - Moo

  5. #5
    Registered User
    Join Date
    01-04-2013
    Location
    Southern Indiana
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Countifs distinct values

    @Moo the Dog

    Yes they are all the same size within thier respected columns, and they aren't for an entire column, although the named ranges aren't set up to be dynamic, so there will be many blank cells within the range. I'll come up with a sample sheet and upload it. Thank you all!

+ 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