How to Convert Country Names to ISO Codes and Vice Versa in Excel?
AuthorXiaoyang•Last modified
Country names and ISO country codes are commonly used in customer databases, international sales reports, shipping records, and geographic analysis. However, one worksheet may contain full country names such as United States, while another system requires two-letter codes such as US or three-letter codes such as USA.
To convert country names to ISO codes in Excel, you can:
- Use an Excel lookup formula with a country-code reference table.
- Use the Convert Country Names and ISO Codes feature in Kutools for Excel to perform the conversion directly.
This guide explains how to convert country names to ISO Alpha-2 or Alpha-3 codes, as well as how to convert ISO codes back to full country names.

Table of Contents
Method 1: XLOOKUP Function (Excel 2021 and Later Versions / Microsoft 365)
- Convert Country Names to ISO Codes
- Convert ISO Codes to Country Names
- Convert Either Alpha-2 or Alpha-3 Codes to Country Names
Method 2: VLOOKUP or INDEX and MATCH (Older Excel Versions)
- Convert Country Names to Codes with VLOOKUP
- Convert ISO Codes to Country Names with INDEX and MATCH
- Convert Either Alpha-2 or Alpha-3 Codes to Country Names with INDEX and MATCH
Method 3: Convert Country Names and ISO Codes with Kutools for Excel
What Are ISO Country Codes?
ISO country codes are standardized abbreviations used to identify countries and territories.
- ISO2, or an alpha-2 code, consists of two letters, such as US, CA, or JP, and is widely used on websites, in databases and addresses, and for regional settings.
- ISO3, or an alpha-3 code, consists of three letters, such as USA, CAN, or JPN, and is generally easier to recognize in reports, international datasets, and data exchange systems.
The two most commonly used formats are:
| Country name | ISO Alpha-2 code | ISO Alpha-3 code |
|---|---|---|
| United States | US | USA |
| United Kingdom | GB | GBR |
| Canada | CA | CAN |
| Germany | DE | DEU |
| France | FR | FRA |
| Japan | JP | JPN |
| China | CN | CHN |
| Australia | AU | AUS |
| India | IN | IND |
| Brazil | BR | BRA |
Method 1: XLOOLKUP function (Excel 2021 and later versions / Office 365)
Using a formula is a practical choice when you want the converted results to update automatically whenever the source data changes.
However, formulas require a reference table containing the country names and their corresponding ISO codes.
XLOOKUP Syntax:
- lookup_value: The value you want to find.
- lookup_array: The cell range in which Excel searches for the lookup value.
- return_array: The range containing the result you want to return.
- [if_not_found]: Optional. Specifies the text or value to return when no match is found. If omitted, Excel returns #N/A.
- [match_mode]: Optional. Specifies the matching method:
- 0 – Exact match; this is the default.
- -1 – Exact match or next smaller value.
- 1 – Exact match or next larger value.
- 2 – Wildcard match.
- [search_mode]: Optional. Specifies the search direction:
- 1 – Search from first to last; this is the default.
- -1 – Search from last to first.
- 2 – Binary search in ascending order.
- -2 – Binary search in descending order.
First, create a country-code reference table, copy the following table, which contains all country names and their corresponding codes, and paste it into the worksheet where you want to perform the conversion.
| Country | ISO Alpha-2 | ISO Alpha-3 |
|---|---|---|
| Afghanistan | AF | AFG |
| Albania | AL | ALB |
| Algeria | DZ | DZA |
| American Samoa | AS | ASM |
| Andorra | AD | AND |
| Angola | AO | AGO |
| Anguilla | AI | AIA |
| Antarctica | AQ | ATA |
| Antigua and Barbuda | AG | ATG |
| Argentina | AR | ARG |
| Armenia | AM | ARM |
| Aruba | AW | ABW |
| Australia | AU | AUS |
| Austria | AT | AUT |
| Azerbaijan | AZ | AZE |
| Bahamas (the) | BS | BHS |
| Bahrain | BH | BHR |
| Bangladesh | BD | BGD |
| Barbados | BB | BRB |
| Belarus | BY | BLR |
| Belgium | BE | BEL |
| Belize | BZ | BLZ |
| Benin | BJ | BEN |
| Bermuda | BM | BMU |
| Bhutan | BT | BTN |
| Bolivia (Plurinational State of) | BO | BOL |
| Bonaire, Sint Eustatius and Saba | BQ | BES |
| Bosnia and Herzegovina | BA | BIH |
| Botswana | BW | BWA |
| Bouvet Island | BV | BVT |
| Brazil | BR | BRA |
| British Indian Ocean Territory (the) | IO | IOT |
| Brunei Darussalam | BN | BRN |
| Bulgaria | BG | BGR |
| Burkina Faso | BF | BFA |
| Burundi | BI | BDI |
| Cabo Verde | CV | CPV |
| Cambodia | KH | KHM |
| Cameroon | CM | CMR |
| Canada | CA | CAN |
| Cayman Islands (the) | KY | CYM |
| Central African Republic (the) | CF | CAF |
| Chad | TD | TCD |
| Chile | CL | CHL |
| China | CN | CHN |
| Christmas Island | CX | CXR |
| Cocos (Keeling) Islands (the) | CC | CCK |
| Colombia | CO | COL |
| Comoros (the) | KM | COM |
| Congo (the Democratic Republic of the) | CD | COD |
| Congo (the) | CG | COG |
| Cook Islands (the) | CK | COK |
| Costa Rica | CR | CRI |
| Croatia | HR | HRV |
| Cuba | CU | CUB |
| Curaçao | CW | CUW |
| Cyprus | CY | CYP |
| Czechia | CZ | CZE |
| Côte d'Ivoire | CI | CIV |
| Åland Islands | AX | ALA |
Convert Country Names to ISO Codes
Supposing, I paste the reference table in cell A1:C250, and my data range in E1:F14, see screenshot:

Return ISO Alpha-2 Codes
Enter the following formula in G2:
=XLOOKUP(F2,$A$2:$A$250,$B$2:$B$250,"Not found")
Press Enter, and then drag the fill handle down to convert the remaining country names.

How the formula works?
- F2: lookup value - is the country name you want to find.
- $A$2:$A$250: lookup array - contains the full country names.
- $B$2:$B$250: return array - contains the ISO Alpha-2 codes.
- "Not found" is returned when Excel cannot find an exact match.
Return ISO Alpha-3 Codes
To return a three-letter ISO code, change the return range from column B to column C:
Enter the following formula in H2:
=XLOOKUP(F2,$A$2:$A$250,$C$2:$C$250,"Not found")
Press Enter, and then drag the fill handle down to convert the remaining country names.

Convert ISO Codes to Country Names
If your worksheet contains two-letter or three-letter ISO codes, such as US, GB, CAN, or DEU, you can convert them into full country names for easier reading and reporting.
Convert ISO Alpha-2 Codes to Country Names
When the source column contains two-letter codes, reverse the lookup and return ranges. Use this formula:
=XLOOKUP(F2,$B$2:$B$250,$A$2:$A$250,"Not found")
Press Enter, and then drag the fill handle down to fill the formula into the other cells. This time, Excel searches the Alpha-2 column and returns the corresponding full country name.

How the formula works?
- F2: lookup value - is the country code you want to find.
- $B$2:$B$250: lookup array - contains the ISO Alpha-2 codes.
- $A$2:$A$250: return array - contains the full country names.
- "Not found" is returned when Excel cannot find an exact match.
Convert ISO Alpha-3 Codes to Country Names
For three-letter country codes, use this formula:
=XLOOKUP(F2,$C$2:$C$250,$A$2:$A$250,"Not found")
Press Enter, and then drag the fill handle down to return the corresponding full country names.

Convert Either Alpha-2 or Alpha-3 Codes to Country Names
When a column may contain a mixture of two-letter and three-letter ISO codes, use two XLOOKUP functions with IFERROR:
=IFERROR(XLOOKUP(F2,$C$2:$C$250,$A$2:$A$250),
XLOOKUP(F2,$B$2:$B$250,$A$2:$A$250,"Not found"))
Press Enter, and then drag the fill handle down to convert the remaining ISO codes into country names.

How the formula works?
This formula searches for the code in F2:
- It first looks in C2:C250 and returns the corresponding country name from A2:A250.
- If no match is found, IFERROR searches B2:B250 instead.
- If neither lookup finds a match, it returns “Not found.”
It can therefore convert either an ISO3 or ISO2 code into the corresponding country name.
Method 2: VLOOLKUP or INDEX and MATCH function (Older Excel versions)
XLOOKUP is not available in Excel 2016 or Excel 2019. In these versions, you can use VLOOKUP or INDEX and MATCH instead.
Convert Country Names to Codes with VLOOKUP
VLOOKUP can be used to convert country names to ISO codes because the country-name column is located on the left side of the reference table, allowing the function to search for each country name and return the corresponding ISO code from a column to its right.
VLOOKUP Syntax:
- lookup_value: The value you want to find.
- table_array: The table containing the lookup value and the result. The lookup value must be in the first column of this range.
- col_index_num: The column number in the table from which the result should be returned. The first column is 1, the second column is 2, and so on.
- [range_lookup]: Optional. Specifies the matching method:
- FALSE or 0 – Returns an exact match.
- TRUE or 1 – Returns an approximate match. The first column should be sorted in ascending order.
Return an Alpha-2 code
=VLOOKUP(F2,$A$2:$C$250,2,FALSE)
Press Enter, and then drag the fill handle down to return the corresponding Alpha-2 codes.
Return an Alpha-3 code
=VLOOKUP(F2,$A$2:$C$250,3,FALSE)
Press Enter, and then drag the fill handle down to return the corresponding Alpha-3 codes.

In these formulas:
- F2: lookup value - contains the country name.
- $A$2:$C$250: table array – is the reference table.
- 2 returns the second column, containing Alpha-2 codes.
- 3 returns the third column, containing Alpha-3 codes.
- FALSE requires an exact match.
Convert ISO Codes to Country Names with INDEX and MATCH
Because VLOOKUP can only search the first column of the lookup range, converting codes back to country names requires rearranging the reference table or using INDEX and MATCH.
General INDEX and MATCH Formula:
- return_range: The range containing the result you want to return.
- lookup_value: The value you want to find.
- lookup_range: The range in which Excel searches for the lookup value.
- 0: Requires MATCH to find an exact match.
Convert Alpha-2 codes to country names
=INDEX($A$2:$A$250,MATCH(F2,$B$2:$B$250,0))
This formula searches for the ISO Alpha-2 code in F2 within column B, then returns the corresponding country name from column A.

How the formula works?
- $A$2:$A$250: The return range containing the country names.
- F2: The ISO code you want to find.
- $B$2:$B$250: The lookup range containing the ISO Alpha-2 codes.
- 0: Requires an exact match.
- MATCH(...): Finds the relative position of the ISO code in column B.
- INDEX(...): Returns the country name from the same position in column A.
Convert Alpha-3 codes to country names
=INDEX($A$2:$A$250,MATCH(F2,$C$2:$C$250,0))
This formula searches for the ISO Alpha-3 code in F2 within column C, then returns the corresponding country name from column A.

Convert either Alpha-2 or Alpha-3 codes to country names
If your data includes both Alpha-2 and Alpha-3 country codes, you can combine the INDEX and MATCH functions with IFERROR to return the corresponding country names. It can handle mixed codes such as US, CAN, DE, and JPN in the same column.
=IFERROR(INDEX($A$2:$A$250,MATCH(F2,$B$2:$B$250,0)),
INDEX($A$2:$A$250,MATCH(F2,$C$2:$C$250,0)))
This formula converts either an ISO Alpha-2 or ISO Alpha-3 code in cell F2 into its corresponding country name.

How the formula works?
- The first INDEX/MATCH searches for F2 in B2:B250, which contains ISO Alpha-2 codes.
- If no match is found, IFERROR runs the second INDEX/MATCH and searches C2:C250, which contains ISO Alpha-3 codes.
- Once a match is found, INDEX returns the corresponding country name from A2:A250.
Advantages and Limitations of the Formula Method
Advantages
- Uses standard Excel functions.
- Automatically updates when the source value changes.
- Works well when the same reference table is used repeatedly.
Limitations
- You must create or obtain a complete country-code reference table.
- Country names must match the names in the reference table.
- Alternate names and spelling variations may return “Not found.”
- The reference list must be maintained when ISO records change.
- Formulas return results in another column rather than converting the original cells directly.
Notes:
- For example, United States, United States of America, and USA may be treated as different lookup values unless your reference table accounts for them.
- Also note that some commonly used abbreviations are not official ISO codes. For example, the official Alpha-2 code for the United Kingdom is GB, although UK is frequently used in ordinary data.
Method 3: Convert Country Names and ISO Codes with Kutools for Excel
If you do not want to create a reference table or write lookup formulas, Kutools for Excel provides a dedicated Convert Country Names and ISO Codes feature.
It supports the following operations:
- Convert country names to ISO2 codes.
- Convert country names to ISO3 codes.
- Convert ISO2 or ISO3 codes to country names.
This method is especially useful for processing a long list of countries directly within the selected Excel range.
Tip: Because the conversion may replace the selected cell values, copy the original column or save a backup before processing important data.
- Select the cells containing the country names or ISO codes you want to convert.
- Click Kutools > Content > Convert Country/Region Names and ISO Codes, see screenshot:

- In the dialog box, select the appropriate conversion option based on the format of your source data and the result you want to obtain. (here, I will choose Convert ISO2/ISO3 Codes to Country Names)

- Click OK to apply the conversion.

Advantages of Kutools for Excel
Kutools for Excel provides a faster and more convenient way to convert country names and ISO codes without creating a reference table or writing lookup formulas.
- No formulas required: Complete the conversion through a simple dialog box.
- No reference table needed: Kutools includes the required country-name and ISO-code mappings.
- Supports multiple conversions: Convert country names to ISO2 or ISO3 codes, or convert ISO codes back to country names.
- Handles ISO2 and ISO3 codes: Convert mixed two-letter and three-letter codes using the same option.
- Suitable for bulk processing: Convert an entire selected range at once.
- Preview before applying: Review the converted results in the Preview pane before changing the worksheet.
- Easy to use: Ideal for users who are unfamiliar with XLOOKUP, VLOOKUP, or INDEX and MATCH.
Try Kutools for Excel
Convert country names and ISO codes in just a few clicks, process entire ranges at once, and simplify many other repetitive Excel tasks.
Excel Formulas vs. Kutools for Excel
The best method depends on your Excel version, formula experience, and whether you want dynamic results or a quick direct conversion.
- Use an Excel formula when the source data changes frequently and the results need to update automatically.
- Use Kutools for Excel when you need a quick conversion without creating a country-code table, maintaining lookup ranges, or troubleshooting formulas.
| Method | Advantages | Disadvantages | Best for |
|---|---|---|---|
| XLOOKUP | Simple, flexible, and supports lookups in any direction. | Not available in some older Excel versions; requires a reference table. | Dynamic lookups in newer Excel versions. |
| VLOOKUP | Easy to use and widely supported. | Only returns values to the right; requires a reference table. | Basic left-to-right lookups. |
| INDEX and MATCH | Supports left and right lookups and works in older Excel versions. | More complex to write and understand. | Flexible lookups when XLOOKUP is unavailable. |
| Kutools for Excel | No formulas or reference table required; supports quick bulk conversion. | Requires installation; results do not update automatically. | Fast conversion of large data ranges. |
Frequently Asked Questions (FAQs)
Can Excel convert a country name to an ISO code without a lookup table?
A standard worksheet formula needs a source that contains the relationship between country names and codes. Therefore, XLOOKUP, VLOOKUP, and INDEX/MATCH require a reference table. Kutools provides a direct conversion option without requiring you to build that table manually.
What is the easiest way to convert country names to codes in Excel?
For a one-time or bulk conversion, the Kutools Convert Country Names and ISO Codes feature is usually the easiest method because it does not require formulas or a separate mapping table.
For dynamic worksheets, XLOOKUP is more suitable because the converted result updates automatically when the source value changes.
Why does the formula return “Not found”?
Common causes include:
- The country name is spelled differently from the reference table.
- The cell contains leading or trailing spaces.
- An abbreviation is used instead of the full country name.
- The code is stored in the wrong lookup column.
- The reference list does not contain the requested value.
Can I preserve the original country names when using Kutools?
Yes. Copy the country-name column to another location before running the conversion. You can then keep one column for the original names and another for the ISO codes.
Conclusion
There are two effective ways to convert country names to ISO codes and ISO codes back to country names in Excel.
Excel formulas such as XLOOKUP, VLOOKUP, and INDEX with MATCH are ideal when you already have a country-code reference table and need results that update dynamically.
For a faster bulk-conversion workflow, Kutools for Excel provides the dedicated Convert Country Names and ISO Codes feature. It can convert full country names to ISO2 or ISO3 codes and convert either code format back to country names without requiring a mapping table or lookup formula.
Choose the formula method for dynamic data and reusable models. Choose Kutools when you want to standardize country information quickly with fewer steps.
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in
Table of contents
- What Are ISO Country Codes?
- Method 1: XLOOKUP Function
- Method 2: VLOOKUP or INDEX and MATCH
- Method 3: Convert Country Names and ISO Codes with Kutools for Excel
- Excel Formulas vs. Kutools for Excel
- Frequently Asked Questions
- Conclusion
Kutools for Excel
Brings 300+ advanced features to Excel
- ⬇️ Free Download
- 🛒 Purchase Now
- 📘 Feature Tutorials
- 🎁 30-Day Free Trial