Sorting problems...

leighhobson89

New Member
Joined
Aug 25, 2016
Messages
36
My problem here is that I have a list of countries on the left. Then I have a list of countries on the right. One column to the right of the second column of countries is a column of numbers in the format 0.xxx. What I need is for that column of numbers to end up in the order that the first column of countries are, using the second column of countries as a cross-reference. Can you provide me with the correct method and formula to do that?

I have this data sample:

csvtemp.csv
ABCDEFGHIJKLMN
1idcountrystartingPopareastartingArmycontinentres_goldres_oilres_foodres_cons_matsupgrade_cost_basedev_index
20China14470653299,706,9610AsiaNULLNULLNULLNULLNULLNULL Switzerland0.962
31India14013105633,287,5900AsiaNULLNULLNULLNULLNULLNULL Norway0.961
42United States3340584269,372,6100North AmericaNULLNULLNULLNULLNULLNULL Iceland0.959
53Indonesia2780372631,904,5690OceaniaNULLNULLNULLNULLNULLNULL Hong Kong0.952
64Pakistan227724796881,9120AsiaNULLNULLNULLNULLNULLNULL Australia0.951
75Brazil2148329018,515,7670South AmericaNULLNULLNULLNULLNULLNULL Denmark0.948
86Nigeria214507696923,7680AfricaNULLNULLNULLNULLNULLNULL Sweden0.947
97Bangladesh167247491147,5700AsiaNULLNULLNULLNULLNULLNULL Ireland0.945
108Russia14589995617,098,2420AsiaNULLNULLNULLNULLNULLNULL Germany0.942
119Mexico1310460751,964,3750North AmericaNULLNULLNULLNULLNULLNULL Netherlands0.941
1210Japan125802521377,9300AsiaNULLNULLNULLNULLNULLNULL Finland0.940
1311Ethiopia1195905011,104,3000AfricaNULLNULLNULLNULLNULLNULL Singapore0.939
1412Philippines111913102342,3530AsiaNULLNULLNULLNULLNULLNULL Belgium0.937
1513Egypt1053906881,002,4500AfricaNULLNULLNULLNULLNULLNULL New Zealand
1614Vietnam98655916331,2120AsiaNULLNULLNULLNULLNULLNULL Canada0.936
1715Turkey85484777783,5620EuropeNULLNULLNULLNULLNULLNULL Liechtenstein0.935
1816Iran856270521,648,1950AsiaNULLNULLNULLNULLNULLNULL Luxembourg0.930
1917Germany83975691357,1140EuropeNULLNULLNULLNULLNULLNULL United Kingdom0.929
2018Thailand70039646513,1200AsiaNULLNULLNULLNULLNULLNULL Japan0.925
2119United Kingdom68401087242,9000EuropeNULLNULLNULLNULLNULLNULL South Korea
2220France65520147551,6950EuropeNULLNULLNULLNULLNULLNULL United States0.921
2321Tanzania62539416945,0870AfricaNULLNULLNULLNULLNULLNULL Israel0.919
2422Italy60320493301,3360EuropeNULLNULLNULLNULLNULLNULL Malta0.918
csvtemp
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You could simply do a VLOOKUP in a new column using the country names in column B as the lookup value and your two columns on the right as the lookup table (assuming there is a 1:1 match on countries).
 
Upvote 0
Thank you. I got that tip from Chat-GPT too - the problem is i am having difficulty getting it working. Using United Kingdom as an example (as it features in both lists of the sample) could you provide the formula to put in say column O of row 21 to start me off please? :)
 
Upvote 0
It would be:

Excel Formula:
=VLOOKUP(B21,$M$2:$N$24,2,false)

You can then copy that up/down as required.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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