EmployeeID and Dept are true numbers, right?
I believe so. It is an actual number, but the format is "general."
[TABLE="width: 456"]
<TBODY>[TR]
[TD="class: xl67, width: 150, bgcolor: white"]
EmployeeID
[/TD]
[TD="class: xl67, width: 90, bgcolor: white"]
Dept
[/TD]
[TD="class: xl68, width: 26, bgcolor: transparent"][/TD]
[TD="class: xl68, width: 25, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 118, bgcolor: white"]
Dept List
[/TD]
[TD="class: xl67, width: 201, bgcolor: white"]
Count Distinct ID's
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 150, bgcolor: white"]
172705497
[/TD]
[TD="class: xl65, width: 90, bgcolor: white"]
1000
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"]
1000
[/TD]
[TD="class: xl65, width: 201, bgcolor: white"]
3
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 150, bgcolor: white"]
172705497
[/TD]
[TD="class: xl65, width: 90, bgcolor: white"]
1000
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"]
4000
[/TD]
[TD="class: xl65, width: 201, bgcolor: white"]
1
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 150, bgcolor: white"]
172717693
[/TD]
[TD="class: xl65, width: 90, bgcolor: white"]
4000
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"]
1100
[/TD]
[TD="class: xl65, width: 201, bgcolor: white"]
1
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 150, bgcolor: white"]
172717693
[/TD]
[TD="class: xl65, width: 90, bgcolor: white"]
4000
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"][/TD]
[TD="class: xl65, width: 201, bgcolor: white"][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 150, bgcolor: white"]
172724808
[/TD]
[TD="class: xl65, width: 90, bgcolor: white"]
1100
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"][/TD]
[TD="class: xl65, width: 201, bgcolor: white"][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 150, bgcolor: white"]
172737704
[/TD]
[TD="class: xl65, width: 90, bgcolor: white"]
1000
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"][/TD]
[TD="class: xl65, width: 201, bgcolor: white"][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 150, bgcolor: white"]
172744009
[/TD]
[TD="class: xl65, width: 90, bgcolor: white"]
1000
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"][/TD]
[TD="class: xl65, width: 201, bgcolor: white"][/TD]
[/TR]
</TBODY>[/TABLE]
Let Sheet1, A:B, from row 2 downwards, house the data of interest.
Define EmpID as referring to:
Rich (BB code):
=Sheet1!$A$2:INDEX(Sheet1!$A:$A,MATCH(9.99999999999999E+307,Sheet1!$A:$A))
Dept as:
Rich (BB code):
=Sheet1!$B$2:INDEX(Sheet1!$B:$B,MATCH(9.99999999999999E+307,Sheet1!$B:$B))
Ivec as:
Rich (BB code):
=ROW(EmpID)-ROW(INDEX(EmpID,1,1))+1
E2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(INDEX(Dept,SMALL(IF(FREQUENCY(IF(Dept<>"",
MATCH(Dept,Dept,0)),Ivec),Ivec),ROWS($E$2:E2))),"")
F2, control+shift+enter and copy down:
Rich (BB code):
=IF($E2="","",SUM(IF(FREQUENCY(IF(EmpID<>"",IF(Dept=$E2,
MATCH(EmpID,EmpID,0))),ROW(EmpID)-ROW(INDEX(EmpID,1,1))+1),1)))
See:
https://dl.dropboxusercontent.com/u...lUniqueCount DynamicSetUp Sean Christian.xlsx