0
votes

I have two worksheets - Sheet1 and Sheet2.

Sheet1 is a list of names of countries. Column A has a unique number assigned to each country. Column C has a three letter code assigned to each country.

Sheet2 is a list of states/regions. Column C has a number that corresponds to its country number in sheet1, column A.

I would like to compare the value of each cell in Sheet2 column C (Sheet2!C1) to the values of an array of cells in Sheet1 column A (Sheet1!A1:A232). If the value is the same (true), then I want to copy the corresponding country code entered in Sheet1 Column C (Sheet1!C1) to Sheet2 Columm F.

I tried with various formulas including IF, CountIF and VLOOKUP, but I cannot figure it out. My excel knowledge is quite poor.

Any help would be greatly appreciated. Thanks!

1

1 Answers

0
votes

Paste this in F1 of Sheet2 and drag and drop as far as you need to:

 =VLOOKUP(Sheet2!C1,Sheet1!$A$1:$C$232,3,True)

This will look up the value of C1 of Sheet2 in column A of Sheet1 and return the value of column C of Sheet1 to F1 of Sheet2