+ Reply to Thread
Results 1 to 6 of 6

COUNTIFS with distinct values for one condition

  1. #1
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    COUNTIFS with distinct values for one condition

    My formula is:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    A2 has the name of the location, B2 a certain "level" type, FYI. I have another column in my table named "ID Number" - NOT in my formula yet - that is a 7 digit number for each record in the table... I need the formula to only count distinct values for that column... meaning if the number appears once, count it once, but if it appears twice or more, count it only once (assuming the other conditions are met).

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTIFS with distinct values for one condition

    Can you post a SMALL sample file and show us what result you expect?

    A SMALL file will have about 20 rows worth of data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: COUNTIFS with distinct values for one condition

    In my sample, I need I COUNTIFS formula to count the number of East's with distinct IDs.... there are 6 East, but because ID 1234567 is repeated twice with an East, the formula should return 5.
    I can add a helper column if it would actually help...

    Sample 1.xlsx

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTIFS with distinct values for one condition

    Try this array formula**:

    =SUM(IF(FREQUENCY(IF(Table1[Location]="East",Table1[ID]),Table1[ID]),1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  5. #5
    Forum Contributor
    Join Date
    04-14-2013
    Location
    Ky
    MS-Off Ver
    Excel 2013
    Posts
    344

    Re: COUNTIFS with distinct values for one condition

    Awesome-sauce!!! Thank you so much!!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: COUNTIFS with distinct values for one condition

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Count of Values (Rows) of Most Recent Consecutive Streak (2+ Distinct Values)
    By ExcelForum88 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-13-2016, 12:26 PM
  2. [SOLVED] SUM FREQUENCY formula to count distinct values w/ OR condition
    By HeyInKy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-05-2015, 03:55 PM
  3. Replies: 0
    Last Post: 07-21-2015, 04:44 PM
  4. Replies: 0
    Last Post: 04-27-2015, 03:32 PM
  5. select distinct value from multiple sheets where a condition is true
    By groexcel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-15-2015, 07:23 AM
  6. [SOLVED] Countifs with a date as a condition
    By nickmessick1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-06-2013, 07:58 AM
  7. Countifs distinct values
    By mpeter2612 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-04-2013, 04:25 PM

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