+ Reply to Thread
Results 1 to 7 of 7

How do I find the sum of all digits in a number?

Hybrid View

  1. #1
    monkeyforce5
    Guest

    How do I find the sum of all digits in a number?

    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.

  2. #2
    Ron Rosenfeld
    Guest

    Re: How do I find the sum of all digits in a number?

    On Fri, 9 Sep 2005 08:21:04 -0700, monkeyforce5
    <monkeyforce5@discussions.microsoft.com> 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

  3. #3
    monkeyforce5
    Guest

    Re: How do I find the sum of all digits in a number?

    Thanks Ron that formula works perfectly. The reason i was doing this is
    because i was looking at the sum of digits of all multiples of 9. It creates
    a very interesting pattern.

    "Ron Rosenfeld" wrote:

    > On Fri, 9 Sep 2005 08:21:04 -0700, monkeyforce5
    > <monkeyforce5@discussions.microsoft.com> 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
    >


  4. #4
    Ron Rosenfeld
    Guest

    Re: How do I find the sum of all digits in a number?

    On Fri, 9 Sep 2005 13:08:03 -0700, monkeyforce5
    <monkeyforce5@discussions.microsoft.com> wrote:

    >Thanks Ron that formula works perfectly. The reason i was doing this is
    >because i was looking at the sum of digits of all multiples of 9. It creates
    >a very interesting pattern.


    Glad to help. Thank you for the feedback.


    --ron

  5. #5
    Registered User
    Join Date
    02-11-2021
    Location
    Mumbai
    MS-Off Ver
    o365
    Posts
    1

    Re: How do I find the sum of all digits in a number?

    Ron, it still works....thanks you....how did you come out with this ? Legendary .....

  6. #6
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,465

    Re: How do I find the sum of all digits in a number?

    Quote Originally Posted by Paragpd View Post
    Ron, it still works...
    Assuming your numbers will never contain more than 15 digits, you could use this formula as well...

    =SUMPRODUCT(0+(0&MID(A1,ROW(1:15),1)))

  7. #7
    CLR
    Guest

    RE: How do I find the sum of all digits in a number?

    I would use Data > TextToColumns > Fixed, to separate the digits into
    individual columns and then just SUM those cells.......

    Vaya con Dios,
    Chuck, CABGx3



    "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.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1