poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Nelson <tnel...@starpoint.com>
Subject Re: Reading value from formula cell
Date Wed, 12 Jan 2005 20:16:31 GMT
Quoting Yogita <yogita_kashikar@ml.com>:

> Hi,
> I am facing difficulties while reading formula cell values with POI version 
> 2.5.
> I have created formula cell as follows:
> 			cell.setCellType(HSSFCell.CELL_TYPE_FORMULA);
> 			cell.setCellFormula("SUM(D8..F8)");
> And I am reading it as follow:
>    double formulaCellValue = row.getCell((short) 7).getNumericCellValue();
> When read this way(using getNumericCellValue()), I am always getting the
> value 
> of 0.0. 
> Any quick help in this regard would be highly appriciated.

POI does not evaluate formulas.  Excel does that.

POI simply puts the forumla in the cell.   In order to get a value, you would
have to create the spreadsheet, open it in excel, and then re-read it with

This was discussed in detail less than two weeks ago on the list.  Please read
the archives.

This email message from Starpoint Solutions LLC is for the sole use of the intended recipient(s)
and may contain confidential and privileged information.  Any unauthorized review, use, disclosure
or distribution is prohibited.  If you are not the intended recipient, please contact the
sender by reply email and destroy all copies of the original message.  Opinions, conclusions
and other information in this message that do not relate to the official business of Starpoint
Solutions shall be understood as neither given nor endorsed by it.

View raw message