Hi DILIPandey,

I have had a chance to test the formula with my real data and everything is working fine. Thank you very much for your help once again, it's hugely appreciated.

Kind regards,
Matt