Pick and Choose

sj1601

Board Regular
Joined
Aug 12, 2006
Messages
96
I have a list of all the countrys' codes (column). I have a list of 17 countries that I am interested in which has to show up on my report.

How can I create a dynamic formula to pick up these 17 names from this list?

Thanks.

sj1601
 
We do not have a list for the Country Names we want in the given data. (Should we create one?

Yes, you'll need to set a table to which the formula refers. So, for example, let A1:A17 contain a list of the country codes, and B1:B17 a list of the corresonding country names. Then, with your list of codes in D1:D10000, enter the following formula in E1, and copy down:

=INDEX($B$1:$B$17,MATCH(D1,$A$1:$A$17,0))

Hope this helps!
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Thanks Domenic. I used the vlookup function and I have the desired output now.

Maybe in the future I will need to tweak it a bit more to make it more dynamic so that I can eliminate repetitive steps.

Thanks everyone for your help.

Have a great weekend.
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,543
Members
449,316
Latest member
sravya

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