익명 22:51

Excel Update value in continent based on values in country

Excel Update value in continent based on values in country

Hi I have a column in excel called country which has the country already filled in I need to write some sort of Logic to fill the column in the Continent column.

Eg in the country the values may be Germany, France, Belgium, UK. Is there any way that by some logic I can select some predefined values" these list of countries belong to Europe" and enter automatically update the continent column p.s. I have about 35000 entries so manually doing it is not the best option thanks In advance



Top Answer/Comment:

All you need is a lookup table and then apply the VLOOKUP formula:

  • Insert a new worksheet into your workbook (e.g. Countries)
  • Enter all relevant countries in column and its continent in column
  • In your source table, place the following formula (assuming that you country name is in column A, starting in row 2): =VLOOKUP(A2,Countries!$A:$B,2,0)
  • Copy the formula down
  • Use an AutoFilter and check for #N/A errors in the new column. For these countries, the VLOOKUP could not find a match in your new table. Add these values and assign a continent.

Done!

상단 광고의 [X] 버튼을 누르면 내용이 보입니다