Count unique values based on criteria in different column

Nelson78

Well-known Member
Joined
Sep 11, 2017
Messages
525
Office Version
  1. 2007
Hello.

I've in column D a lot of values with duplicates.

I've to count how many unique values in column D in relation to the value in column K same row.

For example: I need to know how many unique values in column D when column K = ABC12345

Thank's.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...

=SUM(IF(FREQUENCY(IF(K2:K10="ABC12345",IF(LEN(D2:D10)>0,MATCH(D2:D10,D2:D10,0))),ROW(D2:D10)-ROW(D2)+1)>0,1))

Adjust the ranges accordingly.

Hope this helps!
 
Upvote 0
Try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...

=SUM(IF(FREQUENCY(IF(K2:K10="ABC12345",IF(LEN(D2:D10)>0,MATCH(D2:D10,D2:D10,0))),ROW(D2:D10)-ROW(D2)+1)>0,1))

Adjust the ranges accordingly.

Hope this helps!

I'm going to try.

Anyway, perhaps in VBA is easier.
 
Upvote 0

Forum statistics

Threads
1,213,517
Messages
6,114,089
Members
448,548
Latest member
harryls

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