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

sum of values returns zero despite changing cell format to numbers

I copied some numbers from a table on the website and try to do a summation of the total value. However, despite changing the cell format to "Numbers", the total still would not add up. Basically, i think it is a formatting issue.


2015-04-25

S$173.96

2015-04-29

S$85.20

2015-05-08

S$23.00

2015-05-13

S$70.20


0

MacBook

Posted on May 24, 2015 8:59 PM

Reply
4 replies

May 25, 2015 6:44 AM in response to learn_mac

Hi learn_mac,


You are right, it is a formatting issue. You may notice that after you change the format to numbers or currency the cell reverts to automatic. With the leading "S" Numbers will be interpreting this data as text. One quick way to observe this is that text is left justified in Numbers.

User uploaded file

=VALUE(MID(B1,2,10))

Will remove the initial "S" and provide a number value.


quinn

May 26, 2015 5:35 AM in response to learn_mac

When you want Numbers to treat a cell entry as a number it should not contain a currency symbol or a "+" Those should be added through formatting.


Another way (just adding to Ians suggestion) is to use the substitute function:


C1=SUBSTITUTE(SUBSTITUTE(B2,"$",""),"+","")

this is shorthand for... select cell C1, then type (or copy and paste from here) then formula:

=SUBSTITUTE(SUBSTITUTE(B2,"$",""),"+","")


This a nesting of substitute functions like this:


<PREV1> = SUBSTITUTE(B2,"$","")

C1=SUBSTITUTE( <PREV1> ,"+","")


<PREV1> is a made up temporary variable name to hold an intermediate result after substituting "$" for nothing (""). That is, then, used as the input to the next substitute that removes the "+"



you can fill down as needed by selecting cell C1, copy

select cells C1 to the end of column C, paste

May 27, 2015 9:43 AM in response to t quinn

A script is efficient at removing extraneous characters. No formulas, extra columns etc. Just one click.


  1. Copy-paste into Script Editor (in Applications > Utilities).
  2. Change numCharsToRemove if you have more or less than 2.
  3. Select the cells that you need to clean up.
  4. With the cells selected, click the triangle 'Run' button.


SG


property numCharsToRemove : 2

tell application "Numbers"

tell document 1 to tell active sheet

set t to first table whose selection range's class is range

repeat with c in t's selection range's cells

set v to c's value

set c's value to v's text (numCharsToRemove + 1) through -1

end repeat

end tell

end tell

sum of values returns zero despite changing cell format to numbers

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