Bug 15038 - #VALUE! Result from Formula in spreadsheet
Summary: #VALUE! Result from Formula in spreadsheet
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-dev
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-03 23:15 UTC by Greg Garson
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Garson 2002-12-03 23:15:16 UTC
I'm getting the #VALUE! result in a spreadsheet from the following code:

HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("New Sheet");
HSSFRow row = sheet.createRow((short)0);
HSSFCell cell1 = row.createCell((short)0);
cell1.setCellValue(1);
HSSFCell cell2 = row.createCell((short)1);
cell2.setCellValue(2);
HSSFCell cell3 = row.createCell((short)2);
cell3.setCellValue(3);
SheetReferences sRef = new SheetReferences();
sRef.addSheetReference("First Sheet", 0);
HSSFCell cell4 = row.createCell((short)3);
cell4.setCellType(HSSFCell.CELL_TYPE_FORMULA);
Ptg[] ref = new Ptg[5];
ref[0] = new AreaPtg("A1:B1");
ref[1] = new IntPtg("1");
ref[2] = new FuncVarPtg("LARGE", (byte)2);
ref[3] = new ReferencePtg("C1");
ref[4] = new AddPtg();
cell4.setCellFormula(FormulaParser.toFormulaString(sRef, ref));
FileOutputStream fileOut = new FileOutputStream("testWorkBook1.xls");
wb.write(fileOut);
fileOut.close();

Have also tried entering this straight into setCellFormula as "LARGE(A1:B1,1)
+C1" returning the same effect.  Is LARGE an unsupported 'array formula' as 
specified under formula support?
Comment 1 Andy Oliver 2003-07-24 13:59:19 UTC
Thats not how you use formulas.