Help

Re: EAN-13 barcode generator

570 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Eva-Maria_Sigur
5 - Automation Enthusiast
5 - Automation Enthusiast

I am new to airtable and I am using airtable as our Products database, and when we make a new product it needs to get a EAN-13 barcode. We get the first 9 numbers from the government, then we add the next 3 and the last one is calculated.
image

Field 1 = 9 first diget
Field 2 = auto number
Field 3 = adding “0” so the cell has 3 number in it
Field 4 = Field 1 & Field 3
Field 5 = calculated last number
Field 6 = Field 4 & Field 5

The formula is:
CEILING((VALUE(MID({EAN+rad},1,1))*1)+(VALUE(MID({EAN+rad},2,1))*3)+(VALUE(MID({EAN+rad},3,1))*1)+(VALUE(MID({EAN+rad},4,1))*3)+(VALUE(MID({EAN+rad},5,1))*1)+(VALUE(MID({EAN+rad},6,1))*3)+(VALUE(MID({EAN+rad},7,1))*1)+(VALUE(MID({EAN+rad},8,1))*3)+(VALUE(MID({EAN+rad},9,1))*1)+(VALUE(MID({EAN+rad},10,1))*3)+(VALUE(MID({EAN+rad},11,1))*1)+(VALUE(MID({EAN+rad},12,1))*3),10)-((VALUE(MID({EAN+rad},1,1))*1)+(VALUE(MID({EAN+rad},2,1))*3)+(VALUE(MID({EAN+rad},3,1))*1)+(VALUE(MID({EAN+rad},4,1))*3)+(VALUE(MID({EAN+rad},5,1))*1)+(VALUE(MID({EAN+rad},6,1))*3)+(VALUE(MID({EAN+rad},7,1))*1)+(VALUE(MID({EAN+rad},8,1))*3)+(VALUE(MID({EAN+rad},9,1))*1)+(VALUE(MID({EAN+rad},10,1))*3)+(VALUE(MID({EAN+rad},11,1))*1)+(VALUE(MID({EAN+rad},12,1))*3))

This formula works for this but dose any one know if there is a easier way to do this.

2 Replies 2
Zollie
10 - Mercury
10 - Mercury

What is the formula for the calculated number supposed to be doing? I think you could at least condense a few of these fields like this:

9 Digit Number (single line text)
0123345678

Autonumber (autonumber)
1

Calculated Number (formula)
4

EAN-13 (formula - see below)
01234567890014

{9 Digit Number} & REPT("0", 3 - LEN({Autonumber} & "")) & {Autonumber} & {Calculated Number}

concat_numbers

it calculates the last number in the barcode.