![]() |
can i multiply digits of a number by a constant in excel?
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.. |
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.. |
can i multiply digits of a number by a constant in excel?
Excellent...worked perfect... Thank you a lot
Now I have another question... Say A=65, B=66.. etc.. I want to convert the alfanumeric value "AB25" into 656625... Cant find the way to replace A for 65 and B for 66 followed by 25 to make a single number... Is this possible??? THANX "Bill Ridgeway" wrote: 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.. |
can i multiply digits of a number by a constant in excel?
See one of your two other posts.
-- David Biddulph "El Criollo" wrote in message ... Excellent...worked perfect... Thank you a lot Now I have another question... Say A=65, B=66.. etc.. I want to convert the alfanumeric value "AB25" into 656625... Cant find the way to replace A for 65 and B for 66 followed by 25 to make a single number... Is this possible??? |
All times are GMT +1. The time now is 06:05 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com