Hi,

given the attached use case, I perform a simple substraction of one day to a date referenced from a textual split on another sheet: =RIGHT(VNA115462!A2;10)-1

This formula is evaluated to #VALUE!, no so in Excel. If I remove the substraction, everything is working.

Is date arithmetic currently supported with POI (tested with 3.6 and 3.8-beta4)?

Formula is evaluated like this:

if(cell.getCellType() == Cell.CELL_TYPE_FORMULA)
{
    final FormulaEvaluator evaluator =  
        wb.getCreationHelper().createFormulaEvaluator();
    cell = (HSSFCell) evaluator.evaluateInCell(cell);
                        
    // --> cell is evaluated to #VALUE!
}               
/* ... rest of code, string conversion to java.util.Date */



Thanks for clarification
Kind regards
Rene Becker

Attachment: date_arithmetic_testcase.xls
Description: MS-Excel spreadsheet

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to