Into field C2 enter the formula
=((COUNTIFS($A$2:$A$58,$A2,$B$2:$B$58,">" & $B2)+1)=1)*(COUNTIFS($A$2:$A2,$A2,$B$2:$B2,$B2)=1)[/CODE]
, and copy down.
And sorting is not essential - the formula returns 1 for 1st record with latest date it finds for given item.
|