Results 1 to 10 of 10

Sum the digits of a single cell down to one number

Threaded View

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    Toronto
    MS-Off Ver
    Excel Starter
    Posts
    5

    Sum the digits of a single cell down to one number

    Hello all!

    I saw that this function exists for adding all the digits in a cell (for example, A1) into a single number in B1.

    =A1 - FLOOR(A1 - 1, 9)
    For example, if I typed the above code into B1, and if A1 was 33, it would take 3+3=6, giving me 6 as the number that shows up in B1. Another example would be for 93, it would take 9+3=12, then 1+2=3, giving me 3 as my end result in B1.

    The problem I run into is when the number in A1 is 0. The same code is put into B1, but B1 shows up as 9, not 0. I tried to fiddle around with making an exception to the formula, but I can't seem to figure it out. Is there a way to keep that formula in there, but have 0 show up if the number in A1 is 0? Thanks in advance for your help!
    Last edited by Gavald229; 09-11-2012 at 11:50 AM.

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