View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jatman jatman is offline
external usenet poster
 
Posts: 88
Default validate data using formulae (Luhn algorithm)

the formulae is the Luhn Algorithm, and has many different variations. the
one thing that i know for sure is that i will have the number to validate in
E15. on wikipedia's site, i can download an excel format, but it shows a
table formula, something that i do not want. it also shows a vb code, but i
am not sure how i would integrate it into excel.

jat



the above is from wikipedia,
"jatman" wrote:

i am making an employee form, and one cell must validate some information.
it can be manually, but if i can get excel to do it, it would be better. i'm
using office 07.

Cell E15 will have a 9 digit number (ex. 044-096-857)
the formula would validate this number and accept it or reject it (in our
case, this would be a valid number)
The formula would rewrite this number but needs to double every second
number. The rewritten number would be 08409128107. if you add up all of
these individual numbers, you get 40 - a multiple of 10, so the number is
valid and 044-096-857 would be validated and accepted in cell E15.

if E15 had 856-247-963, the formula would rewrite that to 810644149123.
this rewritten number adds up to 43 (not a multiple of 10, so an error would
be returned indicating invalid data.

any suggestions.

jat