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?
Thats not how you use formulas.