How to create barcode in Excel
This is a step-by-step guide on how to create a barcode in Excel. Generating barcodes takes only a few steps, but you will need to download and install a free barcode font. The alternative would be to use Excel barcode add-ins.
You can download the Excel spreadsheet I’ve used when making this tutorial.
How to generate barcodes in Excel
If you want to create a barcode in Excel that any barcode scanner can recognize, follow the steps described below.
Step 1: Download and install the barcode font Libre Barcode 39.
If you prefer a two-row barcode, you can use Libre Barcode 39 Text (this also includes the text under the barcode). If you haven’t installed fonts before, read this tutorial from Microsoft.
Note: Other barcode fonts are available online, but I prefer to use Google Fonts. Feel free to do your research and choose the one that best fits your project.
Step 2: Launch Excel and create a blank spreadsheet.
Step 3: Create two columns named Code and Barcode.
The Code column will store the alphanumeric data, which is used to generate the barcode. The Barcode column will contain the actual barcodes.
Step 4: Format the cells in the Code column as Text.
To convert cell format to Text, select the Code column, right-click on it, and select Format Cells.
From the Format Cells dialog box, select the Text format, and click OK.
Note: This step is needed to prevent Excel from removing leading zeros from your codes.
Step 5: Enter the formula
="*"&B3&"*" in the first empty cell from the Barcode column.
Copy the formula downwards to as many cells as needed. The asterisk (*) symbol indicates the beginning and the end of the sequence.
Note: If your data is stored in other columns, adjust the formula accordingly.
Step 6: Select the cells from your Barcode column (except for the header row) and change the font to Libre Barcode 39.
Navigate to the Home tab with the cells selected and choose Libre Barcode 39 from the Font menu. Also, increase the font size to match your needs. I have used a font size of 26.
Step 7: Enter alphanumeric data into the Code column to generate the barcodes.
How to generate random barcodes
You can use the RANDBETWEEN function to generate random numbers. The RANDBETWEEN function uses two arguments (bottom, top) to generate a random number. Using the bottom and top arguments, you can control the range of potential random numbers.
Using the same process described in the previous section, you can also create a barcode that is randomly generated.
I have created a random barcode generator using the following formula:
- cell B3 is the bottom limit for the barcode generator
- cell C3 is the top limit for the barcode generator
I have included the Excel spreadsheet I’ve used to create random barcodes. Download it and use it as you please. Just make sure to install the barcode font or change it to the one you have installed.
Create barcodes in Excel using add-in
If you don’t want to create barcodes manually, you can use an Excel add-in. I have included a list with some of the most popular add-ins to create barcodes:
What to do next?
After reading this tutorial, I hope that you are better equipped to create barcodes in Excel. If you struggle to replicate the process shown in this article, drop me a comment below, and I’ll help you out as soon as possible.