How can I sort two columns in Google Sheets to match each other?

The process of sorting two columns in Google Sheets to match each other involves arranging the data in both columns in a specific order, so that the corresponding values in each row are aligned. This can be done by selecting both columns, then using the “Sort Range” function to organize the data based on a common criterion, such as alphabetical or numerical order. By sorting the two columns in the same way, the data will be matched and easier to analyze and compare. This can be useful for organizing data sets, creating charts, or identifying any discrepancies between the two columns.

Google Sheets: Sort Two Columns to Match


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

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:

=MATCH(A2, $C$2:$C$11, 0)

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 Google Sheets .

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 Sort range, then click Advanced range sorting options:

In the new window that appears, choose to Sort by Column B from A to Z, then click Sort:

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.

Additional Resources

The following tutorials explain how to perform other common operations in Google Sheets:

x