To add flags next to country names or country codes in Excel, you need 4 steps:
- Download the CSV file of flag URLs
- Import and transform the CSV file
- Use the IMAGE function
- Paste as values
Step 1: Download the CSV file of flag URLs
You can find this file by following this link or clicking the button below:
Step 2: Import the File with Power Query
For any data import, whether from the web, external files, or databases, it is strongly recommended to use Power Query. The tool is specifically designed to simplify the import process. In this case, the import is very simple because the CSV file contains only 4 columns. In this example, I only needed to:
- Data > From Text / CSV
- Select the CSV file in the browser
- Click on Transform data

- Click on the upper-left icon
- Select First Row as Header
- And to finish, Close & Load

The result looks like this:

Step 3: Use the IMAGE Function
The IMAGE function, which is available only in Excel 365, allows you to retrieve the flag images from their URLs. It doesn't work with a local path C:\users\...
=IMAGE(D2)

Step 4: Convert Formulas to Images
The final step is to convert the images in column D into actual images. Because for now, they are just the result of the IMAGE function. The trick here is to do a paste in VALUES. The mistake will be to paste in image, but that's wrong
- Select column D (all the cells containing the flags)
- Copy (Ctrl + C)
- Paste as Values (Ctrl + Shift + V). You can find other techniques for pasting as values in this article.
Now you have an Excel file containing all the flags as images for each country! The icon next to the cell indicates that the image behaves like data, as Excel now allows us to do (more details here).
