#1   Report Post  
anantathaker
 
Posts: n/a
Default sorting question


Hello everyone,

My data is in the following format, although on a much larger scale:

1 Country Var X Rank
2 USA # 1
3
4 India # 3
5
6 China # 4
7
8 Japan # 2

Basically, each country takes up two rows. However, I want to sort all
of the data based on the ranks. How can I do this and maintain each
country's two rows? I eventually want to build a macro, but if I just
knew how to sort it, I could use macro recorder. Thanks for the help!


--
anantathaker
------------------------------------------------------------------------
anantathaker's Profile: http://www.excelforum.com/member.php...o&userid=18133
View this thread: http://www.excelforum.com/showthread...hreadid=382057

  #2   Report Post  
bj
 
Posts: n/a
Default

one way to do it.
assuming your ranking is in coulumn D
insert new column E
in E2 enter
=D2
in E3 enter
=D2
copy E2:E3 and paste to the end of your data
sselect all and sort using column E

"anantathaker" wrote:


Hello everyone,

My data is in the following format, although on a much larger scale:

1 Country Var X Rank
2 USA # 1
3
4 India # 3
5
6 China # 4
7
8 Japan # 2

Basically, each country takes up two rows. However, I want to sort all
of the data based on the ranks. How can I do this and maintain each
country's two rows? I eventually want to build a macro, but if I just
knew how to sort it, I could use macro recorder. Thanks for the help!


--
anantathaker
------------------------------------------------------------------------
anantathaker's Profile: http://www.excelforum.com/member.php...o&userid=18133
View this thread: http://www.excelforum.com/showthread...hreadid=382057


  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

Bit convoluted but it works.

In a new column, add this formula

=IF(MOD(ROW(),2)=0,C2&1,C1&2)

and copy down.

Then copy this column and pastespecial values, then sort by this coilumn.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"anantathaker"
wrote in message
news:anantathaker.1r5a2c_1119639909.9772@excelforu m-nospam.com...

Hello everyone,

My data is in the following format, although on a much larger scale:

1 Country Var X Rank
2 USA # 1
3
4 India # 3
5
6 China # 4
7
8 Japan # 2

Basically, each country takes up two rows. However, I want to sort all
of the data based on the ranks. How can I do this and maintain each
country's two rows? I eventually want to build a macro, but if I just
knew how to sort it, I could use macro recorder. Thanks for the help!


--
anantathaker
------------------------------------------------------------------------
anantathaker's Profile:

http://www.excelforum.com/member.php...o&userid=18133
View this thread: http://www.excelforum.com/showthread...hreadid=382057



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about sorting in protected worksheet SJC Excel Worksheet Functions 6 March 24th 05 10:35 PM
SORTING question Rebecca New Users to Excel 3 February 24th 05 05:35 PM
Question on sorting dates Excel heavy user Excel Discussion (Misc queries) 3 January 21st 05 05:12 PM
sorting question Brian Excel Worksheet Functions 5 November 30th 04 05:32 AM
sorting question Brian Excel Discussion (Misc queries) 4 November 28th 04 12:30 PM


All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"