Thanks Pete, that is a nice solution.

Unfortunately I need both samples to work at the same time, otherwise I would have to do a lot of manual workarounds in my original spreadsheet.

Cheers,
Al