Enter country code when country name is found

sven_01

New Member
Joined
Mar 4, 2018
Messages
3
Hi,
I want to have a formula that looks through a range of cells, and if a country is listed ( i.e United States) in a cell, then it will enter the 2 letter code in another cell (i.e US).
This would apply for approximately 70 countries.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Thanks, but how do i deal with the instances where a country appears multiple times in the list. I did a vlook up formula but it did not work for multiple entries .Can anyone provide me the actual formula if the full list of countries runs from A1 through to A90 ( multiple occurrence of same country), where the table listing all countries is in E1 through to E70, and the matching country codes are in F1 through to F70 (country in E1 has matching 2 letter code in F1 and so on.)
thanks in advance.
 
Upvote 0
Thanks again Alansidman.
Sorry, but my excel experience is limited, and looking at this link didn't help me at all. (probably says a lot for my excel ability) Was hoping for the actual formula I could insert given the parameters in my 2nd post and the cells I provided.... can you / anyone else assist?
 
Upvote 0
Complaint IDCompanyProductIssueSTATE_NAMEStateSubmitted viaDate receivedDate resolvedTimely response?Consumer disputed?
1615767​
PHH MortgageMortgageLoan servicing, payments, escrow accountFLWeb10/20/201510/20/2015YesNo
654223​
OcwenMortgageLoan servicing, payments, escrow accountNCWeb
2014-03-01​
2014-03-01​
YesNo
SrcSTATECODE
{ "STATE": "Alabama", "CODE": "AL"}AlabamaAL
{ "STATE": "Alaska", "CODE": "AK"}AlaskaAK
{ "STATE": "Arizona", "CODE": "AZ"}ArizonaAZ
{ "STATE": "Arkansas", "CODE": "AR"}ArkansasAR
{ "STATE": "California", "CODE": "CA"}CaliforniaCA
{ "STATE": "Colorado", "CODE": "CO"}ColoradoCO
{ "STATE": "Connecticut", "CODE": "CT"}ConnecticutCT
{ "STATE": "Delaware", "CODE": "DE"}DelawareDE
{ "STATE": "District of Columbia", "CODE": "DC"}District of ColumbiaDC
{ "STATE": "Florida", "CODE": "FL"}FloridaFL
{ "STATE": "Georgia", "CODE": "GA"}GeorgiaGA
{ "STATE": "Hawaii", "CODE": "HI"}HawaiiHI
{ "STATE": "Idaho", "CODE": "ID"}IdahoID
{ "STATE": "Illinois", "CODE": "IL"}IllinoisIL
{ "STATE": "Indiana", "CODE": "IN"}IndianaIN
{ "STATE": "Iowa", "CODE": "IA"}IowaIA
{ "STATE": "Kansas", "CODE": "KS"}KansasKS
{ "STATE": "Kentucky", "CODE": "KY"}KentuckyKY
{ "STATE": "Louisiana", "CODE": "LA"}LouisianaLA
{ "STATE": "Maine", "CODE": "ME"}MaineME
{ "STATE": "Montana", "CODE": "MT"}MontanaMT
{ "STATE": "Nebraska", "CODE": "NE"}NebraskaNE
{ "STATE": "Nevada", "CODE": "NV"}NevadaNV
{ "STATE": "New Hampshire", "CODE": "NH"}New HampshireNH
{ "STATE": "New Jersey", "CODE": "NJ"}New JerseyNJ
{ "STATE": "New Mexico", "CODE": "NM"}New MexicoNM
{ "STATE": "New York", "CODE": "NY"}New YorkNY
{ "STATE": "North Carolina", "CODE": "NC"}North CarolinaNC
{ "STATE": "North Dakota", "CODE": "ND"}North DakotaND
{ "STATE": "Ohio", "CODE": "OH"}OhioOH
{ "STATE": "Oklahoma", "CODE": "OK"}OklahomaOK
{ "STATE": "Oregon", "CODE": "OR"}OregonOR
{ "STATE": "Maryland", "CODE": "MD"}MarylandMD
{ "STATE": "Massachusetts", "CODE": "MA"}MassachusettsMA
{ "STATE": "Michigan", "CODE": "MI"}MichiganMI
{ "STATE": "Minnesota", "CODE": "MN"}MinnesotaMN
{ "STATE": "Mississippi", "CODE": "MS"}MississippiMS
{ "STATE": "Missouri", "CODE": "MO"}MissouriMO
{ "STATE": "Pennsylvania", "CODE": "PA"}PennsylvaniaPA
{ "STATE": "Rhode Island", "CODE": "RI"}Rhode IslandRI
{ "STATE": "South Carolina", "CODE": "SC"}South CarolinaSC
{ "STATE": "South Dakota", "CODE": "SD"}South DakotaSD
{ "STATE": "Tennessee", "CODE": "TN"}TennesseeTN
{ "STATE": "Texas", "CODE": "TX"}TexasTX
{ "STATE": "Utah", "CODE": "UT"}UtahUT
{ "STATE": "Vermont", "CODE": "VT"}VermontVT
{ "STATE": "Virginia", "CODE": "VA"}VirginiaVA
{ "STATE": "Washington", "CODE": "WA"}WashingtonWA
{ "STATE": "West Virginia", "CODE": "WV"}West VirginiaWV
{ "STATE": "Wisconsin", "CODE": "WI"}WisconsinWI
{ "STATE": "Wyoming", "CODE": "WY"}WyomingWY
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,161
Members
453,021
Latest member
Justyna P

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