A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Enter an IMAGE formula in the adjacent cell that sends the source value to an HTTPS QR-code image service.
If the data is in A2, enter this in B2:
=IF(A2="","",IMAGE(
"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data="&ENCODEURL(A2),
"QR code for "&A2,
3,150,150))
Then:
- Press Enter; B2 should display a square QR code.
- Increase the row height and column width if needed.
- Fill the formula down to generate codes for additional rows.
- Scan a test code before printing or distributing the workbook.
IMAGE accepts an HTTPS image URL and can place the result inside a cell. Its 3,150,150 arguments specify a custom display size of 150 × 150 pixels.^1^ ENCODEURL safely encodes spaces and other special characters in the value; it is supported in Excel for Microsoft 365 on Windows but not Excel for the web or Mac.^2^
The formula uses goQR’s third-party QR-generation endpoint.^3^ The contents of A2 are therefore sent to that external service—do not use this approach for passwords, confidential records, personal information, or other sensitive data without organizational approval.
If the formula does not work
-
#NAME?onIMAGE: Confirm that the desktop Excel installation is a Microsoft 365 build containing theIMAGEfunction. -
#BLOCKED!: Excel has blocked external images. Use the workbook’s security notification to permit external content only if the source is trusted. -
#CONNECT!: The QR service is unreachable or the network is blocking it. -
#VALUE!: Check that the formula uses the correct list separator for the regional settings. Some installations require semicolons instead of commas. - Image distortion: Keep height and width equal and avoid stretching the cell disproportionately. Alternatively, change sizing mode
3to0so Excel fits the image while preserving its aspect ratio.^1^
References