Urgent help needed with formula for a template! Advice much appreciated!

changomutney

New Member
Joined
Sep 18, 2014
Messages
2
Hi guys,
I am relatively inexperienced with Excel formulas but I am trying to create a formula for a template for others to use. The idea is that they will enter the country name in one column and the formula will check the country against the list (in another sheet) of countries which each have a country code in an adjacent column – the formula will then recognize the country, take the the country code and insert it next to the country entered in the first sheet, in a cell in an adjacent column. This would mean that people using the template don't have to manually check the country against the list and insert the code themselves.
so:
Sheet 1 checks Sheet 2
Country Country Code Country Country Code
Germany Germany DE

and insert the country code.

Any ideas?

Many thanks

:)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
so a VLOOKUP?
kind of like...
=IFERROR(VLOOKUP(< country entered in sheet 1 > , < range with countries and country code listed on sht2 > , 2 , false),"Country not listed")
 
Upvote 0
Vlookup would be right on the money to find the country in the second sheet, but I also need it to take the country code next to it and insert it into a column in the first sheet.

so take Germany.

The person types in Germany in sheet 1

Country Country Code
Germany

the formula finds Germany in sheet 2, takes the country code in the column next to it
Country Country Code
Germany DE

and populates the empty column in sheet one

Country Country Code
Germany DE
 
Upvote 0
As already given as solution, VLookup will do that for you.

See for the syntax of Vlookup with the help function (F1).
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,268
Members
448,558
Latest member
aivin

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