You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Sum of multiple numbers in a single cell?

Hello All,


I am working on a spread sheet using numbers and I am trying to add multiple numbers within a single cell separated by page breaks. Ultimately I would liked to add multiple cells like this to form one total but I would be OK to settle for just the sum of each cell.


Example:

Home to Client-

Client to Home-

9.9 Miles

9.9 Miles

Home to Client-

Client to Home-

22 Miles

22 Miles

Ideally I would like to create a formula for the sum of B1 (19.8) to be added to the sum of B2 (44) to have a total mileage shown in cell B3 (63.8). If this is not possible, even just to be able to get the sum of B1 (19.8) to be shown in cell C1 would be very helpful.


Extra notes: I do not need to keep the text (miles), this can be removed if it matters. Not all cells have only 2 lines (numbers to add), some have only 1 line/number.


Thank you in advance.

iMac (21.5-inch, Late 2013), macOS Sierra (10.12.3)

Posted on Feb 15, 2017 7:12 PM

Reply
3 replies

Feb 15, 2017 7:32 PM in response to AMC931

I suggest consider another, in my opinion, simpler, way...


User uploaded file


start with a table similar to yours. Enter the mileage as "One way" as shown.


now format the first row, using the contextual row menu, as a header row:

User uploaded file


User uploaded file


Now add another column for "Round Trip Distance":

User uploaded file



now let's enter a formula to compute road trip distance from "One way" (assuming the distance is there and back again):

User uploaded file

select cell D2 (as shown) and type (or copy and paste from here) the formula:

=IF(C2<>"", 2×C2, "")


short hand for this is:

D2=IF(C2<>"", 2×C2, "")



now let's make the last row a footer row. This is where we will total the column of two way distances.


select any cell in the table, then open the table formatter on the right and choose 1 footer row:

User uploaded file


now let's fill the formula for computing two-way distance down the column:

select cell D2, copy

select cells D2 thru the end of column D but skipping the last row (the footer row), like this:

User uploaded file

Paste


now select the the cell in column D that is in the footer (in this example it's cell D10).


D10=sum(D)

now enter a one-way distance in column C:


User uploaded file


Using your original numbers:

User uploaded file

Feb 15, 2017 10:04 PM in response to AMC931

Hi AMC,


A cell in a Numbers table can contain a numeric value, a quasi numeric value (such as a duration or a date&time value), a text value or a formula that calculates a single value.


A cell cannot contain two numeric values, except as part of a formula (that calculates a single value).


In your example, 9.9 is a numeric value, but '9.9 miles' is a text value, as is '9.9 miles' return 9.9 miles.


If all of your out and back distances are the same in both directions, then Wayne's solution is one that will serve you well.


If there is a possibility of the trip out not being the same distance as the trip back, then using two columns, one for each direction, would be a better route to take.


Here's an example. The 'map' to the right of the table shows one scenario for a trip from home (south of the map) to client C and back again, with different distances out and back.

User uploaded file

Formulas:

E2, and filled down: =IF(D2="","",SUM(C2:D2))


The IF is used as a switch to prevent calculation until the return distance is entered.


E10 (row 10 is a Footer row): =SUM(E)


Regards,

Barry

Feb 15, 2017 7:27 PM in response to AMC931

What you are describing is a basic Numbers function. In your example you would place each milage number in a separate cell, then format the cells to look like you have entered by removing the borders on the cells. Then do your calculations on the milage numbers that were entered. You would not put two numbers in each cell. I think you should read each of the following Apps Knowledge Base articles to better understand how a numbers spreadsheet works.


http://help.apple.com/numbers/mac/4.0/

Numbers for Mac: Calculate values using data in table cells in a Numbers spreadsheet

http://help.apple.com/functions/mac/7.0/

Sum of multiple numbers in a single cell?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.