+ Reply to Thread
Results 1 to 4 of 4

Modify a UDF that Counts Unique Values In Filtered Column

  1. #1
    Registered User
    Join Date
    07-14-2018
    Location
    Spain
    MS-Off Ver
    Microsoft 365 for enterprise & Excel 2019
    Posts
    11

    Modify a UDF that Counts Unique Values In Filtered Column

    Hi, I have this UDF for counting unique values in a column range that has an Autofilter in it. It works great:

    Please Login or Register  to view this content.
    I would like to modify this UDF so it can count the cells in the column that are unhidden and their value is equal to a word, for example "John". How can it be done?
    Thank you in advance

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Modify a UDF that Counts Unique Values In Filtered Column

    something like
    =Function CountUniqueFilteredIf(A1:A100,"John")
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-14-2018
    Location
    Spain
    MS-Off Ver
    Microsoft 365 for enterprise & Excel 2019
    Posts
    11

    Re: Modify a UDF that Counts Unique Values In Filtered Column

    It works fine, I only had to remove the word "Function" like this:

    Please Login or Register  to view this content.
    However I've realized it is a bit more complicated. The cell value that displays John or not is not the same as where I'm doing the Autofilter (Column A in your example) but 6 columns at the right (Column I in your example).
    Thanks

  4. #4
    Registered User
    Join Date
    07-14-2018
    Location
    Spain
    MS-Off Ver
    Microsoft 365 for enterprise & Excel 2019
    Posts
    11

    Re: Modify a UDF that Counts Unique Values In Filtered Column

    After thinking a little I found it. Here is the code, I just added the Offset property:

    Please Login or Register  to view this content.
    Thanks for your help

+ 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] Sum unique (filtered) values, without a helper column
    By arcarc1309 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-28-2022, 07:41 PM
  2. Extract unique values from filtered column
    By Journeyman3000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2020, 09:38 PM
  3. Extracting unique values from filtered column to array
    By Journeyman3000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2020, 03:22 AM
  4. Modify Unique Identifier Code to Place Values in Different Column
    By Erbro90 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2020, 07:50 PM
  5. Get unique values from column and get Counts and Sums based on these values
    By khhleung in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2014, 09:58 PM
  6. count unique values in filtered column
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-09-2013, 10:40 AM
  7. Count Unique Values in a Filtered Column
    By mashley in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-30-2008, 10:56 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