+ Reply to Thread
Results 1 to 16 of 16

The number of unique values in a matrix

  1. #1
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,410

    The number of unique values in a matrix

    I want to determine the number of unique values in a matrix.
    A similar question is posted on https://www.helpmij.nl/forum/showthr...unieke-waarden
    but we only found difficult or slow solutions:
    Please Login or Register  to view this content.
    Are there for 365 users also better or simpler solutions (without VBA)?
    Attached Files Attached Files
    Last edited by HansDouwe; 08-09-2022 at 12:48 AM.

  2. #2
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,287

    Re: The number of unique values in a matrix

    Power Query
    Please Login or Register  to view this content.
    "
    Attached Files Attached Files
    Last edited by Czeslaw; 08-09-2022 at 04:04 AM.

  3. #3
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,410

    Re: The number of unique values in a matrix

    Thx for your quick response with a new solution in Powerquery.

    I'm not familiar with Powerquery yet.
    How do I run this query?
    I only see "connection only" on Query Table1 in the added file and cannot refresh it.

  4. #4
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: The number of unique values in a matrix

    hello,
    is that count case sensitive (hoofdlettergevoelig) otherwise your first formula is a problem
    i prefer a dictionary
    Please Login or Register  to view this content.
    PS. this function is very quick !
    Alias : Cow18
    Attached Files Attached Files
    Last edited by bsalv; 08-09-2022 at 01:17 AM.
    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: The number of unique values in a matrix

    Is this simple enugh for you?

    =COUNTA(UNIQUE(FILTERXML("<z><m>"&TEXTJOIN("</m><m>",,A1:L12)&"</m></z>","//m")))

    I doubt you'll get anything shorter.
    Attached Files Attached Files
    Last edited by AliGW; 08-09-2022 at 01:58 AM. Reason: Added example workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,410

    Re: The number of unique values in a matrix

    Quote Originally Posted by bsalv View Post
    hello,
    is that count case sensitive (hoofdlettergevoelig) otherwise your first formula is a problem
    Alias : Cow18
    No the count should not be case sensitive, Indeed the first formula is case sensitive.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: The number of unique values in a matrix

    Was post #5 of any use? Maybe you didn't see it ...

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,410

    Re: The number of unique values in a matrix

    Quote Originally Posted by AliGW View Post
    Is this simple enugh for you?

    =COUNTA(UNIQUE(FILTERXML("<z><m>"&TEXTJOIN("</m><m>",,A1:L12)&"</m></z>","//m")))
    Yes, it is useful to add tags directly in the TEXTJOIN.
    Only the FILTERXML I find user-unfriendly, because you have to add tags, of which I can never remember the exact syntax.
    But so be them.
    Thanks for this solution.

  9. #9
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,377

    Re: The number of unique values in a matrix

    Power Query, loaded. Refresh the Query with right click --> refresh
    Attached Files Attached Files

  10. #10
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,410

    Re: The number of unique values in a matrix

    Thx JEC, this also works well.

  11. #11
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: The number of unique values in a matrix

    Dutch-speaking get-together

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: The number of unique values in a matrix

    I'm not Dutch, though, and nor is Czeslaw.

  13. #13
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,410

    Re: The number of unique values in a matrix

    I don't see any text in this tread. Maybe they will come back after a new message is posted. Hence this try.

    Edit: Yes trick worked. The text in this tread is back.
    Last edited by HansDouwe; 08-23-2022 at 06:42 AM.

  14. #14
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,377

    Re: The number of unique values in a matrix

    @AliGW, I bet you already know, but there is a problem with the search functionality. Once you search for topics, all answers are invisible.

  15. #15
    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,986

    Re: The number of unique values in a matrix

    If you have signed up for office insider:

    =LET(r,TOCOL(A1:L12),ROWS(UNIQUE(FILTER(r,r<>""))))
    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

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: The number of unique values in a matrix

    Quote Originally Posted by JEC. View Post
    @AliGW, I bet you already know, but there is a problem with the search functionality. Once you search for topics, all answers are invisible.
    Same fix as above - refresh the page and see if the search results appear.

+ 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] Count number of unique values corresponding to unique data in another column
    By STUARTXL in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-26-2019, 12:32 PM
  2. return unique values from matrix; matching a criteria
    By nielsb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-01-2019, 11:59 PM
  3. Sum values with lookup number specified by another matrix
    By pewterpawn in forum Excel General
    Replies: 4
    Last Post: 04-06-2017, 05:33 PM
  4. Find unique values in an a 10x10 matrix
    By john.keith.19 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-09-2015, 09:17 PM
  5. [SOLVED] Sum selected values in matrix based on date range as well as unique identifier in row
    By smansyd in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-09-2014, 07:56 PM
  6. [SOLVED] Return row number of complex matrix values
    By triangulo in forum Excel General
    Replies: 12
    Last Post: 10-30-2013, 08:03 AM
  7. [SOLVED] Find x number of lowest values from a 200 x 200 matrix
    By Grotifant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2005, 10:06 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