Sort Excel Row Based on Values in Another Row

1

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?

KBusc

Posted 2014-10-13T16:06:09.460

Reputation: 113

Are you allowed to change the order of the second row? If the goal is simply to make them match, you could sort the second row and then sort the first row the same way. – fixer1234 – 2014-10-13T16:13:11.153

Sorry I should of specified that the order of Row 2 cannot change – KBusc – 2014-10-13T16:13:39.350

Answers

1

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

Prasanna

Posted 2014-10-13T16:06:09.460

Reputation: 3 554

0

One solution:

Create a new column after column A and then put the following formula in cell B1

=MATCH(C1,A:A,0)

Drag down, higlight columns A and B and then sort column on column B by smallest to largest. Do not expand the selection if prompted

CallumDA

Posted 2014-10-13T16:06:09.460

Reputation: 967