Function Problems

How to Keep Linked Data Matched After Sorting Excel Tables

Emma BrownEmma Brown Nov 10, 2026 868 views

Question details

The user needs a way to prevent manually entered statistics from mismatching with linked employee details after the master employee list is sorted.

How to Keep Linked Data Matched After Sorting Excel Tables
Product
Excel
Device & OS
not provided
Scenario
Sorting a master list that is dynamically linked to monthly sheets containing manually entered data.
Observed behavior
Linked employee details update dynamically based on their row position, but manual data stays in the original row, causing the statistics to align with the wrong employee.
Before you start

Ensure each employee in your master list has a unique identifier, such as an Employee Number, and create a backup of your workbook before applying new formulas.

Solution 1Recommended

Use XLOOKUP and Unique Identifiers to Link Data

Replace direct cell references with XLOOKUP formulas based on a permanent Employee Number to keep data correctly aligned on all sheets.

When you use direct cell references (like '=Master!A2'), sorting the master list changes the linked values on other sheets without moving the manually typed data next to them. Using a unique identifier alongside lookup formulas solves this by searching for the exact person rather than their row position.

1
Add static Employee Numbers

Enter the unique Employee Number manually as a static input (not a formula) in the first column of your monthly sheet.

2
Insert the XLOOKUP formula

In the adjacent columns where you want employee details to appear, enter an XLOOKUP formula to fetch data from the master list. For example: =XLOOKUP($A2, MasterList[EMP#], MasterList[Position], "").

3
Enter manual statistics

Type your monthly statistics into the columns next to the lookup formulas. Since the Employee Number is static, the manual data remains permanently matched to the correct employee.

4
Update the master list safely

You can now sort the master list at any time. The monthly sheets will remain unaffected because the formulas search for the specific Employee Number rather than relying on a fixed row position.

Use XLOOKUP and Unique Identifiers to Link Data
Handling New Employees: When a new employee joins, you will need to manually add their Employee Number to the bottom of the monthly sheets, or automate the addition using Power Query.

Easily Manage and Link Data with WPS Spreadsheet

WPS Spreadsheet provides powerful data management tools, including advanced lookup functions like XLOOKUP, VLOOKUP, and seamless table sorting to ensure your employee statistics stay perfectly matched.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open your employee master list and monthly sheets.
  2. 2. Apply XLOOKUP: Select the target cell, click on 'Insert Function' from the Formulas tab, and choose XLOOKUP to link data by Employee Number.
  3. 3. Sort with confidence: Highlight your master table, navigate to the Data tab, and use the Sort feature without worrying about misaligned monthly data.
Supports advanced functions like XLOOKUP and VLOOKUP for accurate data linkingFully compatible with Microsoft Excel (.xlsx) formatsLightweight and runs smoothly on older devicesFree built-in templates for employee management and HR tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why does my data get mixed up when I sort in Excel?

If you only highlight specific columns before sorting instead of the entire table, or if you use direct cell references across sheets, the sorted data will shift while unselected or static manual data stays in place.

Can I use VLOOKUP instead of XLOOKUP for this?

Yes, VLOOKUP can also link data based on an Employee Number. However, XLOOKUP is generally more flexible because it can look up data in any direction and handle missing values easily without nested IFERROR functions.

How do I automatically add new employees to the monthly sheets?

You can use Power Query to append new entries from the master list dynamically, or write a short VBA macro or Office Script to update all monthly sheets whenever a new employee ID is added to the master list.