A sample workbook of your actual data would be good, both my code and Mancubus' code worked fine for me (with a little change i indicated ) so it must be your data or how it's presented.

EDIT: added sample workbook, although mancubus' code gives different results and at this time are incorrect, i'll take a look when i have time.