Will an employees consecutive dates always be listed consecutively, or might there be:
John 2016-03-05
Mike 2016-02-03
John 2016-03-06
If the employees' leave dates will always be grouped together as you've shown, then the formula you listed isn't too far off. Something like this in D2 (then filled down) should work:
=COUNTIF($A$2:$A$2010,$D2)-SUMPRODUCT(($A$2:$A$2010=$D2)*($B$3:$B$2011-$B$2:$B$2010=1))
Bookmarks