View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bill Ridgeway Bill Ridgeway is offline
external usenet poster
 
Posts: 268
Default can i multiply digits of a number by a constant in excel?

Something like -
=LEFT(A5,1)*2+MID(A5,2,1)*3+MID(A5,3,1)*4
will do the trick.

LEFT takes the first digit and multiplies it by 2 (the multiplier can be
changed)
and adds
MID takes the second digit and multiplies it by 3 (can be changed)
and adds
MID takes the third digit and multiplies it by 4

You can modify this according to the number of digits and multiplier . It
does, however, expect the base number to have the same number of digits
every time. If the number of digits in the base number is variable the
formula will have to be varied (and become more complicated). If so come
back and I will have a re-think. I wouldn't be surprised if this is not the
most eloquent solution!

Regards.

Bill Ridgeway
Computer Solutions

"El Criollo" <El wrote in message
...
What I want to do is to calculate a "check digit" based on a number. First
digit of the number is multiplied by 2, next by 3, ... next by 7, next by
2
again..