+ Reply to Thread
Results 1 to 7 of 7

SUMPRODUCT and FREQUENCY to return unique values based on criteria

  1. #1
    Registered User
    Join Date
    05-25-2020
    Location
    Denmark
    MS-Off Ver
    Professional Plus 2016
    Posts
    58

    SUMPRODUCT and FREQUENCY to return unique values based on criteria

    Hi,
    I am trying to count how may unique values there are in C based on based on B and E.

    Currently I have. Result should be 2 but formula returns 3. Sample enclosed.

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


    Thanks
    Thomas
    Attached Files Attached Files
    Last edited by thomasuponor; 03-26-2021 at 08:27 AM.

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUMPRODUCT and FREQUENCY to return unique values based on criteria

    your values in C are different (one has trailing space the other does not)

    I would probably use:

    =SUM(SIGN(FREQUENCY(IF($E$2:$E$14=K$1;IF(TEXT($B$2:$B$14;"yymm")=TEXT($I2;"yymm");MATCH(TRIM($C$2:$C$14);TRIM($C$2:$C$14);0)));ROW($1:$5988))))
    confirmed with CTRL + SHIFT + ENTER

    the embedded IF approach will limit the 'expense' of the overall calculation -- more relevant if (in real-life) you're using in large volume, or with large ranges

  3. #3
    Registered User
    Join Date
    05-25-2020
    Location
    Denmark
    MS-Off Ver
    Professional Plus 2016
    Posts
    58

    Re: SUMPRODUCT and FREQUENCY to return unique values based on criteria

    Hi, I see the idea but unfortunately it's not working. I am attaching bigger sample.

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: SUMPRODUCT and FREQUENCY to return unique values based on criteria

    not sure I follow, if I open the file and calculate - I get the answer of 2; what are you expecting ?

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: SUMPRODUCT and FREQUENCY to return unique values based on criteria

    Please try at G2

    =COUNT(1/FREQUENCY(IF($C$2:$C$7000=G$1;IF($A$2:$A$7000>=$E2;IF($A$2:$A$7000<EDATE($E2;1);MATCH($B$2:$B$7000;$B$2:$B$7000;))));ROW($B$1:$B$7000)))

    Ctrl+Shift+Enter
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-25-2020
    Location
    Denmark
    MS-Off Ver
    Professional Plus 2016
    Posts
    58

    Re: SUMPRODUCT and FREQUENCY to return unique values based on criteria

    If you try it on the new sample with larger data set then it's not working. If you try to H2=UFH you get 144. The result should be 72.

  7. #7
    Registered User
    Join Date
    05-25-2020
    Location
    Denmark
    MS-Off Ver
    Professional Plus 2016
    Posts
    58

    Re: SUMPRODUCT and FREQUENCY to return unique values based on criteria

    Yes. that's exactly what I was looking for! THX

+ 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. Sumproduct formula to ignore duplicates or return unique values only
    By Xsample in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-08-2022, 11:09 AM
  2. Formula to return unique values based on 4 criteria
    By thomasuponor in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-24-2020, 05:15 AM
  3. [SOLVED] SUMPRODUCT function count the Unique values based on Multiple criteria
    By savetrees in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-15-2018, 04:03 AM
  4. [SOLVED] FREQUENCY of unique value and SUM of unique values based on criteria
    By dcathey5 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-05-2017, 11:02 AM
  5. Using sum if frequency to count unique values based on certain criteria
    By Matthew_Smith86 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-08-2015, 05:27 AM
  6. Select multiple criteria based on check box selection and return all unique values.
    By TommyToe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 09:14 AM
  7. Frequency of unique values meeting multiple criteria
    By systemsteve in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-30-2008, 09:50 AM

Tags for this Thread

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