2 Ways to Generate a QR Code in Google Sheets

Do you want to add QR codes to your Google Sheets?

A Quick Response code or QR code is made up of several black and white squares of indeterminable sizes arranged in a specific pattern. It stores various data types such as text, URLs, or contact information which can be read by scanning with a QR code scanner or a smartphone camera.

QR codes have become an essential tool for businesses to engage with their customers and do other things such as track customer purchases or provide discounts for loyalty programs.

You can create QR codes in Google Sheets following a very easy and simple process. With just a few clicks, you can generate a dynamic QR code that can be used in various ways.

In this post, you will learn all the ways you can create QR codes using Google Sheets.

Generate a QR Code with the IMAGE and ENCODEURL Functions

The IMAGE function in Google Sheets is used for inserting images into cells in a spreadsheet.

This function lets you easily display images in your spreadsheet, such as photos or logos.

= IMAGE ( URL, [mode], [height], [width])

IMAGE has four arguments.

  • URL – The URL of the image you want to insert into the cell. This can be a web address or a direct link to an image file.
  • [mode] – This specifies how the image should be resized to fit in the cell. The mode argument has three options that you can use to modify image size – fit, fill, and crop.
    • For fit set the mode argument to 1 or leave it empty. This resizes the image to fit within the cell dimensions while maintaining the aspect ratio.
    • For fill set the mode argument to 2. The fill option resizes the image to fill the cell, cropping the excess if necessary.
    • For crop set the mode argument to 3. The crop option resizes the image to fit within the cell dimensions by cropping it if necessary.
  • [height] – This sets the height of the image in pixels. If this parameter is not provided, the image will be displayed at its original height.
  • [width] – This sets the width of the image in pixels. If this parameter is not provided, the image will be displayed at its original width.

Only the URL argument is required when using the IMAGE function. The [mode], [height], and [width] arguments are all optional.

The ENCODEURL function allows you to safely pass a URL string into another formula. It removes spaces, special characters, or any other characters that can cause errors when using a URL in another formula.

= ENCODEURL ( text )

The ENCODEURL function takes the text argument as the URL string you want to encode.

To create a QR code using both functions, follow these steps.

Copy and paste the URL you want to use for the QR code into an empty cell.

= IMAGE ( "https://chart.googleapis.com/chart?cht=qr&chs=700x400&chl=" & ENCODEURL ( B3 ) )

Copy and paste the syntax above into a cell to create the QR code based on the contents of cell B3.

Here’s a breakdown of how this formula works from the inside out.

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

This is the URL of the Google Chart API that generates the QR code image. The root URL which is "https://chart.googleapis.com/chart?"  takes additional parameters cht=qr, chs, and chl.

The cht=qr parameter specifies that a QR code should be generated. The chs is used to specify the image size which is set to 700×400.

The chl parameter specifies the content of the QR code, using the ENCODEURL(B3) syntax. This passes the encoded version of the URL in cell B3 to the chl parameter.

All of this is concatenated using the ampersand operator &.

This creates the syntax "https://chart.googleapis.com/chart?cht=qr&chs=700x400&chl="&ENCODEURL(B3)

= "https://chart.googleapis.com/chart?cht=qr&chs=700x400&chl=" & ENCODEURL ( B3 )

When you enter only the above syntax in the cell, it will create a URL that contains a barcode.

Wrapping the Google Chart API syntax in the IMAGE function brings the QR code into a cell in the spreadsheet.

You can use the paste special command (Ctrl + Shift + V) to remove the syntax and keep only the QR code.

You can now scan the QR code using your phone’s camera.

Generate a QR Code with the QR Code Generator Add On

Google Sheets add-ons enhance the capabilities of spreadsheet software. Add-ons can provide a variety of different features and tools for data analysis, collaboration, and visualization.

You can use the QR Code Generator add-on to create QR codes in your spreadsheet.

To download an add-on, go to the Extensions menu, click on Add-ons, and select Get add-ons to get into the Google Workspace Marketplace.

Search for QR Code Generator. Click to download and install. You’ll have to grant permissions before you can use the add-on in your spreadsheet.

The add-on will display in the Extensions menu after installation. Click on Open in the contextual menu.

To use the add-on, go to the window that’s open on the right-hand side of the spreadsheet and follow these steps.

  1. Select a cell containing the item you want to use for the QR code.
  2. Check the Save as Document or Save as PNG (or both) options. The Save as Document will insert the generated QR code into a new Google Docs document, while the Save as PNG option will create an image file of the QR code that will be saved in your drive.
  3. Click on GENERATE.

After generating the QR code, you can use the Open Document or Open Folder option to access the QR code.

The benefit of using the add-on is that it helps you create easily sharable QR codes. And it’s also very helpful when you want to create many QR codes at once.

To create multiple QR codes at once, select the cells containing the items you want to use for the QR code and repeat the earlier steps.

Conclusions

Creating a QR code in Google Sheets is an easy and fast way to generate a unique code for any purpose. It can be used to share information quickly and securely, such as contact details or links to websites.

You can use the Google Sheets API method if you’re generating a couple of QR codes that you want in a spreadsheet file.

If you don’t need to include the QR code in a spreadsheet file and you want to share it with others, then using the QR Code Generator add-on would be a better option. This is because the add-on is extremely user-friendly and efficient.

Do you think you will find this helpful? Let me know in the comments section!

About the Author

Oluwaseun Olatoye

Oluwaseun Olatoye

Oluwaseun is a business intelligence analyst with expertise in Google Sheets and SQL programming language. He has worked with various businesses to make data-driven decisions. He enjoys helping others learn and grow.

Related Articles

Comments

0 Comments

Get the Latest Google Sheets Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in Google Sheets!