+ Reply to Thread
Results 1 to 7 of 7

Sum of one cell

  1. #1
    Registered User
    Join Date
    01-11-2007
    Posts
    11

    Sum of one cell

    If I have the following in Cell A1 "30, 20, 10"

    How do I add those numbers to put in line B1?

    Thanks in advance

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Well, a roundabout way would be:

    1. Go Insert>Name>Define and enter a name like SumLeft and in the RefersTo box type:

    =EVALUATE(SUBSTITUTE(OFFSET(INDIRECT("RC",FALSE),0,-1),",","+"))

    (including = sign at beginning) and click OK

    2. in B1 type

    =SumLeft

    and press return

    Entering =SumLeft in a cell will always sum the contents of the cell to its immediate left where it contains a string of numbers separated by commas.

    Hope this helps!

    Richard
    Last edited by Richard Schollar; 03-02-2007 at 05:05 PM.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,410
    Do those number have to all stay in A1? If it were me, I would parse A1 into columns (Data->Text to columns work through text import wizard), then B1=sum(A1:C1)

  4. #4
    Registered User
    Join Date
    01-11-2007
    Posts
    11
    Yes, all those numbers do have to stay in A1.

    I tried to use the "SumLeft" approach and came up with this '#VALUE!'

    Please help!!

    Thanks

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    This should help

    VBA Noob
    Attached Files Attached Files
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Thumbs up

    Thanks VBA Noob

    Should have done that myself to begin with...


    Richard

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No problem.

    Nice formula by the way

    VBA Noob

+ 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