alexb2 wrote:
So when I set format for my number as my local currency it's displayed as 123 XXX (XXX is my currency but it's not in latin). I see it's not only displayed but also stored as 123 XXX. That's different from Excel that stores only numbers in cells and shows number with prefix or suffix - Numbers storex number with prefix or suffix.
No, you get this behavior because the original sheet is displaying values as currencies. I assumes that the import process pass it as a string because he doesn't recognize it as a currency value. As far as I know, Numbers stores the currency entries as a pure number and an indicator of the used currency.
Here is an example.
(a) the description of the numerical value (I underlined it: 456)
<sf:number-cell sf:flags="4" sf:value="
456" sf:col="1" sf:row="2">
<sf:cell-style-ref sfa:IDREF="SFTCellStyle-46"/>
<sf:content-size sfa:w="58.659881591796875" sfa:h="14"/>
</sf:number-cell>
(b) the description of the format (I underlined the used currency: XAM)
<sf:cell-style sfa:ID="SFTCellStyle-46" sf:cell-style-default-line-height="12" sf:parent-ident="tabular-Basic-body-cell-style-id">
<sf:property-map>
<sf:SFTCellStylePropertyNumberFormat>
<sf:number-format sfa:ID="SFTNumberFormat-23" sf:format-type="1" sf:format-string="#,##0.00 ¤;-#,##0.00 ¤" sf:format-decimal-places="2" sf:format-currency-code="
XAM" sf:format-negative-style="0" sf:format-show-thousands-separator="true" sf:format-fraction-accuracy="-3" sf:format-use-accounting-style="false"/>
</sf:SFTCellStylePropertyNumberFormat>
<sf:SFTCellStylePropertyImplicitFormatType>
<sf:number sfa:number="256" sfa:type="i"/>
</sf:SFTCellStylePropertyImplicitFormatType>
<sf:SFTCellStylePropertyFormatType>
<sf:number sfa:number="257" sfa:type="i"/>
</sf:SFTCellStylePropertyFormatType>
</sf:property-map>
</sf:cell-style>
Of course, if the original currency string is not recognized, it can't be described as such a feature and the value is treated as a simple string.
So may be at some moment my 123 XXX is treated like string value.
Yes, find and replace is a nice tool when importing data - thanks for the tip. the last problem is with already Numbers files that were imported not today (or even createde as Numbers file) where some cell becomes string value after some editing.
Here again, if you edit a currency string and replace it to a not recognized one, the result will be logically a string.
There is an other way to give this result:
copy a value from a cell formatted as XAM currency (just an example)
paste it in a cell whose format is currency Euro (once again it's just an example).
The result will be a string.
The culprit is not the program, it's the user.
I had several times this situation and last time I found error only because I have my budget in 2 programs - in Numbers and in another special budgeting program. As each program has advantages I have in fact 2 instances of the same budget.
And when I changed some string in Numbers and another program I noticed the sum is different. I was sure it's another program somewhere buggy but noticed than Numbers simply ignores one of the budget strings and sums without it... In fact it was even not the string I changed, I remember I changed the buggy string about a week ago but I haven't compared budgets that time so my budget had a mistake for some time till I noticed it. If I used only Numbers without copy of budget in another program may be even today I won't notice the mistake.
The same situation happened not once.
I think that the choice made by Apple for SUM() is correct. You feel that it is wrong. It's useless to debate more, we will not change the behavior of the function.
I try to give a workaround.
The neater one is to add columns as I described in my first response.
The given formula will clearly flag cells which aren't containing numerical values. If you move the SUM from the original range to the new one, the oddities will be flagged automatically.
Here is an alternate workaround:
The currency is XAM.
In B4 I introduced a typo so the value is no longer a numerical one.
Given that, the sum in the footer doesn't count the 34 (which is the normal behavior).
In column C1 I entered =1*B
which flagged the bad cell.
The alternate is to use an auxiliary table like aux1
In A1 I entered:
=IF(ISERROR(INDIRECT(ADDRESS(ROW(),COLUMN(),,,"main"))),"",IF(ISBLANK(INDIRECT(A DDRESS(ROW(),COLUMN(),,,"main"))),"",1*INDIRECT(ADDRESS(ROW(),COLUMN(),,,"main") )))
Exactly the same formula in B1, C1, D1, …
So, the table will automatically grab the contents of the main table (just take care to insert more columns in aux1 than in main)
In the footer row of aux1, insert a sum formula for columns where there is required.
Looking at this footer will flag columns where a value may be "wrong" so, it will be necessary (but easy) to scan the column's content to find the red triangle(s).
Yvan KOENIG (from FRANCE lundi 13 octobre 2008 13:27:40)