Sorting Data Grid - Row, then Column (Alphabetically)

Blackmarxz

New Member
Joined
Oct 6, 2014
Messages
1
Hello

I have a grid of data that I'm looking to do a two-step sorting process on

1 Sort each row alphabetically

2 Sort each column Alphabetically


For illustration - original data grid (reads horizontally) could look like below:



[TABLE="width: 500"]
<tbody>[TR]
[TD]1
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]4
[/TD]
[TD]5
[/TD]
[TD]6
[/TD]
[/TR]
[TR]
[TD]Orange
[/TD]
[TD]Apple
[/TD]
[TD]Pear
[/TD]
[TD]Blueberry
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apple
[/TD]
[TD]Kiwifruit
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Lime
[/TD]
[TD]Banana
[/TD]
[TD]Blackberry
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Kiwifruit
[/TD]
[TD]Orange
[/TD]
[TD]Pear
[/TD]
[TD]Lime
[/TD]
[TD]Melon
[/TD]
[TD]Starfruit
[/TD]
[/TR]
[TR]
[TD]Durian
[/TD]
[TD]Jackfruit
[/TD]
[TD]Watermelon
[/TD]
[TD]Pear
[/TD]
[TD]Apple
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


After being sorted should look like :


[TABLE="width: 500"]
<tbody>[TR]
[TD]1
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]4
[/TD]
[TD]5
[/TD]
[TD]6
[/TD]
[/TR]
[TR]
[TD]Apple
[/TD]
[TD]Blueberry
[/TD]
[TD]Orange
[/TD]
[TD]Pear
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apple
[/TD]
[TD]Durian
[/TD]
[TD]Jackfruit
[/TD]
[TD]Pear
[/TD]
[TD]Watermelon
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Apple
[/TD]
[TD]Kiwifruit
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Banana
[/TD]
[TD]Blackberry
[/TD]
[TD]Lime
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Kiwifruit
[/TD]
[TD]Lime
[/TD]
[TD]Melon
[/TD]
[TD]Orange
[/TD]
[TD]Pear
[/TD]
[TD]Starfruit
[/TD]
[/TR]
</tbody>[/TABLE]


Firstly each row was sorted horizontally. Then each column vertically - keeping each row's data intact

Rows will have different number of data points

Would prefer to do it via formulas if possible.

Numbers at top are column headers

Data set could grow to a couple thousand rows. Columns perhaps up to 30

If you can find a way to automate this it would be much appreciated. Can do it manually - but is fiddly and painful with alot of data.

Cheers
 

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