Excel to Google Sheets formula conversion query - Generating a GTIN-14 with an indicator digit based on an existing GTIN-13

BFSheets

New Member
Joined
Mar 13, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I've been asked to revamp the barcode system at work on Google sheets, porting it over from an old Excel document. I understand not all formulae carry over smoothly, and it appears the GTIN-14 that is generated with a formula for our Inner and Outer carton packaging doesn't like the transition.

As an example, a GTIN-13 we have for a retail product is 9350466000009. For the inner carton that those products are packed in, the new barcode has to add a 1 to the beginning.
In the original Excel document, the formula is as follows: =CONCAT("1",(LEFT(F4,LEN(F4)-1)),(MOD(-SUM(MID(CONCAT("1",(LEFT(F4,LEN(F4)-1)))&0,{1,3,5,7,9,11,13;2,4,6,8,10,12,14},1)*{3;1}),10)))
What results is the string: 19350466000006

Bringing the formula over to Google Sheets, I've at least worked out that I need to change CONCAT to CONCATENATE and that at least outputs a 14 digit string, however the new number 19350466000007 doesn't match what was outputted on excel.

I'm hoping this is just a syntax issue, so if someone could please help me rewrite this formula in a way that
Google Sheets appreciates, that would be greatly appreciated!

TL;DR: Need to rewrite an excel formula to work for Google sheets. Old excel formula: =CONCAT("1",(LEFT(F4,LEN(F4)-1)),(MOD(-SUM(MID(CONCAT("1",(LEFT(F4,LEN(F4)-1)))&0,{1,3,5,7,9,11,13;2,4,6,8,10,12,14},1)*{3;1}),10))) where F4 is where the data is being referenced from.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top