Add up all Numbers in a Cell with a Line Break?

Willy Excel

New Member
Joined
Jun 8, 2017
Messages
24
Sum ThesePlace Here:
2
1
3
0
1
2
3
22

<tbody>
</tbody>

Greetings! Is there a simple method to SUM all digits within a cell with line breaks?

Some cells in the column have no numbers, some have one number, and others have a line break with a number on top and number on bottom.

Or: is there a way to highlight the cells and show "Sum:" down bottom?

Thanks!<attachment></attachment>
 
I see it has a mix of both char 10 and 13. It's working on my Mac. Is that designed to work on PC as well with that mix of both 10 and 13?

It's essentially the same as I posted way back in post# 17 - that apparently you were not having much luck with.
 
Last edited:
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
It's essentially the same as I posted way back in post# 17 - that apparently you were not having much luck with.

Gotcha. If it works on a PC as well (will try at work), then it's officially working on both Mac and PC and is the perfect solution.
 
Last edited:
Upvote 0
Yes, Willy, the formula I adapted from FormR's excellent approach should work without alteration on Mac or PC, so that you can send it to other users who may be on one or the other.
 
Upvote 0
Yes, Willy, the formula I adapted from FormR's excellent approach should work without alteration on Mac or PC, so that you can send it to other users who may be on one or the other.

Fantastic! I've just tested it on both a Mac and PC and it did work for me.

Officially solved!

Much appreciated, everybody.
 
Upvote 0
I have the same situation as the original poster, but i was wondering if it is possible to do this with a macro? I would like to run the macro and have the sums replace the original content of the cell. Is that even possible?
 
Upvote 0
I have the same situation as the original poster, but i was wondering if it is possible to do this with a macro? I would like to run the macro and have the sums replace the original content of the cell. Is that even possible?
Give this macro a try...
Code:
[table="width: 500"]
[tr]
	[td]Sub TotalNumbersInCellDelineatedByLineFeeds()
  Dim Cell As Range
  For Each Cell In Range("A1", Cells(Rows.Count, "A").End(xlUp))
    Cell.Offset(, 1).Value = Evaluate(Replace(Replace(Replace(Cell.Value, vbCr, vbLf), vbLf & vbLf, vbLf), vbLf, "+") & "+0")
  Next
End Sub[/td]
[/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,215,265
Messages
6,123,961
Members
449,137
Latest member
yeti1016

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top