# Thread: Count unique values based on criteria in different column Thanks: 0 Likes: 0

1. ## Count unique values based on criteria in different column

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.

2. ## Re: Count unique values based on criteria in different column

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!

3. ## Re: Count unique values based on criteria in different column

Originally Posted by Domenic
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.

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•