How to count unique alhpanum values in a filtered column ignoring blank cells

jael36

New Member
Joined
Jan 19, 2016
Messages
6
Hi All,

I think the title says it all...

In a given column I may have duplicate values (i.e.: someones initials).
These values may be in multiple cells in that same column.
I have filters set on this column so I can quickly find the tasks associated to those initials per row.
Unfortunately, I have rows that don't have any initials and are left blank.

What I would like to do is be able to have a count of the number of unique initials/people in that column when a)unfiltered b)filtered.

I am using the following formula but it provides the wrong count (haven't quite figured out how the value is being calculated as it is).
{=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B6,ROW(B6:B106)-ROW(B6),0)),MATCH(B6:B106,B6:B106,0)),MATCH(B6:B106,B6:B106,0)),1))}

I've attached a screenshot of the type of data I have.
Let me know if you need an excel to work with and I will have to clean it up a bit.https://drive.google.com/folderview?id=0B_ypyEjzfat2QlVlT3JaZkZJalE&usp=sharing

Thanks for your help!
J
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi and welcome to the forum,

Perhaps try the following (using CTRL-SHIFT-ENTER rather than just ENTER as these are array formulae):

Unfiltered:

Code:
=SUM(
    IF(
      FREQUENCY(
        IF(
          B6:B106 <> "",
          MATCH("~" & B6:B106, B6:B106 & "", 0)),
        ROW(B6:B106) - ROW(B6) + 1),
      1))

Filtered:

Code:
=SUM(
    IF(
      FREQUENCY(
        IF(B6:B106 <> "",
        IF(
          SUBTOTAL(3, OFFSET(B6, ROW(B6:B106) - ROW(B6), 0)),
          MATCH("~" & B6:B106, B6:B106 & "", 0))),
        ROW(B6:B106) - ROW(B6:B106) + 1),
      1))
 
Upvote 0
Hi @circledchicken, sorry for the delayed reply.

So that seemed to help, but it seems to be counting the filters to a max count of 2.

so if i put a filter on a column, I should count 6 unique visible values (excluding blanks of course), but the count is 2.
this happens on any column

thoughts?
 
Upvote 0
Hi,

That shouldn't happen. Make sure you press CTRL-SHIFT-ENTER rather than just ENTER to confirm the formulae.

If it still doesn't work please provide a small sample dataset showing the result you are getting vs the expected result.
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,372
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top