Sorting All rows based on a column values which should remain as it is.

svelma

New Member
Joined
Aug 2, 2011
Messages
14
Hi,

I have multiple columns and rows, of which two columns(Say column G & column H) have similar data(text) but in different order. The second column H has the right order and should remain as it is.

Now, I want to sort rows for all columns from A to G(but not H), such that the resulting values in G and H are in same order.

*Note: The number of rows till column G are 265 and number of rows in column H are only 42.

I am kind of new to excel and have little knowledge, so can somebody please help me out.

Thanks,
Velma.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Welcome to the board.

Just make sure you are selecting only Columns A Through G when you go to sort.
When it asks you if you want to "Expand your selection" - Say No.

Hope that helps.
 
Upvote 0
Add a column between G and H. Now your H data is in I,
In the new, blank columjn of H enter =match(G2,I:I,0) adn fill down
then sort by H.

If you want to set this up as a macro you can record yourself adding the column, selecting I2 and then filing down. You will want to add in
Range("I2").value = "=match(G2,I:I,0)" before the fill down action.

**sorry, usually a better typer, but my finger is in a splint**
 
Upvote 0
Thank for the reply guys. Andiemac, =match(G2,I:I,0) and sorting by column H worked like a charm. Thank you. You saved me a lot of time.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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