Function Problems

How to Pull Matching Data from Another Excel Sheet by Loan Number

Steven ParkerSteven Parker Nov 11, 2026 869 views

Question details

Retrieve an invoice or investment value from a secondary report into a master sheet when the loan numbers match.

How to Pull Matching Data from Another Excel Sheet by Loan Number
Product
Spreadsheet
Device & OS
not provided
Scenario
Consolidating financial data across multiple reports based on a unique identifier, such as a loan number.
Observed behavior
Requires an efficient formula to cross-reference loan numbers between two sheets and extract the corresponding data values into the correct rows.
Before you start

Verify that both your master sheet and the secondary report are open, and ensure the 'Loan Number' columns in both sheets share the exact same data format (e.g., both are formatted as Text or both as Numbers) to avoid formula mismatch errors.

Solution 1Recommended

Use the XLOOKUP Function (Recommended)

XLOOKUP is the most efficient and modern function to find a matching loan number and return corresponding values without worrying about the order of your columns.

The XLOOKUP function replaces older functions like VLOOKUP. It allows you to look up a value in one column and return a corresponding value from another column, even if the return column is to the left of your lookup array.

1
Select the destination cell

Click on the first empty cell in your master sheet where you want the retrieved value (e.g., the invoice amount) to appear.

2
Enter the XLOOKUP formula

Type `=XLOOKUP(A2, 'Sheet 2'!B:B, 'Sheet 2'!A:A, "")` into the formula bar. In this example, 'A2' represents the cell containing the loan number in your current sheet.

3
Adjust the ranges

Replace 'Sheet 2'!B:B with the actual column containing the loan numbers in your secondary report, and 'Sheet 2'!A:A with the column containing the data you want to pull back.

4
Apply to all rows

Press Enter to view the result. Then, click the small square fill handle at the bottom-right corner of the cell and drag it down to apply the formula to the remaining rows.

Use the XLOOKUP Function (Recommended)
Handling Missing Matches: The empty quotation marks `""` at the end of the formula instruct the software to leave the cell blank instead of displaying an ugly #N/A error if a loan number cannot be found.
Advanced Data Management

Use WPS Spreadsheet to Easily Match and Pull Financial Data

WPS Spreadsheet provides robust support for advanced lookup functions like XLOOKUP, VLOOKUP, and INDEX/MATCH, allowing you to seamlessly pull data across multiple sheets and large financial workbooks.

  1. 1. Open your files in WPS: Launch WPS Spreadsheet and open the workbook containing your master and secondary loan reports.
  2. 2. Access the function library: Click on the cell where you want the matching data. Go to the Formulas tab on the ribbon and click 'Insert Function'.
  3. 3. Use XLOOKUP: Search for XLOOKUP, then fill out the Lookup_value, Lookup_array, and Return_array fields in the pop-up dialog box to accurately pull your data.
100% compatible with Microsoft Excel formulas and file formats (.xlsx)Advanced built-in functions including XLOOKUP to handle complex data retrieval effortlesslyLightweight application that handles large datasets and extensive arrays smoothlyFree to use with a familiar, easy-to-navigate tabbed interface
microsoft office alternative - wps office

Frequently Asked Questions

Why is my XLOOKUP formula returning an #N/A error?

An #N/A error occurs when the exact loan number from your first sheet cannot be found in the designated column of your second sheet. This can be caused by the number genuinely missing, or by a formatting mismatch (e.g., one is formatted as text and the other as a number). Adding `""` to the fourth argument of your XLOOKUP formula will display a blank cell instead of the error.

Can I pull data from a completely different spreadsheet file?

Yes. You can reference external workbooks. Ensure both files are open, type `=XLOOKUP(`, click on your lookup value, and then switch to the other workbook to select your arrays. The formula will automatically capture the external file path.

Is VLOOKUP still an option for this task?

Yes, VLOOKUP works well, provided that the 'Loan Number' column is positioned to the left of the value you want to retrieve in your secondary sheet. However, XLOOKUP is generally preferred because it does not require a specific column order and is less prone to breaking if new columns are inserted.