Class Poi.SS.Formula.FormulaParser.java, function private Identifier parseIdentifier() doesn't work properly for parsing NameRanges included Sheet Names which contains more than one word. For example: We have next NamedRanges: "Workunits!$A$1:$B$5" and "Workunit status!$A$1:$C$2". For second reference we get exception FormulaParseException("Specified named range Workunit does not exist in the current workbook." which comes from this method: private Ptg parseNameOrCellRef(Identifier iden) EvaluationName evalName = _book.getName(name, _sheetIndex); if (evalName == null) { throw new FormulaParseException("Specified named range '" + name + "' does not exist in the current workbook."); } It happens because parseIdentifier() returns only first part of Sheet name until first white space.
POI requires sheet names with special characters (space, !, etc) to be delimited in single quotes. The following code works fine to me: Workbook source = new HSSFWorkbook(); Sheet sheet = source.createSheet("Workunit status"); Name nm = source.createName(); nm.setNameName("name1"); nm.setRefersToFormula("'Workunit status'!$A$1:$C$2"); Regards, Yegor