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

#### changomutney

##### New Member
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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

#### Gilliam

##### Active Member
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")

#### Oeldere

##### Well-known Member
Use Vlookup for that kind of work.

#### changomutney

##### New Member
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

#### Oeldere

##### Well-known Member
As already given as solution, VLookup will do that for you.

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

Replies
0
Views
384
Replies
0
Views
422
Replies
2
Views
2K
Replies
0
Views
1K
Replies
1
Views
968

1,195,640
Messages
6,010,878
Members
441,571
Latest member
stolenweasel

### 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.

### Which adblocker are you using?

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

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