Sort one column based on another column--where column to be sorted consists of groups with duplicate values

lou89

New Member
Joined
Jan 18, 2018
Messages
1
Hi all,

Apologies for the long title, but I wanted to highlight that this is not just the typical 'sort one column based on another' question, but an extension of it.

I have data that is structured something like this:

Column AColumn BColumn D
ALorem ipsum dolor sit ametA
Dconsectetur adipiscing elitB
CNam posuere maximus tellusC
Eefficitur convallis odio ullamcorper acD
E
ASed ex erat
Befficitur et metus eget
Econgue finibus ipsum
DNunc pretium sit amet massa nec dictum
DPellentesque id mauris imperdiet
Bporta est eget
Cimperdiet lacus
EProin nisl purus

<tbody>
</tbody>


I would like to reorder Column A and Column B (Column B should reorder when Column A is reordered) based on the order in Column D.

The outcome should look something like this:

Column AColumn B
ALorem ipsum dolor sit amet
CNam posuere maximus tellus
Dconsectetur adipiscing elit
Eefficitur convallis odio ullamcorper ac
ASed ex erat
Befficitur et metus eget
DNunc pretium sit amet massa nec dictum
Econgue finibus ipsum
Bporta est eget
Cimperdiet lacus
DPellentesque id mauris imperdiet
EProin nisl purus

<tbody>
</tbody>

"=MATCH(A1,D:D,FALSE)" wouldn't work for me in this case because Columns A-B contain groups of data (denoted as separated by blank rows here) and I would like to keep the order within groups instead of having all the 'A's coming together, 'B's coming together, etc.

Just wondering if there's any way to achieve this.

Would greatly appreciate any help or advice at all. Thanks so much!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,522
Messages
6,120,019
Members
448,938
Latest member
Aaliya13

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top