Excel – Sort Excel Row Based on Values in Another Row

microsoft excelmicrosoft-excel-2010sortingworksheet-function

Sorry if this question has already been answered, I looked but I didn tfind anything that was quite what I am trying to do.

I have a lot of spreadsheets where I have something like:

A|B|C|D|E|F...
D|E|A|B|F|C...

Where the two rows contain exactly the same data just in a different order.

What I want to do is sort the first row so that it matches the second. Ive tried using a custom list but Excel limits customs lists to 250 chars and the custom list I would need is 1000+ chars.

Is there a way to sort row 1 so that it is in the order of row 2?

Best Answer

If it is ok to have another row - which wil match row 2 - you can use HLOOKUP as shown in the image below.
enter image description here

Related Question