Hi Simon
Can you give us more detail? How are you sorting your results in Moodle? As Marty advises Moodle will sort by lastname when exporting from the gradebook.
I do remember we had an issue once where two users had the same surname and when we exported the gradebook they were not alphabetically sorted by surname then firstname. I think Moodle exported surname then by ID number but could be wrong.
Cheers
Teresa