ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do I add all numbers in the same cell... 1234 = 10 (https://www.excelbanter.com/excel-discussion-misc-queries/115557-how-do-i-add-all-numbers-same-cell-1234-%3D-10-a.html)

DR_LR_N_SC

how do I add all numbers in the same cell... 1234 = 10
 
I am using Excel 2003 and I am trying to simply add numbers in a cell.
for example cell A1 is 57, I want B1 to be 12 (5+7) and so on. I realize
this means adding the hundreds place, tens, place and ones place, I would
like to be able to modify the formula to let me add at least a 6 digit
number. is there a formula for doing this.



JMB

how do I add all numbers in the same cell... 1234 = 10
 
if your data is in cell A1, try

=SUMPRODUCT(--(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)))


"DR_LR_N_SC" wrote:

I am using Excel 2003 and I am trying to simply add numbers in a cell.
for example cell A1 is 57, I want B1 to be 12 (5+7) and so on. I realize
this means adding the hundreds place, tens, place and ones place, I would
like to be able to modify the formula to let me add at least a 6 digit
number. is there a formula for doing this.



Ron Coderre

how do I add all numbers in the same cell... 1234 = 10
 
Try something like this:

With a number in A1

B1: =SUMPRODUCT(--MID(A1,ROW($A$1:INDEX($A:$A,LEN(A1),1)),1))

If A1: 1234........B1 returns 10
If A1: 1001........B1 returns 2

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"DR_LR_N_SC" wrote:

I am using Excel 2003 and I am trying to simply add numbers in a cell.
for example cell A1 is 57, I want B1 to be 12 (5+7) and so on. I realize
this means adding the hundreds place, tens, place and ones place, I would
like to be able to modify the formula to let me add at least a 6 digit
number. is there a formula for doing this.




All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com