Skip to content

Instantly share code, notes, and snippets.

@corylanou
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corylanou/c412b73b4d7c9d358397 to your computer and use it in GitHub Desktop.
Save corylanou/c412b73b4d7c9d358397 to your computer and use it in GitHub Desktop.
Calculate a mod 10 Checksum (upc) in open office calc
=IF(10-RIGHT((((MID(G123;1;1) + MID(G123;3;1) + MID(G123;5;1) + MID(G123;7;1) + MID(G123;9;1) + MID(G123;11;1))*3) + (MID(G123;2;1) + MID(G123;4;1) + MID(G123;6;1)+MID(G123;8;1)+MID(G123;10;1)+MID(G123;12;1)))/10*10;1)=10;0;10-RIGHT((((MID(G123;1;1) + MID(G123;3;1) + MID(G123;5;1) + MID(G123;7;1) + MID(G123;9;1) + MID(G123;11;1))*3) + (MID(G123;2;1) + MID(G123;4;1) + MID(G123;6;1)+MID(G123;8;1)+MID(G123;10;1)+MID(G123;12;1)))/10*10;1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment