Relative position of Employees
Try this ("lightly" tested!)
Here is an example of my data:
1 A 7/27/83
2 A 9/23/84
3 A 2/28/87
4 B 9/22/84
5 A 3/15/89
6 B 10/3/84
7 B 6/10/85
8 B 7/12/88
Assume that data is in the range A1:C8
Enter this formula in D1 and copy down as needed:
=IF(B1="B",ROW()-MAX(INDEX((B$1:B$8="A")*(C$1:C$8<=C1)*ROW(C$1:C$8) ,,1)),"")
If you have 5000 rows of data this may be a little slow.
On a side note: What does this result mean?
Biff
"Bob Davison" wrote in message
...
Thank you for responding. I am not sure what you mean.
Here is an example of my data:
1 A 7/27/83
2 A 9/23/84
3 A 2/28/87
4 B 9/22/84
5 A 3/15/89
6 B 10/3/84
7 B 6/10/85
8 B 7/12/88
B employee #8 should return 5 (5 rows away from A employee hired ealier
than 7/12/88)
B employee #7 should return 5 (5 rows away from A employee hired ealier
than 6/10/85)
B employee #6 should return 4 (4 rows away from A employee hired ealier
than 10/3/84)
B employee #4 should return 3 (3 rows away from A employee hired ealier
than 10/3/84)
Thank you for helping!
Bob
"Barb Reinhardt" wrote in
message ...
The RANK function will give you the relative position if you do it based
on
HIRE DATE.
|