![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 15
|
I have a problem I can not solve.
I have a lot of cells containing figures and I need to find an east way to add the figures witin a cell. i.e 123456 would result in the sum of 21. Appreciate a fast and relevant answer. Thanks a lot /JE |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 1,802
|
are your figures always less than 10? In other words, how can you tell 1+2+3+4+5+6 from 12+34+56?
giacomo |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,030
|
G'day,
Here's J.Walk's array formula for summing digits in a positive integer: ={SUM(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)*1)} (hit Ctrl+shift+Enter to get the brackets) Adam |
|
|
|
|
|
#4 | |
|
New Member
Join Date: May 2002
Posts: 15
|
Quote:
|
|
|
|
|
|
|
#5 |
|
New Member
Join Date: May 2002
Posts: 15
|
Thanks for your fast relies !
First thing is that I do not need to seperate 123456 from 12+45+89 due to th efact that I have figures wich are partnumbers and I need to add together each separate figure in that productcode to get a sum. When I have done such its possible for me to continue with this project regarding barcode labelling calculations. So a partnumber could look like 74914440300 The sum of that is 36 etc. Regarding the formula sent as well please adopt that with the above partnumber so I get a feel for how to use it. Thanks again for your support with this. Hope to hear from you soon Thanks /JE |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Apr 2002
Location: Minnesota
Posts: 821
|
Shouldn't the final answer be 3 and not 21?
|
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
Quote:
if you can't use cell A2, then change the "A2" bit in the formula to wherever your partnumber is
__________________
:: Pharma Z - Family drugstore :: |
|
|
|
|
|
|
#8 |
|
New Member
Join Date: May 2002
Posts: 15
|
WHen it comes to building formulas I have to admit my novice knowledge.
I can not get the formula to work according to your advice. I put a partnumber in cell A2, just to make sure I didi not chnage anything in the formula. The partnumber was 74914440300. I typed in the formula exactly as you intrióduced it but when hitting Ctrl+SHIFT+ENTER I get an error message saying "error in formula" The SUM part of the formula is highlighted. I can´t get it right ! Could anyone please use the mentioned partnumber and try to use the formula with it ? DO you get the same error message ? Appreciate all your help ! Regards /JE |
|
|
|
|
|
#9 |
|
Board Regular
Join Date: Feb 2002
Location: Guderup, Denmark
Posts: 287
|
Hi
If KLB is right (checksum should be 3 and not 21) this formula will do. =IF(MOD(A1,9)=0,9,MOD(A1,9)) regards Tommy |
|
|
|
|
|
#10 | |
|
New Member
Join Date: May 2002
Posts: 15
|
If we stay with the example 123456 the sum should be 21.(1+2+3+4+5+6 = 21)
The whole problem is to add each figure within one cell. Thanks for your support ! /JE Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|