How to Add Flags pictures in Excel?

Last Updated on 13/11/2024
Reading time: 2 minutes

To add flags next to country names or country codes in Excel, you need 4 steps:

  1. Download the CSV file of flag URLs
  2. Import and transform the CSV file
  3. Use the IMAGE function
  4. 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:

  1. Data > From Text / CSV
  2. Select the CSV file in the browser
  3. Click on Transform data
Import CSV with Power Query
  1. Click on the upper-left icon
  2. Select First Row as Header
  3. And to finish, Close & Load
First Row as Header

The result looks like this:

Import of the URL countries flags

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)

Countries flag in Excel cells

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

Flag as value in an Excel cell

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

How to Add Flags pictures in Excel?

Reading time: 2 minutes
Last Updated on 13/11/2024

To add flags next to country names or country codes in Excel, you need 4 steps:

  1. Download the CSV file of flag URLs
  2. Import and transform the CSV file
  3. Use the IMAGE function
  4. 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:

  1. Data > From Text / CSV
  2. Select the CSV file in the browser
  3. Click on Transform data
Import CSV with Power Query
  1. Click on the upper-left icon
  2. Select First Row as Header
  3. And to finish, Close & Load
First Row as Header

The result looks like this:

Import of the URL countries flags

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)

Countries flag in Excel cells

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

Flag as value in an Excel cell

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *