View Single Post
  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Fri, 9 Sep 2005 08:21:04 -0700, monkeyforce5
wrote:

How do I get Excel to return the sum of all digits in a number?
For example if i have the number 1234, i want excel to do the following
calculation:
1+2+3+4 and return the value 10. I need to know how to do this for any
number of any size.


Here's one way, with your number in A1:

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


--ron