Thanks, that was very helpful.
I had tried removing the commas but didn't realise that I had the wrong algotithm!

I will do some testing on the data I have to see if it gives the correct results.