Brian Dunning's FileMaker Custom Functions

upcCheckDigit ( upcString )

Calculates UPC code check digit for any length UPC code. NOTE: Requires FMP 18 or later

  Be the first to rate this function Log in to vote

Andrew Sasaki   Andrew Sasaki - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
upcCheckDigit ( "72554-00192" )
upcCheckDigit ( "6927719811693" )
  Sample output:

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Given a UPC code without a check digit, this will generate the check digit. The formula is:

* Sum of the odd digits - the first, third, fifth, etc. - multiplied by 3
* Sum of the even digits added to the first sum
* The difference between that number and the number rounded up top the nearest multiple of 10 is the check digit



Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 19 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: