what is the best way to create a square bar code using IMAGE in excel

Kelliher, Timothy 0 Reputation points
2026-11-04T15:44:54.7333333+00:00

using Excel, I have data in a cell that I want to convert to a square bar code in an adjecent cell

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

2 answers

Sort by: Newest
  1. Ruby Nguyen 3,640 Reputation points Independent Advisor
    2026-11-04T16:26:01.3666667+00:00

    Good day Kelliher, 

    The square barcode you want is a QR code. The IMAGE function can display an image in a cell, but it cannot generate a QR code directly from text. Here are some options you can consider: 

    Option 1: Use IMAGE for automatic QR codes 

    • Enter your data in A2. 
    • Generate a QR code image URL using an organization approved QR code service. 
    • Save the image URL in C2. 
    • Enter the formula below in B2: 
    =IMAGE(C2,"QR code",0) 
    
    • Adjust the row height and column width to make the cell square. 
    • Copy the formula down for other rows. 

    Option 2: Use an Excel add-in 

    • Open Excel > Select Home > Add-ins > More Add-ins. 
    • Search for a QR code or barcode generator. 
    • Review the publisher and permissions, then install the add-in. 
    • Follow the add-in instructions to generate QR codes from your worksheet data. 

    Please note that any add-ins suggested by the community are provided for convenience and may come from third-party providers. They aren't developed, managed, or verified by Microsoft. I cannot confirm the quality, security, or suitability of these add-ins, so I recommend reviewing the publisher, permissions and privacy information carefully before installing or using them. 

    Option 3: Use Microsoft Word 

    • Open Word for Windows > Press Ctrl + F9. 
    • Enter: 
    DISPLAYBARCODE "Your value" QR  
    
    • Press F9 to generate the QR code. 
    • Copy the QR code, then in Excel select Paste Special > Picture (Enhanced Metafile). 

    This method works entirely within Microsoft applications, but the QR code won't update automatically when the Excel value changes. 

    Additional information is available in the following resources: 

    IMAGE function | Microsoft Support 

    Field codes: DisplayBarcode | Microsoft Support 

    I completely understand how these limitations in Excel can feel disruptive. It’s not just about aesthetics; these differences can genuinely affect how smoothly you work and navigate your day. 

    As a forum user, I hope you understand that I don’t have the ability to modify or escalate product issues directly. However, I strongly recommend submitting your feedback through the Excel · Community. This is the most effective way to ensure your voice reaches the product team and can be considered for future improvements. Once you've submitted your feedback, feel free to share the link here in the comments. I’ll be happy to upvote it to help bring more visibility. 

    Thank you for your patience and understanding. 


    If you have any extra questions about this answer, please click "Comment".            

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-11-04T15:45:46.2966667+00:00

    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:

    1. Press Enter; B2 should display a square QR code.
    2. Increase the row height and column width if needed.
    3. Fill the formula down to generate codes for additional rows.
    4. 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? on IMAGE: Confirm that the desktop Excel installation is a Microsoft 365 build containing the IMAGE function.
    • #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 3 to 0 so Excel fits the image while preserving its aspect ratio.^1^

    References

    1. IMAGE function | Microsoft Support
    2. ENCODEURL function | Microsoft Support
    3. QR code API: command “create-qr-code” (generate QR code, QR code generator)
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.