Function Problems

Autofill Excel Data from a Changing List by ID

Phi Hung VoPhi Hung Vo Nov 18, 2026 869 views

Question details

Populate a master worksheet with values from a pasted table by matching a stable company or account number.

Autofill Excel Data from a Changing List by ID
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user regularly pastes updated data into a separate worksheet, and the order of the records may change.
Observed behavior
The master worksheet should retrieve each company's matching values regardless of the pasted row order.
Before you start

Place the company or account IDs in column A of both the master sheet and a sheet named Paste Here. Make sure matching IDs use the same format and are unique in the pasted data.

Solution 1Recommended

Use XLOOKUP when the source columns stay in the same order

Match each master-sheet ID to a source ID when rows change order but the desired value stays in a fixed column.

1
Paste the source table

On the Paste Here sheet, paste the updated table with IDs in column A and the values to retrieve in column B.

2
Enter the lookup formula

On the master sheet, select B2 and enter =XLOOKUP($A2,'Paste Here'!$A:$A,'Paste Here'!$B:$B,""). The empty string returns a blank if the ID is not found.

3
Fill the formula down

Drag the fill handle from B2 down alongside the IDs in column A. For another source field, copy the formula to its master column and change the return range to the corresponding source column.

4
Replace the pasted data

Paste each updated table into Paste Here with the same column layout. The formulas will find the matching IDs even if the rows move.

Use XLOOKUP when the source columns stay in the same order
Check your Excel version: XLOOKUP is available in newer versions of Excel. If it is unavailable, use the INDEX and MATCH solution below.
Work with changing spreadsheet data

Match company data by ID in WPS Spreadsheets

Use INDEX and MATCH in WPS Spreadsheets to retrieve values from a pasted table by company ID and column header, even when rows or columns move.

  1. 1. Open the workbook: Open the Excel workbook in WPS Spreadsheets and select the sheet containing the master company IDs.
  2. 2. Prepare the source sheet: On a sheet named Paste Here, paste the source table with IDs in column A and field headers in row 1. Enter matching field headers on the master sheet.
  3. 3. Add the lookup formula: Select B2 on the master sheet and enter =INDEX('Paste Here'!$A:$Z,MATCH($A2,'Paste Here'!$A:$A,0),MATCH(B$1,'Paste Here'!$A$1:$Z$1,0)).
  4. 4. Fill and save: Drag the fill handle across the desired fields and down the listed IDs, then use File > Save As to save the workbook in Excel format.
Match company IDs and field headers as the pasted table changes.Open and edit Microsoft Excel XLSX and XLS files.Use a familiar spreadsheet interface to fill formulas across rows and columns.Work with spreadsheets using the free WPS Office suite.
microsoft office alternative - wps office

Frequently Asked Questions

Will the lookup still work if the pasted rows change order?

Yes. XLOOKUP and MATCH search for the ID in the source column rather than relying on a fixed row position.

What if the source columns change order too?

Use INDEX with two MATCH functions: one for the ID and one for the header. Keep the master and source header names consistent.

Why does a matching company ID return an error?

Check that the ID exists in Paste Here column A and that both sheets use the same data type, such as text or numbers. For the two-way lookup, also check the header text.

Will new companies appear automatically on the master sheet?

These formulas retrieve data for IDs already listed on the master sheet. Enter new IDs in column A and fill the formulas down to their rows.

What happens if the pasted table contains duplicate IDs?

XLOOKUP and MATCH return the first matching ID. Make source IDs unique if each master row should correspond to one company.