A million thank yous!

Not only did it work (I had to copy it into notepad and then into excel or it went funny and turned into text rather than a formula) but also after a fair time looking at it, fiddling with it and adapting it to another spreadsheet as well, I even understand it now!

Thank you again

R