Apologies for not having the actual XLSX file, so the parameter values are made up to reproduce the issue, and might not reflect reality. DataFormatter formatter = new DataFormatter(); // the following will throw IllegalArgumentException formatter.formatRawCellContents(formatter, "42", 0xe, "hello", false); Here is what I found: The index is one of the internal date format, DateUtil.isInternalDateFormat() returns true. Because if that, the formatString is not validate until it is passed to the constructor of ExcelStyleDateFormatter. Because the formatString is invalid, when constructing ExcelStyleDateFormatter, the SimpleDateFormat's constructor will throw run time exception, and inside DateFormatter.createDateFormat() returns getDefaultFormat() which is a DecimalFormat. Because we are trying to format a Date object using a DecimalFormat, an IllegalArgumentException is throw.