Function Problems

How to Match and Reorder Excel Data from One Column to Another

Adam DavisAdam Davis Oct 28, 2026 869 views

Question details

The user needs to align misordered data in two columns so that the values match the sorted sequence of a master list in another column.

How to Match and Reorder Excel Data from One Column to Another
Product
Excel
Device & OS
not provided
Scenario
Reordering randomly sorted data columns to correctly align with matching identifiers (like email addresses) in a master column.
Observed behavior
Columns C and D contain the correct data but are physically out of order compared to the sorted master list in column B, requiring realignment so the rows match perfectly.
Before you start

Before reordering your data, ensure there are no duplicate values in your master column to prevent incorrect matching and sorting behavior.

Solution 1Recommended

Use a Helper Column with the MATCH Function to Sort Data

This method calculates the correct row position for each item, allowing you to physically sort the misaligned columns to match your master list.

By using the MATCH function, you can determine exactly where each randomly sorted item belongs according to the master list. Once these positions are calculated, you can perform a standard sort to reorder the physical data.

1
Create a helper column

In an empty column next to your misaligned data (e.g., cell E2), enter the formula `=MATCH(C2,$B$2:$B$1000,0)`. Adjust the range `$B$2:$B$1000` to cover the exact length of your master list in Column B.

2
Apply the formula to all rows

Click cell E2, grab the fill handle in the bottom-right corner, and drag it down to apply this formula to all rows containing data in columns C and D.

3
Paste formulas as values

Select the entire helper column (Column E) and press Ctrl+C to copy. Right-click the selected area and choose 'Paste as Values' (the clipboard icon with 123) to convert the formulas into static numbers.

4
Sort the columns

Select columns C, D, and E together. Navigate to the Data tab on the ribbon, click 'Sort', and choose to sort by your helper column (Column E) in Ascending order.

5
Verify and clean up

Check that the data in columns C and D now perfectly aligns row-by-row with column B. Once verified, you can safely delete the helper column E.

Use a Helper Column with the MATCH Function to Sort Data
Use Absolute References: Always use dollar signs (e.g., $B$2:$B$1000) for your master list range inside the MATCH formula. This locks the range so it doesn't shift when you drag the formula down.
Efficient Data Management

Reorder and Match Data Effortlessly in WPS Spreadsheet

WPS Spreadsheet provides powerful and familiar functions like MATCH, VLOOKUP, and XLOOKUP to help you organize, align, and analyze your data seamlessly. It processes complex formulas quickly and provides an intuitive sorting interface.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office and open your workbook containing the misaligned columns.
  2. 2. Insert the MATCH formula: Create a new helper column and use the `=MATCH()` formula to identify the correct row sequence based on your master column.
  3. 3. Paste values and select data: Copy the formula results and paste them as values, then highlight the columns you wish to reorder.
  4. 4. Sort to align data: Go to the Data tab, click 'Sort', and sort ascending by your helper column to perfectly align your data.
100% compatibility with Microsoft Excel formulas like MATCH and XLOOKUP.Intuitive Data tab with advanced, easy-to-use sorting and filtering tools.Free, lightweight, and fast performance even when matching large datasets.Seamless interface that makes helper-column creation and value pasting straightforward.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my MATCH formula returning #N/A errors when aligning data?

A #N/A error means the exact value was not found in the lookup array. This frequently happens due to trailing spaces, invisible characters, or spelling differences. It can also occur if you forgot to lock your lookup range with absolute references (like $B$2:$B$1000).

Can I use VLOOKUP instead of XLOOKUP to align this data?

Yes, but only if the matching identifier (like the email address) is located in the leftmost column of your randomly ordered data table. If the identifier is situated to the right of the notes you are trying to retrieve, you must use XLOOKUP or an INDEX/MATCH combination.

How do I align rows if there are duplicate values in my master column?

Standard lookup functions like MATCH, VLOOKUP, or XLOOKUP will only return the first instance of a duplicate value. To accurately handle duplicates, you either need to use Power Query to merge tables, or create a unique helper ID by combining two columns (for example, =A2&B2) before performing your match.