Found a Formula in a Spreadsheet Passed on to Me and Have No Idea What It's Supposed to Do

tsgnms

New Member
Joined
Jun 29, 2016
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Sorry if this is posted in the wrong place, please let me know if it is and I'll repost elsewhere.

We have a barcode calculator which was passed on to me to use when I took on responsibility for generating them.

In cell C6 of the worksheet there are the bulk of the digits that make up the barcode, and we simply add 1 to this for each new barcode we create. For the final digit, a formula has been created years ago by someone to calculate the final digit in the barcode.

I'm assuming it's my untrained eye, but I cannot make sense of the formula or why they use this to calculate barcodes, so I'm hoping someone can decipher it for me. If it turns out to be a necessary thing, then I'll keep it as is but at least I'll know what it does. If not, I plan to simplify the calculator. The formula is as follows:

=C6&(ROUNDUP(((MID(C6,2,1)+MID(C6,4,1)
+MID(C6,6,1)+MID(C6,8,1)+MID(C6,10,1)+MID(C6,12,1))*3)
+(MID(C6,1,1)+MID(C6,3,1)+MID(C6,5,1)+MID(C6,7,1)
+MID(C6,9,1)+MID(C6,11,1)),-1)-(((MID(C6,2,1)+MID(C6,4,1)
+MID(C6,6,1)+MID(C6,8,1)+MID(C6,10,1)+MID(C6,12,1))*3)
+(MID(C6,1,1)+MID(C6,3,1)+MID(C6,5,1)+MID(C6,7,1)
+MID(C6,9,1)+MID(C6,11,1))))

Can anyone help shed some light on what this is supposed to achieve?

Thank you!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I don't know much about bar codes, but that looks to be a check digit calculator. Whenever there's a long number, such as a credit card number, there typically is a check digit calculated for the last digit. This is to prevent single-digit typos essentially. It looks like that's the same thing adapted for bar codes. My guess is that you need to keep it.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,602
Members
449,089
Latest member
Motoracer88

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