Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or
0
0
0
s2sdefault

How to quickly sort rows to match another column in Excel?

doc sort match to another column 1
If you have two lists in a sheet, and both of them have same values but in different order, how can you sort one list to match another list as below screenshot shown? In this article, I will introduce a formula to help you quickly solve it in Excel.
Sort rows to match another column

Advanced Sort -- By Last Name (sort data based on criteria, such as sort by text length, sort by last name. sort by absolute value and so on.)

doc advanced sort last name

arrow blue right bubble Sort rows to match another column


To sort rows to match another column, here is a formula can help you.

1. Select a blank cell next to the column you want to resort, for instance B1, and then enter this formula =MATCH(A1,C:C,FALSE), and drag autofill handle down to apply this formula. See screenshot:
doc sort match to another column 2

Tip: C:C is the column you want to resort based on, and A1 is the first cell of the column you want to sort.

2. And then a list of numbers are displaying in the formula cells. Select the list you want to resort and the numbers list, and click Data > Sort. See screenshot:
doc sort match to another column 3

3. And in the Sort dialog, select the column which contains the formulas from Column drop down list, and select Values and Smallest to Largest from the Sort On and Order drop down lists separately. See screenshot:
doc sort match to another column 4

4. Click OK. And the column A is sorted to match column C.
doc sort match to another column 5

Tip: You can delete the formula column after sorting if you do not need it any more.

doc attention 1  Kutools for Excel's Auto Text, collect all formulas to a group as auto text, you can insert them anytime as you want whithout remembering! Free Download Now!

Recommended Productivity Tools

Office Tab

gold star1 Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

Kutools for Excel

gold star1 Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

gold star1 200 New Features for Excel, Make Excel Much Easy and Powerful:

  • Merge Cell/Rows/Columns without Losing Data.
  • Combine and Consolidate Multiple Sheets and Workbooks.
  • Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
  • Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
  • More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...

Screen shot of Kutools for Excel

btn read more      btn download     btn purchase

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
People in conversation:
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Rob · 9 days ago
    Excel requests either 1(less than), 0(equal), or -1(greater than) for the [match type]. I am not entirely sure what FALSE would be.

    Is there another way for doing this when the columns are not the same length and the data is not identical? (example A1,A3,B2,C4,A5,C9 compared vs. X1, B2, Q4, A1, D7, A3)
  • To post as a guest, your comment is unpublished.
    bass · 2 months ago
    how do you do this with two columns that need to be matched to one. for example column a has number value, column b has letter value that is dependent on column a, and column c has the same numbers as column a, but out of order.
    • To post as a guest, your comment is unpublished.
      Sunny · 1 months ago
      So you want to reorder the column c based on column a and keep column c no change?
  • To post as a guest, your comment is unpublished.
    Rajesh Reddy · 4 months ago
    Nic.. it helped me lot.. Thank you