Ayush
Ayush

Reputation: 623

Sort one column in excel with respect to another

I have two excel sheets, the sheet 1 has id and name and that sheet is sorted on the basis of id. The second sheet has the name and other many columns. The second sheet needs to be ordered on the basis of id too. How can I compare these two sheets and order.

Upvotes: 0

Views: 327

Answers (1)

Texas
Texas

Reputation: 913

A quick and easy way to do this would be to insert a new column in your second sheet, providing the ID for each name.

Insert a new row and use the match function to find the row in the first sheet corresponding to each name, combining this with the index function would retrieve the IDs

e.g. =index('ID col in sheet 1, match('name in sheet 2','name col in sheet 1',0))

You can then sort all columns using the ID column created in sheet 2

The vlookup function would also be an option if you wanted

Upvotes: 1

Related Questions