Issue 92163 - Calc fails to calculate simple formula
Summary: Calc fails to calculate simple formula
Status: CLOSED DUPLICATE of issue 5658
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 3.0 Beta 2
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: spreadsheet
QA Contact: issues@sc
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2008-07-26 06:24 UTC by testerh
Modified: 2008-07-29 13:17 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Testcase for wrong formula evaluation (6.99 KB, application/vnd.oasis.opendocument.spreadsheet)
2008-07-26 13:36 UTC, testerh
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description testerh 2008-07-26 06:24:15 UTC
Steps to reproduce:
1. Create a new spreadsheet
2. In cell C1, enter 100
3. In cell D1, enter the text HUF
4. In cell E1, enter this formnula: =IF(D1="HUF";"0.20";"0.00")
5. In cell F1, enter this formula: =(1+E1)*C1

As a result, E1 becomes 0.20, which is OK.
However, F1 shows a value of 100.
Expected: F1 should become (1 + 0.20)*100 = 120
Comment 1 Regina Henschel 2008-07-26 11:15:20 UTC
If you want a number, you must write it as number. "0.2" is a text and texts are
treated as zero if you try to calculate with them.
Correct:
=IF(D1="HUF";0.20;0.00)
Comment 2 Regina Henschel 2008-07-26 11:16:41 UTC
Closing. Error in using formula
Comment 3 testerh 2008-07-26 13:36:23 UTC
Created attachment 55377 [details]
Testcase for wrong formula evaluation
Comment 4 testerh 2008-07-26 13:37:34 UTC
Clarification:

I initially used Calc to open an MS Office 2000 Excel spreadsheet that had the 
formulas decribed above. The formula worked fine in Excel.
I noticed the problem (calculated field wrong), created a new Calc spreadsheet, 
and copied over the formula from the Excel spreadsheet to verify the behavior.

Please check the test case I just attached. Language for the cells is 
Hungarian, but that shouldn't affect the behavior.
Comment 5 Regina Henschel 2008-07-26 14:41:16 UTC
Importing from Excel is a problem, see issue 5658. You will have to correct your
spreadsheet, to use numbers where you will calculate with them.

*** This issue has been marked as a duplicate of 5658 ***
Comment 6 Regina Henschel 2008-07-26 14:42:46 UTC
closing duplicate. You might vote for issue 5658 to get a better solution for
importing Excel spreadsheets.
Comment 7 oc 2008-07-29 13:17:14 UTC
closed as duplicate