+ Reply to Thread
Results 1 to 11 of 11

Count Unique with Criteria

  1. #1
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    MS365
    Posts
    74

    Count Unique with Criteria

    Hi Everyone,

    I have a data with 6 columns that contains various texts. These are a combination of either "Loc" with incremental value & "T" or "O". What I need is to count all unique values containing "T" and plot it in another column named "T", and count all unique values containing "O" and plot it in column named "O". I need formula for these two columns (Column T and O). Thank you.

    Sample data:

    RESULT
    D1 D2 D3 D4 D5 D6 T O
    Loc1-T Loc2-T Loc1-O Loc2-O Loc2-O 2 2
    Loc1-T Loc1-T Loc1-O Loc2-O Loc1-O Loc3-O 1 3
    Loc2-T Loc2-T Loc2-O Loc3-O Loc3-O 1 2
    Last edited by acerlaptop; 11-14-2022 at 11:38 PM.

  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 2403
    Posts
    43,984

    Re: Count Unique with Criteria

    Hi. Before we get going on this one...

    Is your forum profile showing the Excel version that you need this request to work with?

    The best solutions often rely on knowing WHICH version of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date. If you aren't sure, in Excel go to File/Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this.

    The three most recent versions of Excel are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the Version number in your profile (e.g. MS365 (PC) Version 2211). The version number is in the About Excel section further down the Account page.

    Cheers,

    Glenn.
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Count Unique with Criteria

    Hello acerlaptop.

    Would it be too much of a hassle for you to upload a workbook to the Forum that had the data sample and expected results handy somewhere?...

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

    Re: Count Unique with Criteria

    IF you're still using Excel 2013:

    Remove extraneous spaces in G2:

    =SUM(INDEX((RIGHT($A3:$F3,1)=G$2)*($A3:$F3<>"")/COUNTIF($A3:$F3,$A3:$F3&""),0))
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    MS365
    Posts
    74

    Re: Count Unique with Criteria

    Yeah sorry forgot to update the MS version.
    I'm using MS365, but will try out you formula.

    Thanks!

  6. #6
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    MS365
    Posts
    74

    Re: Count Unique with Criteria

    Sorry about that.

    Our company IT has a script in place that blocks any upload on any website so I cannot upload a sample file.

    Thanks!

  7. #7
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Taiwan
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,380

    Re: Count Unique with Criteria

    Cell G3 formula , Drag down and across
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: Count Unique with Criteria

    With O365:
    =LET(d,$A3:$F3,COLUMNS(UNIQUE(FILTER(d,RIGHT(d,1)=G$2),1)))
    Attached Files Attached Files

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

    Re: Count Unique with Criteria

    or (copied across):
    =BYROW($A3:$F5,LAMBDA(x,COUNTA(UNIQUE(FILTER(x,RIGHT(x,1)=G$2),1))))

    ensure rows BELOW formula are blank, to accept SPILL results.

  10. #10
    Registered User
    Join Date
    10-21-2014
    Location
    Makati
    MS-Off Ver
    MS365
    Posts
    74

    Re: Count Unique with Criteria

    Quote Originally Posted by Glenn Kennedy View Post
    or (copied across):
    =BYROW($A3:$F5,LAMBDA(x,COUNTA(UNIQUE(FILTER(x,RIGHT(x,1)=G$2),1))))

    ensure rows BELOW formula are blank, to accept SPILL results.
    Your formula:
    =SUM(INDEX((RIGHT($A3:$F3,1)=G$2)*($A3:$F3<>"")/COUNTIF($A3:$F3,$A3:$F3&""),0))
    already worked fine in Office 365.

    Will try out your other 2 formulas and see which is better, but I'll be tagging this as SOLVED. Thanks for the help.

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

    Re: Count Unique with Criteria

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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. Please help.. need to count unique with Criteria
    By rxgrahul in forum Excel General
    Replies: 2
    Last Post: 08-17-2015, 09:03 AM
  2. Count Unique with Criteria
    By david0985 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-20-2015, 07:36 PM
  3. [SOLVED] Count unique entries based off unique criteria in another column
    By hambly in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 06-11-2014, 03:33 PM
  4. Help on Unique SLA Count with Criteria
    By Charoum in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-13-2013, 08:00 PM
  5. [SOLVED] COUNT IF UNIQUE VALUE and CRITERIA
    By Charoum in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-28-2013, 01:51 AM
  6. [SOLVED] Unique Count with Criteria
    By MitchC in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2013, 05:49 AM
  7. [SOLVED] changing a current mod (count unique visible cells ->count unique visible cells criteria
    By liranbo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2012, 03:58 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