Created attachment 32432 [details] File to reproduce the issue See the attached Excel file minimal.xlsx where cells E4:E6 are involved in a circular reference. The cell type for the evaluated cell E6 is CELL_TYPE_ERROR. Trying to query the error value yields an IllegalArgumentException "Unknown error type: -60". See the following code to reproduce the issue: Workbook wb = WorkbookFactory.create(new File("minimal.xlsx")); FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); evaluator.clearAllCachedResultValues(); Sheet sheet = wb.getSheet("Sheet1"); Cell cell = sheet.getRow(5).getCell(4); CellValue value = evaluator.evaluate(cell); System.out.println(value.getCellType() == Cell.CELL_TYPE_ERROR); // true CellUtils.getErrorMessage(value.getErrorValue()); // throws IllegalArgumentException: Unknown error type: -60
It seems we had two sets of error constants, one with a few more in than the other As of r1658190, I've made FormulaError be the main one, deprecated the other, cleaned up ErrorEval to use only FormulaError, and added a unit test based on your code which now passes!