Data Import & Export

Import Worksheet Data by Matching Column Headers in Excel

Nimra MalikNimra Malik Nov 18, 2026 869 views

Question details

Import source worksheet data into a report template by matching column headers rather than column positions.

Import Excel Worksheet Data by Matching Column Headers
Product
Microsoft Excel
Device & OS
not provided
Scenario
A report template and a source worksheet have different column orders or dimensions.
Observed behavior
Each destination column should receive values from the source column with the matching header.
Before you start

Place the source data and report template on separate sheets in the same workbook, with headers in row 1. Check that corresponding headers match and that each source header is unique.

Solution 1Recommended

Use INDEX and MATCH to import data by header

Use a formula when source and destination columns are arranged differently.

MATCH finds the destination header in the source header row, and INDEX returns the value from that source column. IFERROR returns a blank if no match is found or the formula goes beyond the source range.

1
Check the sheet layout

In the workbook, check that the source sheet is named Source, the report sheet is named Destination, and both sheets have headers in row 1. The example assumes source data is in A2:H19.

2
Enter the formula

On Destination, select A2 and enter =IFERROR(INDEX(Source!$A$2:$H$19,ROW($I1),MATCH(Destination!A$1,Source!$A$1:$H$1,0)),"").

3
Fill the report

Drag the fill handle from A2 across the destination columns and then down the rows you need. Each formula uses the destination header above it to select a source column.

4
Adjust and check the ranges

Edit the sheet names and source ranges in the formula to match your workbook, then check the results against the source sheet. Expand both source ranges if the source contains more columns, and expand the data range if it contains more rows.

Use INDEX and MATCH to import data by header
Check blanks and errors: A blank source cell may appear as 0. IFERROR also hides errors other than missing headers, so check the formula and ranges if an expected value is blank.
Match columns in WPS Spreadsheets

Build a header-matched report in WPS Spreadsheets

Use INDEX, MATCH, and IFERROR in WPS Spreadsheets to pull source data into a report template according to its column headers.

  1. 1. Open the workbook: Open WPS Spreadsheets and select Open to load the workbook containing the source and destination sheets.
  2. 2. Check the headers: Select each sheet tab and confirm that matching column headers are in row 1. Rename the sheets to Source and Destination, or adjust the formula to use their actual names.
  3. 3. Enter the matching formula: On the Destination sheet, select A2 and enter =IFERROR(INDEX(Source!$A$2:$H$19,ROW($I1),MATCH(Destination!A$1,Source!$A$1:$H$1,0)),""). Adjust the source ranges to cover your data.
  4. 4. Fill and save: Drag the fill handle across and down to populate the report, check the results, and select Save to save the workbook.
Match report columns to source headers even when their order differsOpen and save Microsoft Excel XLSX filesFill a single formula across columns and down rows
microsoft office alternative - wps office

Frequently Asked Questions

What happens if a destination header is missing from the source?

MATCH returns an error, which IFERROR displays as a blank. Check the header text on both sheets and confirm that the source header range includes the column.

Can the source have more columns or rows than the example?

Yes. Edit Source!$A$1:$H$1 to cover all source headers and Source!$A$2:$H$19 to cover the corresponding data columns and rows.

What if the source has duplicate column headers?

MATCH returns the position of the first matching header. Give source columns unique headers and use the corresponding names in the destination template.

Why does an empty source cell appear as zero?

INDEX can return 0 for an empty referenced cell. If blanks must remain blank, use an additional IF test around the INDEX result and verify the result for your data.