Bug 25769 - HSSFRow.getCell() returns null for cell with formula.
Summary: HSSFRow.getCell() returns null for cell with formula.
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.5.1
Hardware: PC All
: P3 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2003-12-27 04:33 UTC by Matthew Ho
Modified: 2005-05-20 03:58 UTC (History)
1 user (show)

excel 2000 (35.50 KB, application/octet-stream)
2003-12-27 04:46 UTC, Matthew Ho

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Ho 2003-12-27 04:33:38 UTC
I have an existing spreadsheet that I use the HSSF APIs to programmatically 
retrieve values.  For the cell that has formula like "='Trip Report Form'!$C$8".
The value returned is null.  (In fact, cell that has any formula always returns 

This is a show-stopper for me.  I have customer deliverable approaching.
I wonder if POI contributors can response to this one quickly.
Is there at least a workaround?  Please help!  Thanks a lot!
Comment 1 Matthew Ho 2003-12-27 04:46:44 UTC
Created attachment 9708 [details]
excel 2000
Comment 2 Matthew Ho 2003-12-27 04:52:24 UTC
I have uploaded an Excel 2000 attachment as test data.
I'm only working with the "InputData" sheet.

FileInputStream fileIn = new FileInputStream((File) mapfrom);
// create a new org.apache.poi.poifs.filesystem.Filesystem
POIFSFileSystem fs = new POIFSFileSystem(fileIn);

HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheet("InputData");

Iterator rowIterator = sheet.rowIterator();
while (rowIterator.hasNext()) {
	HSSFRow row = (HSSFRow) rowIterator.next();
	HSSFCell cell = row.getCell(0);
	if (cell == null) {
            System.out.println("---> Cell null ");
Comment 3 Avik Sengupta 2004-01-01 09:11:14 UTC
You seem to be using version 1.5.1 which does NOT have ANY formula support.
Please upgrade to the latest version (2.0 RC1). I have run your file on that
version, and thing work perfectly. 
Comment 4 Monica 2005-03-04 04:43:21 UTC

I am using POI to read an excel sheet.It has some formula values.when I tried 
to do HSSFRow.getCell() returns null.I think I am using latest version only.

Can you please send me link where I can get latest version 

Comment 5 Avik Sengupta 2005-05-20 11:58:03 UTC
This is not a bug in Excel for the last two years. Please do not reopen.