How to sort a table based on values in another table?

Mr. Snrub

Board Regular
Joined
May 22, 2005
Messages
147
Office Version
  1. 365
Platform
  1. Windows
Suppose I have the following two tables (formatted as Excel tables):

StateData:

State AbbreviationState NamePopulation
ALAlabama4,903,185
AKAlaska710,249
AZArizona7,278,717
ARArkansas3,017,804


PresidentData:

LastNameBirthplace (State Abbreviation)
TrumpNY
ObamaHI
BushCT

How do I sort the PresidentData table by the population of the state in which they were born?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
is this what you want

Book1
ABCDEF
1State AbbreviationState NamePopulation
2NYAlabama4,903,185
3HIAlaska710,249
4CTArizona7,278,717
5ARArkansas3,017,804
6
7Sorted Data
8LastNameBirthplace (State Abbreviation)LastNameBirthplace (State Abbreviation)
9TrumpNYBushCT
10ObamaHITrumpNY
11BushCTObamaHI
12
13
Sheet3
Cell Formulas
RangeFormula
E9:F11E9=+INDEX($A$9:$B$11,MATCH(SMALL(RANK(VLOOKUP($B$9:$B$11,$A$2:$C$5,3,0),$C$2:$C$5,0),{1;2;3}),RANK(VLOOKUP($B$9:$B$11,$A$2:$C$5,3,0),$C$2:$C$5,0),0),{1,2})
Dynamic array formulas.


so this should work with ctrl+shift+enter. However if it doesn't then check for this first VLOOKUP($B$9:$B$11,$A$2:$C$5,3,0),$C$2:$C$5,0),{1;2;3})
 
Upvote 0
Well, I don't want to have to create an entirely new table and duplicate all that data. I was hoping to just go to Data --> Sort and do something there.
 
Upvote 0
Then I guess you have lookup the population from the population table first and then sort population Z-A
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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