I don't think you can modify the file I provided and upload it back.
A range of 500,000 rows is indeed big. Have a look at solutions that runs SQL on data in Excel as Fazza, a user of thos board, auggested a few times..
Would you also have a look at the following set up?
[TABLE="width: 576"]
<TBODY>[TR]
[TD="class: xl67, width: 125, bgcolor: white"]
EmployeeID
[/TD]
[TD="class: xl67, width: 138, bgcolor: white"]
Dept
[/TD]
[TD="class: xl67, width: 150, bgcolor: white"]
0
[/TD]
[TD="class: xl68, width: 25, bgcolor: transparent"][/TD]
[TD="class: xl66, width: 118, bgcolor: transparent, align: right"]
3
[/TD]
[TD="class: xl66, width: 213, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 125, bgcolor: white"]
172705497
[/TD]
[TD="class: xl65, width: 138, bgcolor: white"]
1000
[/TD]
[TD="class: xl65, width: 150, bgcolor: white"]
1
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl67, width: 118, bgcolor: white"]
Dept List
[/TD]
[TD="class: xl67, width: 213, bgcolor: white"]
Count Distinct ID's
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 125, bgcolor: white"]
172705497
[/TD]
[TD="class: xl65, width: 138, bgcolor: white"]
1000
[/TD]
[TD="class: xl65, width: 150, bgcolor: white"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"]
1000
[/TD]
[TD="class: xl65, width: 213, bgcolor: white"]
3
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 125, bgcolor: white"]
172717693
[/TD]
[TD="class: xl65, width: 138, bgcolor: white"]
4000
[/TD]
[TD="class: xl65, width: 150, bgcolor: white"]
2
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"]
4000
[/TD]
[TD="class: xl65, width: 213, bgcolor: white"]
1
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 125, bgcolor: white"]
172717693
[/TD]
[TD="class: xl65, width: 138, bgcolor: white"]
4000
[/TD]
[TD="class: xl65, width: 150, bgcolor: white"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"]
1100
[/TD]
[TD="class: xl65, width: 213, bgcolor: white"]
1
[/TD]
[/TR]
[TR]
[TD="class: xl65, width: 125, bgcolor: white"]
172724808
[/TD]
[TD="class: xl65, width: 138, bgcolor: white"]
1100
[/TD]
[TD="class: xl65, width: 150, bgcolor: white"]
3
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"][/TD]
[TD="class: xl65, width: 213, bgcolor: white"][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 125, bgcolor: white"]
172737704
[/TD]
[TD="class: xl65, width: 138, bgcolor: white"]
1000
[/TD]
[TD="class: xl65, width: 150, bgcolor: white"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"][/TD]
[TD="class: xl65, width: 213, bgcolor: white"][/TD]
[/TR]
[TR]
[TD="class: xl65, width: 125, bgcolor: white"]
172744009
[/TD]
[TD="class: xl65, width: 138, bgcolor: white"]
1000
[/TD]
[TD="class: xl65, width: 150, bgcolor: white"][/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[TD="class: xl65, width: 118, bgcolor: white"][/TD]
[TD="class: xl65, width: 213, bgcolor: white"][/TD]
[/TR]
</TBODY>[/TABLE]
C1 must house a 0.
C2, just enter and copy down:
Rich (BB code):
=IF(ISNUMBER(MATCH(B2,$B$1:B1,0)),"",LOOKUP(9.99999999999999E+307,$C$1:C1)+1)
E1, just enter:
Rich (BB code):
=LOOKUP(9.99999999999999E+307,C:C)
E3, just enter and copy down:
Rich (BB code):
=IF(ROWS($E$3:E3)<=$E$1,LOOKUP(ROWS($E$3:E3),C:C,B:B),"")
F3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF($E3="","",SUM(IF(FREQUENCY(IF(Dept=$E3,EmpID),EmpID),1)))
where, like before,
Dept is defined as:
Rich (BB code):
=Sheet1!$B$2:INDEX(Sheet1!$B:$B,MATCH(9.99999999999999E+307,Sheet1!$B:$B))
and
EmpID as:
Rich (BB code):
=Sheet1!$A$2:INDEX(Sheet1!$A:$A,MATCH(9.99999999999999E+307,Sheet1!$A:$A))
Note. Employee id's are assumed to be numbers.
See:
https://dl.dropboxusercontent.com/u...bara ConditionalUniqueCount DynamicSetUp.xlsx
Does the foregoing deliver an acceptable efficiency score?