sorting question

  • Thread starter Thread starter anantathaker
  • Start date Start date
A

anantathaker

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!
 
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
 
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" <[email protected]>
wrote in message
news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top