Microsoft Excel question

Discussion in 'Science and Technology' started by Tiberius, May 7, 2013.

  1. Tiberius

    Tiberius Commodore Commodore

    Joined:
    Sep 28, 2005
    Okay, so I was randomly poking around on Futility Closet and I came across this:

    http://www.futilitycloset.com/2006/11/13/dudeney-numbers/

    Now, I want to play around with this idea and see it for myself. Rather than manually work out every single number, I'm planning on using an Excel spreadsheet.

    My plan for working it out is this.

    In Column A, I will have the number, starting at 1 and increasing through 2, 3 and so on.

    In Column B, I will have the number cubed.

    Now, in Column C, I want to take the number from Column B and add the individual digits together. So if Column B had 512, Column C would return the result of 5+1+2.

    And therein lies my question. Is there a formula that can do this? So far all I can think of is to use a clunk procedure in which I divide each number by 100 and ignore the decimal, then use that number to get rid of the hundreds column and then divide by ten and ignore the decimal and so on. A rather clunky solution and I'd like to know if there's anything more streamlined.
     
  2. Asbo Zaprudder

    Asbo Zaprudder Admiral Admiral

    Joined:
    Jan 14, 2004
    Location:
    Rishi's Sad Madhouse
  3. Tiberius

    Tiberius Commodore Commodore

    Joined:
    Sep 28, 2005
    Unfortunately, that didn't seem to work... :( Came up with 64 giving the result of 7.
     
  4. Asbo Zaprudder

    Asbo Zaprudder Admiral Admiral

    Joined:
    Jan 14, 2004
    Location:
    Rishi's Sad Madhouse
    Try this instead:

    =SUMPRODUCT(MID(B1,ROW(OFFSET($A$1,,,LEN(B1))),1)+0)

    assuming the cell containing the digits that you want to sum is B1.
     
  5. Tiberius

    Tiberius Commodore Commodore

    Joined:
    Sep 28, 2005
    That did it! Thanks!

    No idea how the formula works though. Where did you find it?
     
  6. Asbo Zaprudder

    Asbo Zaprudder Admiral Admiral

    Joined:
    Jan 14, 2004
    Location:
    Rishi's Sad Madhouse
  7. Tiberius

    Tiberius Commodore Commodore

    Joined:
    Sep 28, 2005
    Cheers for that!