Hi All

I have a query I have been racking my brain but I just can't get round it.

I have attached a sheet with some date on and an example of what the outcome needs to be. I'm hoping someone can come up with the formula that I need to make it work, I just have a complete mental block.

Thanks all in advance

Example.xlsx