To sort by last name on Gradescope you will need to upload two separate columns for first and last names (rather than a single full name column). By uploading split names you will also get separate columns when you download grade spreadsheets.
If you have already uploaded a roster with full names or if you synced your roster with your LMS and only got full names back, you can redownload the roster by clicking the Download Roster button in the bottom right corner of the Course Roster page. Then in Excel, you can then quickly split up the full names into two separate columns of first and last names by going to
Data->Text to Columns.
Once you have a spreadsheet with separate first/last name columns, you would upload it to your existing Gradescope roster page (all grades and other student data will be preserved). If you do this, the “swap” button will appear for your course, and you’ll be able to sort alphabetically by last name.