Function Problems

How to Automatically Fill Matching Data Between Excel Tables

Bushra ParveenBushra Parveen Nov 11, 2026 868 views

Question details

The user needs to retrieve and automatically populate values from specific columns of a source table into a destination table based on matching identification criteria.

How to Automatically Fill Matching Data Between Excel Tables
Product
Spreadsheet
Device & OS
not provided
Scenario
Pulling data from columns C and D into columns H and I when the value in column G matches the value in column B on the same worksheet.
Observed behavior
The user wants columns H and I to automatically reflect the correct matched values from columns C and D without manual data entry.
Before you start

Ensure that your data columns do not contain hidden leading or trailing spaces, as these can cause exact-match formula queries to fail and return empty results.

Solution 1Recommended

Use the XLOOKUP Function to Retrieve Matched Data

XLOOKUP is a flexible modern formula designed to find data in one column and instantly return corresponding data from another column, making it perfect for filling out tables.

By utilizing exact range references and absolute locking (the dollar signs), you can set up a single formula and easily copy it across your entire dataset.

1
Enter the XLOOKUP formula

Click on cell H2 to make it active. Type the following formula exactly: =XLOOKUP($G2,$B:$B,$C:$C,""). This commands the software to locate the value of cell G2 within column B, and return the corresponding value from column C.

2
Apply the formula to adjacent columns

To fetch the matching data for column I (which pulls from column D), select cell H2, click the small square fill handle in the bottom-right corner, and drag it one cell to the right into I2. Modify the new formula so the return array points to column D: =XLOOKUP($G2,$B:$B,D:D,"").

3
Fill down the rows

Select the newly filled cells (H2 and I2). Click and drag the fill handle downwards to apply the formula to all the required rows in your table.

Use the XLOOKUP Function to Retrieve Matched Data
Pro Tip: The empty quotes "" at the end of the XLOOKUP formula ensure that if no match is found, the cell remains completely blank instead of displaying a distracting #N/A error.

Seamlessly Match and Process Data with WPS Spreadsheet

WPS Spreadsheet offers comprehensive formula support, allowing you to use advanced functions like XLOOKUP, VLOOKUP, and more to easily connect your datasets and automate your workflows.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing your separate tables.
  2. 2. Insert the function: Navigate to the target cell, click on the 'Formulas' tab in the top ribbon, and select 'Insert Function'.
  3. 3. Configure XLOOKUP: Search for XLOOKUP, input your lookup value and target arrays into the dialog box, and click OK to automatically fetch the matching data across your tables.
Fully compatible with Microsoft Excel formulas and the .xlsx formatAdvanced intelligent functions included for fast data processingLightweight software that runs perfectly on Windows, Mac, and LinuxFamiliar user interface requires no learning curve
QA img-9

Frequently Asked Questions

Why does my formula return an error instead of a blank cell?

If you omit the fourth argument in the XLOOKUP function, it defaults to returning an #N/A error when a match isn't found. Make sure to include the double quotes at the end of your formula (e.g., ,"") to instruct the program to return a blank cell instead.

Can I match data across two completely different worksheets?

Yes. When selecting the lookup and return arrays in your formula, simply click over to the other worksheet tab and highlight the relevant columns. The formula will automatically generate the correct sheet reference, such as =XLOOKUP($G2,Sheet2!$B:$B,Sheet2!$C:$C,"").

What if there are multiple matching values in the source table?

By default, the XLOOKUP function scans from top to bottom and will return the very first match it finds. If you want it to search from bottom to top to find the latest match, you can adjust the search mode argument at the end of the formula to -1.