You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Stanko74 <ko...@web.de> on 2009/01/27 11:37:27 UTC

Case sensitivity while evaluating formulas

First of all I appreciate POI very much and use it successfully to import
data from excel sheets into a web application.


I noticed that evaluating some formulas gives different results from what is
shown in the excel sheet.

Example:

sheet 'Name2'
A1  'Yes'
B1  'Yes'
C1  'Yes'
D1  '=IF(AND(A1="Yes";OR(B1="yes";C1="yes"));"yes";"no")'

Cell D1 is referenced in a formula on sheet 'Name1'.

sheet 'Name1'
X1 '=IF('Name2'!D1="yes";Y1;0)'
Y1 'somevalue'

In the excel sheet X1 on 'Name1' contains 'somevalue'.

Evaluating from POI X1 contains 0.

If I change the formula in D1 to 

'=IF(AND(A1="Yes";OR(B1="Yes";C1="yes"));"yes";"no")'

then POI evaluates X1 on sheet 'Name1' correctly to 'somevalue'. 


expected result in POI also with
'=IF(AND(A1="Yes";OR(B1="yes";C1="Yes"));"yes";"no")'
'=IF(AND(A1="Yes";OR(B1="Yes";C1="Yes"));"yes";"no")'

wrong result in POI with any of these
'=IF(AND(A1="Yes";OR(B1="Yes";C1="Yes"));"Yes";"no")'
'=IF(AND(A1="Yes";OR(B1="Yes";C1="Yes"));"YES";"no")'
'=IF(AND(A1="yes";OR(B1="Yes";C1="Yes"));"yes";"no")'
'=IF(AND(A1="yes";OR(B1="yes";C1="yes"));"yes";"no")'


Apparently strings are evaluated in a case-sensitive manner in POI, but not
in Excel? Is there a setting in POI to switch to case-insensitivity?

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/Case-sensitivity-while-evaluating-formulas-tp21682982p21682982.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Case sensitivity while evaluating formulas

Posted by Stanko74 <ko...@web.de>.
Thanks a lot for the quick fix. Keep up the good work.


Josh Micich wrote:
> 
> Thanks for the detailed bug report. This has now been fixed:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=46613
> 
> 

-- 
View this message in context: http://www.nabble.com/Case-sensitivity-while-evaluating-formulas-tp21682982p21701165.html
Sent from the POI - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Case sensitivity while evaluating formulas

Posted by Josh Micich <jo...@gmail.com>.
Thanks for the detailed bug report. This has now been fixed:
https://issues.apache.org/bugzilla/show_bug.cgi?id=46613