Hi,

We were having the same problem with a different formula, having several nested IFs and math functions. We thought it may be because of nesting or length of the formula, so our solution was to break the formula into several shorter pieces and put them into hidden columns, and combine the result in the destination cell. That worked out in our case. You may wish to give that a shot.

Alex

I'm trying to get this following formula working when generating an Excel file using HSSF.

=IF(EXACT(B101,0),PRODUCT(C101,100),ROUND((C101-B101)/B101*100,0))

I use the following code:

HSSFCell c = r.createCell(cellnum);
c.setCellType(HSSFCell.CELL_TYPE_FORMULA);
c.setCellFormula(formula); //The string above

When using it in normal Excel the formula works fine. In the HSSF generated file I'm getting a #VALUE! error. However, if I click in the formula in excel and confirm it without changing anything it also works.





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to