Import Worksheet Data by Matching Column Headers in Excel
Question details
Import source worksheet data into a report template by matching column headers rather than column positions.

- 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.
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.
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.
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.
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)),"").
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.
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.

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. Open the workbook: Open WPS Spreadsheets and select Open to load the workbook containing the source and destination sheets.
- 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. 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. Fill and save: Drag the fill handle across and down to populate the report, check the results, and select Save to save the workbook.

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.




