Home » Expert » Generate a QR Code with Excel

Generate a QR Code with Excel

Reading time: 3 minutes
Last Updated on 15/05/2023 by Frédéric LE GUEN

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

QR Code generated

In this article, we will show you how to encode the contents of your cells into a QR code using an API and the IMAGE function in Excel.

What is an API, you ask?

We will use an API to automatically encode the data of a cell in a QR code.

  • An API, or Application Programming Interface, is a program that simplifies complex tasks.
  • To use an API, you call it with a URL
  • You can send arguments to the URL to perform the task.

To generate a QR code with Excel, you will need to use the following API: https://chart.googleapis.com/chart?

After that, you will need to add 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, you can refer to the following address

The IMAGE function

The IMAGE function, which appeared in Excel 365 and Excel Online at the end of 2022, allows you to display an image from a certified https source in an Excel cell.

Since the API is a URL, the IMAGE function can create the QR code for you 😎

Creation of the QR Code

  • To create a QR code with Excel, you simply need to 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 &.

Let's take the URLs of these Google Maps locations.

URL Google Maps

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

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

Download the file with 4 examples

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.

Niagara falls on Google Maps

Convert QR code to image

However, there is one problem.

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

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

2 Comments

  1. 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 15/05/2023 by Frédéric LE GUEN

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

QR Code generated

In this article, we will show you how to encode the contents of your cells into a QR code using an API and the IMAGE function in Excel.

What is an API, you ask?

We will use an API to automatically encode the data of a cell in a QR code.

  • An API, or Application Programming Interface, is a program that simplifies complex tasks.
  • To use an API, you call it with a URL
  • You can send arguments to the URL to perform the task.

To generate a QR code with Excel, you will need to use the following API: https://chart.googleapis.com/chart?

After that, you will need to add 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, you can refer to the following address

The IMAGE function

The IMAGE function, which appeared in Excel 365 and Excel Online at the end of 2022, allows you to display an image from a certified https source in an Excel cell.

Since the API is a URL, the IMAGE function can create the QR code for you 😎

Creation of the QR Code

  • To create a QR code with Excel, you simply need to 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 &.

Let's take the URLs of these Google Maps locations.

URL Google Maps

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

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

Download the file with 4 examples

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.

Niagara falls on Google Maps

Convert QR code to image

However, there is one problem.

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

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

2 Comments

  1. 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 *