Thank you both very much - this was just what I was looking for.

I gave you both rep, but as davesexcel got there first I will mark his answer as the solved one. Also thanks for the Pivot suggestion Aardigspook, but the array will work for me.