+ Reply to Thread
Results 1 to 5 of 5

Formula To Find Distinct Values With Criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Pleasant Hill, CA
    MS-Off Ver
    Excel 365
    Posts
    27

    Formula To Find Distinct Values With Criteria

    I am attempting to find the distinct or unique values in one column where I specify criteria in two other columns. I am using a formula that I got from one of the forums several moths ago.

    Please see the attached file. In cell H2 I have entered that formula. In this scenario, I am attempting to find the number of distinct/unique values in the Group column (column A) where the Carrier (column B) equals C8 and the Date (column C) equals 04/01/2019. This formula appears to work for some Carrier, Date criteria sets, but not for all. In this example there are 5 distinct/unique groups where Carrier = C8 and Date = 04/01/2019, but the formula returns only 4.

    Can anyone figure out why this is not working and what adjustments are required to the formula?

    Any help is appreciated!
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Formula To Find Distinct Values With Criteria

    Try this one, instead:

    =SUMPRODUCT((FREQUENCY(($C$7:$C$680=$F$2)*($B$7:$B$680=$F$3)*MATCH($A$7:$A$680&" ",$A$7:$A$680&" ",0),ROW(INDIRECT("1:10000")))>0)+0)-1
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Formula To Find Distinct Values With Criteria

    Sorry for injection in the middle of topic. (And may be off topics)

    I was try with these array formula and get strange result. >_<

    3 of array formula on different part of data seem OK.
    =SUM(IFERROR(1/(COUNTIFS(A7:A611,A7:A611,B7:B611,F3,C7:C611,F2)),0)) ===> 0
    =SUM(IFERROR(1/(COUNTIFS(A612:A648,A612:A648,B612:B648,F3,C612:C648,F2)),0)) ===> 5
    =SUM(IFERROR(1/(COUNTIFS(A649:A680,A649:A680,B649:B680,F3,C649:C680,F2)),0)) ===> 0

    But when extend all range in single formula
    =SUM(IFERROR(1/(COUNTIFS(A7:A680,A7:A680,B7:B680,F3,C7:C680,F2)),0)) ===> 7

    Regards.

  4. #4
    Registered User
    Join Date
    02-06-2013
    Location
    Pleasant Hill, CA
    MS-Off Ver
    Excel 365
    Posts
    27

    Re: Formula To Find Distinct Values With Criteria

    Glenn, that appears to work. Thank you!

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Formula To Find Distinct Values With Criteria

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. [SOLVED] get distinct values from criteria AND sum all of the values of the distinct
    By dluhut in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-10-2017, 02:57 PM
  2. Excel Macro to find unique distinct value based on Criteria
    By amir_khan in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-31-2014, 06:47 PM
  3. [SOLVED] Sum distinct values with two criteria
    By poptcorn in forum Excel General
    Replies: 5
    Last Post: 03-13-2014, 12:09 PM
  4. [SOLVED] sum distinct values given variable criteria
    By jsorbet in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 05-24-2013, 12:54 AM
  5. Formula to COUNTA distinct values with multiple criteria
    By f0urchette in forum Excel General
    Replies: 4
    Last Post: 02-20-2012, 04:54 AM
  6. Count distinct values with criteria
    By greencardioid in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-29-2008, 06:48 PM
  7. Find Distinct Values
    By Progress2007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-03-2008, 06:24 AM

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