Automatically Update a Payroll Sheet from Another Excel Worksheet
Question details
Automatically populate payroll allocations by matching employees to imported ADP data on another worksheet.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A payroll worksheet needs to retrieve allocation amounts from an imported ADP worksheet using an employee ID or staff name.
- Observed behavior
- The desired result is for payroll amounts to update when the corresponding imported source data changes.
Check that the imported ADP data includes an employee identifier and the amount to retrieve. Prefer unique employee IDs, and make sure IDs use the same format in both worksheets.
Use XLOOKUP with Excel Tables
Use this method in Excel versions that support XLOOKUP, including Microsoft 365.
The example assumes each employee has one matching source row. XLOOKUP returns the first match, so multiple allocation rows per employee require a different approach, such as SUMIF.
Select the imported ADP data and choose Insert > Table. On the Table Design tab, name the table ADP and confirm that its columns are named EmployeeID and Amount.
Select the payroll range and choose Insert > Table. Ensure it has an EmployeeID column and a column for the retrieved amount.
In the first data cell of the payroll amount column, enter =XLOOKUP([@EmployeeID],ADP[EmployeeID],ADP[Amount],0). Excel can fill the formula down the table column.
Refresh or replace the imported ADP data in the source table. Add new rows within the table so its structured references include them, and check that the import preserves the table.

Use INDEX and MATCH in Older Excel Versions
Use this method when XLOOKUP is not available in your version of Excel.
Link Payroll Amounts to ADP Data in WPS Spreadsheet
Use INDEX and MATCH in WPS Spreadsheet to retrieve payroll amounts from an ADP worksheet and recalculate them when the source cells change.
- 1. Open the workbook: Open your Excel workbook in WPS Spreadsheet and place the imported source data on a worksheet named ADP.
- 2. Check the columns: On the ADP sheet, put employee IDs in column A and amounts in column B. On the payroll sheet, put the employee ID for the first employee in A2.
- 3. Enter the formula: In the first payroll amount cell, enter =IFERROR(INDEX(ADP!$B$2:$B$1000,MATCH(A2,ADP!$A$2:$A$1000,0)),0). Adjust the ranges if your source data extends beyond row 1000.
- 4. Fill and update: Drag the formula cell's fill handle down for the other employees. Update the ADP sheet when new data is available, then use File > Save to save the workbook.

Frequently Asked Questions
Can I match employees by name instead of ID?
Yes. Replace the EmployeeID references in the lookup formula with the corresponding name columns. IDs are safer because names may be duplicated or spelled differently.
What if an employee has multiple ADP allocation rows?
XLOOKUP and INDEX/MATCH return one matching row. To total multiple rows, use a formula such as =SUMIF(ADP[EmployeeID],A2,ADP[Amount]) if the amounts should be added together.
Will the formula import new ADP data automatically?
No. The formula retrieves values already in the workbook. Refresh the import or replace the source data in the ADP table; the formula then recalculates from that data.
Why does the formula return zero for an employee?
The ID may be missing or formatted differently in the two sheets. Compare the payroll ID with the ADP EmployeeID column, including whether one value is stored as text and the other as a number.




