Generate a QR Code with Excel

Generate a QR Code with Excel
Last Updated on 20/04/2024
Reading time: 3 minutes

Learn how to generate a QR code with Excel! QR codes are an easy way to share information like URLs, contacts or locations with a mobile app.

In this guide, we'll demonstrate the process of converting cell data into a QR code by utilizing an API alongside Excel's IMAGE function.

  1. What is an API?

    An API is a program that you call through a URL

  2. Argument of the API

    Then, you must fill arguments to return your QR Code

  3. IMAGE function

    To convert the result of the API to a QR Code, you must use the IMAGE function

  4. Convert the result as pictures

    Last step, you must convert the result returns by the IMAGE function to a picture

What is an API?

To generate a QR Code we will use an API. But what is an API?

  • An API, or Application Programming Interface, is a program that simplifies complex tasks.
  • An API is a URL. Behind the URL there is a program.
  • By sending arguments to the URL, you give more details to the API to return what you expect.

To generate a QR code with Excel, you will need to use the following API:

https://chart.googleapis.com/chart?

After that, you need to add these three mandatory arguments:

  • cht=qr: the type of code to return
  • chs: the size of the image (a square of the kind 300x300)
  • chl: the source to encode

For complete documentation about the arguments, you can refer to the following address

The IMAGE function

The IMAGE function is available in Excel 365, Excel Online and Excel 2019. You can display an image in a cell directly from its URL address.

Since the API is a URL, the IMAGE function will convert the URL to a QR code for you 😎

Creation of the QR Code

  • To create a QR code with Excel, you must link the API with its three arguments and the cell's contents.
  • To link the API string with the cell content, you need to use the symbol &.
  1. Let's take the URLs of these Google Maps locations.
URL Google Maps
  1. Then, we link the API with the cell's content.

= "https://chart.googleapis.com/chart?cht=qr&chs=400x400&chl="&A2

Full string for the API
  1. And to convert the API into an image, you just have to embed the API in the IMAGE function.

=IMAGE("https://chart.googleapis.com/chart?cht=qr&chs=400x400&chl="&A2)

QR Code generated

How to check QR Code?

After creating the QR codes, you can check to see if they work by scanning them with a mobile phone.

Scan a QR Code with a mobile

The mobile apps will open Google Maps with the location you encoded in the QR code. The first link is the Niagara Falls 👍

Niagara falls on Google Maps

Convert QR code to image

However, there is one problem.

  • QR codes result from a formula, so you can't export them to another support as is.
  • You must convert each QR code into an image to solve this issue.

To do this:

  1. Copy the cell containing the QR code
  2. Open the Paste Special menu
  3. select Picture and export the image
Paste Special Picture

With these simple steps, you can generate and export QR codes with Excel quickly and easily 😀👍

QR code Google Maps Niagara falls

4 Comments

  1. Nikos Nt
    09/08/2023 @ 10:52

    Very helpful and thank you.
    I have one issue though, when i save the excel file and reopen it , all the QR code have an error #Field. When i double click the cell and press enter at formula the QR appears again. could you provide me a solution?

    Thank you very much

    Reply

    • Frédéric LE GUEN
      24/08/2023 @ 12:07

      Hi, Have you converted the result in picture?

      Reply

  2. Richard
    15/03/2023 @ 14:23

    Good afternoon,

    Why would the below formula not work anymore? it was working perfectly until last Friday.

    =IMAGE("https://chart.googleapis.com/chart?cht=qr&chs=400x400&chl="&A2)

    Thank you,

    Richard

    Reply

    • Frédéric LE GUEN
      18/03/2023 @ 08:33

      No idea. I haven't tried recently

      Reply

Leave a Reply

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

Generate a QR Code with Excel

Reading time: 3 minutes
Last Updated on 20/04/2024

Learn how to generate a QR code with Excel! QR codes are an easy way to share information like URLs, contacts or locations with a mobile app.

In this guide, we'll demonstrate the process of converting cell data into a QR code by utilizing an API alongside Excel's IMAGE function.

  1. What is an API?

    An API is a program that you call through a URL

  2. Argument of the API

    Then, you must fill arguments to return your QR Code

  3. IMAGE function

    To convert the result of the API to a QR Code, you must use the IMAGE function

  4. Convert the result as pictures

    Last step, you must convert the result returns by the IMAGE function to a picture

What is an API?

To generate a QR Code we will use an API. But what is an API?

  • An API, or Application Programming Interface, is a program that simplifies complex tasks.
  • An API is a URL. Behind the URL there is a program.
  • By sending arguments to the URL, you give more details to the API to return what you expect.

To generate a QR code with Excel, you will need to use the following API:

https://chart.googleapis.com/chart?

After that, you need to add these three mandatory arguments:

  • cht=qr: the type of code to return
  • chs: the size of the image (a square of the kind 300x300)
  • chl: the source to encode

For complete documentation about the arguments, you can refer to the following address

The IMAGE function

The IMAGE function is available in Excel 365, Excel Online and Excel 2019. You can display an image in a cell directly from its URL address.

Since the API is a URL, the IMAGE function will convert the URL to a QR code for you 😎

Creation of the QR Code

  • To create a QR code with Excel, you must link the API with its three arguments and the cell's contents.
  • To link the API string with the cell content, you need to use the symbol &.
  1. Let's take the URLs of these Google Maps locations.
URL Google Maps
  1. Then, we link the API with the cell's content.

= "https://chart.googleapis.com/chart?cht=qr&chs=400x400&chl="&A2

Full string for the API
  1. And to convert the API into an image, you just have to embed the API in the IMAGE function.

=IMAGE("https://chart.googleapis.com/chart?cht=qr&chs=400x400&chl="&A2)

QR Code generated

How to check QR Code?

After creating the QR codes, you can check to see if they work by scanning them with a mobile phone.

Scan a QR Code with a mobile

The mobile apps will open Google Maps with the location you encoded in the QR code. The first link is the Niagara Falls 👍

Niagara falls on Google Maps

Convert QR code to image

However, there is one problem.

  • QR codes result from a formula, so you can't export them to another support as is.
  • You must convert each QR code into an image to solve this issue.

To do this:

  1. Copy the cell containing the QR code
  2. Open the Paste Special menu
  3. select Picture and export the image
Paste Special Picture

With these simple steps, you can generate and export QR codes with Excel quickly and easily 😀👍

QR code Google Maps Niagara falls

4 Comments

  1. Nikos Nt
    09/08/2023 @ 10:52

    Very helpful and thank you.
    I have one issue though, when i save the excel file and reopen it , all the QR code have an error #Field. When i double click the cell and press enter at formula the QR appears again. could you provide me a solution?

    Thank you very much

    Reply

    • Frédéric LE GUEN
      24/08/2023 @ 12:07

      Hi, Have you converted the result in picture?

      Reply

  2. Richard
    15/03/2023 @ 14:23

    Good afternoon,

    Why would the below formula not work anymore? it was working perfectly until last Friday.

    =IMAGE("https://chart.googleapis.com/chart?cht=qr&chs=400x400&chl="&A2)

    Thank you,

    Richard

    Reply

    • Frédéric LE GUEN
      18/03/2023 @ 08:33

      No idea. I haven't tried recently

      Reply

Leave a Reply

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