Unique value count on sorted coloumn

merlin_the_magician

Active Member
Joined
Jul 31, 2002
Messages
480
Hello,

I'm struggling with a workbook that holds quite a lot of data. I would like to count unique values in column AX, whereas i also would like to be able to count unique values in case a sorting filter is used.

I made a matrix-formula for the general unique values count, that works perfectly:
{=SUM(IF(FREQUENCY(IF(LEN(AX9:AX414)>0,MATCH(AX9:AX414,AX9:AX414,0),""),IF(LEN(AX9:AX414)>0,MATCH(AX9:AX414,AX9:AX414,0),""))>0,1))}

I tried using =SUBTOTAL for the unique values count like this, but....
{=SUBTOTAL(9,(IF(FREQUENCY(IF(LEN(AX9:AX414)>0,MATCH(AX9:AX414,AX9:AX414,0),""),IF(LEN(AX9:AX414)>0,MATCH(AX9:AX414,AX9:AX414,0),""))>0,1))}
... that doen't work. The result is #VALUE

Any thoughts on this one please?
 
Last edited:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi,

a first attempt

Code:
=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET($AX$9:$AX$414,ROW($9:$414)-ROW($A$9),0,1)),MATCH($AX$9:$AX$414,$AX$9:$AX$414,0)),ROW(9:414)-ROW($A$9)+1)>0,--(LEN(AX$9:$AX$414)>0)))

Array entered

Regards
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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