Excel: Sort Two Columns to Match

Excel is a powerful and intuitive tool for organizing, analyzing, and manipulating data. It is an essential tool for businesses, and it is used for a variety of tasks. One of Excel’s most useful features is its ability to quickly and easily sort two columns to match. This is a great way to quickly compare two columns of data and make sure that the data matches up. With the help of Excel, users can easily sort two columns to match in order to quickly identify any discrepancies or errors in the data. This can save a lot of time and effort in the long run. The ability to easily sort two columns to match makes Excel an indispensable tool for businesses and professionals.


Often you may want to sort two columns in Excel such that the values in each corresponding row match each other.

For example, you may want to sort two lists of teams in Excel such that the two lists have matching team names in each row:

The following step-by-step example shows exactly how to do so.

Step 1: Enter the Values for the Two Columns

First, let’s enter the following two lists of basketball team names in separate columns:

Step 2: Use MATCH Function to Find Matching Row Values

Next, we will find the row number in Team List 2 in which each team name in Team List 1 appears.

To do so, type the following formula into cell B2:

=VLOOKUP(D2, $A$2:$B$16, 2, FALSE)

Then click and drag this formula down to each remaining cell in column B:

Note: You can find the complete documentation for the MATCH function in Excel .

Step 3: Sort First Column to Match Second Column

Next, highlight the cell range A2:B11, then click the Data tab along the top ribbon, then click the Sort icon:

Once you click OK, the team names in Team List 1 will be sorted to match the order of teams in Team List 2:

Feel free to delete the values in column B now:

Notice that the team names in each list are now in the exact same order.

x