Function Problems

How to Keep Student Grades Aligned When Excel Tables Are Sorted

Phi Hung VoPhi Hung Vo Nov 13, 2026 869 views

Question details

The user needs to keep student names and grade records aligned across multiple worksheets when the source table in WPS Spreadsheets is sorted.

How to Keep Student Grades Aligned When Excel Tables Are Sorted
Product
WPS Spreadsheets
Device & OS
not provided
Scenario
A teacher or grade manager is sorting a student roster and wants linked grade worksheets to update without breaking row alignment.
Observed behavior
Simple cell links or independently sorted ranges may not keep related data aligned after sorting the source table.
Before you start

Before sorting, give each student a unique ID in the source table and open all related worksheets so you can verify which cells use direct references or formulas.

Solution 1

Keep all student name and grade columns in the same table

Use this when you only need to sort one worksheet and can avoid maintaining parallel separate ranges.

1
Select the entire data range

In WPS Spreadsheets, click any cell inside the student table and press Ctrl+A to select the current range, or drag to include all columns such as Student ID, Name, and Grades.

2
Open the Sort dialog

Go to the Data tab and click Sort.

3
Choose the sort column and apply

Select the column you want to sort by, set the order, and click OK. WPS sorts all selected columns together, so each student's grade stays next to their name.

Selection matters: If you select only the Name column, WPS may sort just that column and detach the related grades.
WPS Spreadsheets

Keep Student Grades Aligned with Lookup Formulas in WPS Spreadsheets

Use WPS Spreadsheets to organize student records in sortable Excel-compatible tables and retrieve grades with XLOOKUP, VLOOKUP, or INDEX and MATCH, so linked worksheets stay aligned when the source table is sorted.

  1. 1. Open your workbook in WPS Spreadsheets: Launch WPS Office, open the Excel workbook containing the student grade tables, or create a new spreadsheet and import the data.
  2. 2. Add unique Student IDs: In the source worksheet, insert a Student ID column and assign a unique value to each student in the same table as the name and grade.
  3. 3. Apply a lookup formula in the linked worksheet: In the sheet where you need the aligned grades, enter an XLOOKUP or VLOOKUP formula that matches the Student ID and returns the grade from the source table.
  4. 4. Sort the source table as a whole: Select the entire source table, click Data > Sort, choose the sort column and order, then click OK. The lookup-linked grade cells update automatically.
Prevents grade misalignment when sorting student rostersCreates stable cross-worksheet links using Student IDOpens, edits, and saves Microsoft Excel .xlsx files with full compatibilityFree, lightweight Office alternative with a familiar spreadsheet interface
QA img-9

Frequently Asked Questions

Why do my linked grades break when I sort the Excel table?

Direct cell references or Paste Link connect cells by position, not by student. When you change the row order, those references point to the new row in the old location. Use one shared table or a lookup formula that matches Student ID instead.

Can I use VLOOKUP to keep student names and grades aligned?

Yes. Put Student ID in the first column of the lookup range, then use VLOOKUP(StudentID, SourceRange, GradeColumnNumber, FALSE). In WPS Spreadsheets, this returns the grade based on ID and remains correct after sorting.

Should I keep names and grades in the same sheet?

If you do not need cross-sheet links, yes. Keep related columns in one table and sort the whole table instead of sorting individual columns. This avoids most misalignment issues.

Does XLOOKUP work in WPS Spreadsheets?

WPS Spreadsheets supports XLOOKUP in current versions. If your version does not have it, use VLOOKUP or INDEX and MATCH for the same sort-safe lookup behavior.

What if two students have the same name?

Use a unique Student ID for each student. Lookup formulas then return the correct record even when duplicate names exist, while sorting by name remains safe.