Counting Unique values with multiple criteria

fayez_MrExcel

Active Member
Joined
Oct 29, 2005
Messages
437
Office Version
  1. 365
Platform
  1. Windows
Im trying to count a unique value (i.e. the employee no. with 2 criteria: first is the job category (i.e in E3) and the other employee type (i.e. in F3), my below formula is only for criteria. Im trying to put "AND" but the result is wrong. Pls assist to add the second criteria which is employee type (i.e. in F3). Thanks

=SUM(--(FREQUENCY(IF(TC_JobCategory=E3,MATCH(TC_EmpNo,TC_EmpNo,0)),ROW(TC_EmpNo)-ROW(E3)+1)>0))
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi Dear,

Try the following (adjust where required)
=SUM(--(FREQUENCY(IF(TC_JobCategory=E3,MATCH(TC_EmpNo&EmpType,TC_EmpNo&EmpType,0)),ROW(TC_EmpNo)-ROW(E3)+1)>0))
 
Upvote 0
Can you please share a sample sheet or a screenshot, it would be easier for me to suggest the amendments to your working formula

Regards
 
Upvote 0
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’).

For the sample suggested by mamady it would be good to use XL2BB to make it easier for helpers by not having to manually type out sample data to test with.
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,913
Members
448,532
Latest member
9Kimo3

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