+ Reply to Thread
Results 1 to 9 of 9

Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

  1. #1
    Registered User
    Join Date
    03-09-2015
    Location
    VECT
    MS-Off Ver
    2007
    Posts
    2

    Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

    Hi guys,

    I'm in need of a way to sum/adding up numbers in a SINGLE cell that are divided by line breaks. Example:

    0
    6
    7
    0

    Those 4 numbers would be in a single cell lined up vertically. How do I write a formula that will return back to me a value of "13"? I have be wrecking my brain over this trying to find a solution to no avail so far.

    And before anyone asks why are my numbers line-broke in a single cell instead of occupying separate cells, these numbers are the result of an output Excel-file from an ERP, not manually entered.

    Any advice would be appreciated!

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

    Assuming always 4 lines per cell:

    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    03-09-2015
    Location
    VECT
    MS-Off Ver
    2007
    Posts
    2

    Re: Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

    Hi daffodil,

    Unfortunately it's not always 4 lines. Also, your formula seem to not work if a figure has more than 1 digit; some of these figures goes up to 5 or 6 digits.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

    some of these figures goes up to 5 or 6 digits.
    Do you mean 5 or 6 digits between the line breaks as in

    0
    12
    5
    2
    0
    15848
    0


    Something like that?
    Last edited by FlameRetired; 03-09-2015 at 08:34 PM.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

    You could do text to columns using line feed as the delimiter, and then use a normal SUM function.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

    Something like this?
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Array entered. Array enter means the formula must be committed by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

  7. #7
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

    Assuming data is in A1,
    in B1 use formula as
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Create a Name like..
    Select b1, create Name EVAL, and refers to as .. =EVALUATE(Sheet1!a1)

    Now in cell C1 use formula as
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    EVALUATE.xlsm

    keep in mind that its a MACRO.. not a normal Formula..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    Re: Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

    You could set up a small UDF like this:

    Please Login or Register  to view this content.
    and then you would use this in a formula like this:

    =eval(SUBSTITUTE(A1,CHAR(10),"+"))

    assuming your string of numbers is in A1.

    Hope this helps.

    Pete

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Summing up figures in a SINGLE cell divided by alt-enter line-breaks (aka Char(10))

    I was thinking along the same nines that shg was - Text2Columns, then sum
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Unable to get cell count when using line breaks char(10)
    By Ronoh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-01-2014, 01:10 PM
  2. Replies: 8
    Last Post: 07-14-2014, 03:07 AM
  3. Formula to enter line breaks in cells when a specific charachter is entered
    By ktfcmike in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-21-2012, 12:00 PM
  4. Replies: 5
    Last Post: 12-06-2010, 04:39 PM
  5. Remove Line Breaks ALT + ENTER
    By Highman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-26-2005, 05:06 PM

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