Counting unique values in a data table contingent on another field

ollieotis

New Member
Joined
Jun 6, 2006
Messages
44
Hello,

I'm trying to figure out which function to nest within the below to allow for counting of unique values in one column, contingent on a value in different column.

SUM(IF(FREQUENCY(MATCH(D7:D595,D7:D595,0),MATCH(D7:D595,D7:D595,0))>0,1))

Essentially, I'm trying to come up with a sumif like function, only to count unique values.

Example, column A contains the primary key, or Project code, column B contains the client code, and column C contains the salesperson assigned, with any particular client or salesperson having multiple project codes assigned. Is there a way to revise the above function to count number of unique client codes per salesperson?

Thanks in advance!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
if i'm understanding correctly maybe something like...


Excel 2012
ABCDE
1primaryclient codesalespersonjoe
2a123Z5555joe3
3b321x96mike
4a123a777joe
5b321x96joe
6c251Z5555joe

<tbody>
</tbody>
Sheet2

Array Formulas
CellFormula
E2{=SUM(IF(FREQUENCY(IF($C$2:$C$10<>"",IF($C$2:$C$10=$E$1,MATCH($B$2:$B$10,$B$2:$B$10,0))),ROW($B$2:$B$10)-ROW($B$2)+1),1))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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