if (hssfCell.getCellType() == hssfCell.CELL_TYPE_FORMULA) {
String returnValue ="";
//当单元格为公式 获取 值
try {
//如果结果是数值
returnValue = String.valueOf(hssfCell.getNumericCellValue());
} catch (IllegalStateException e) {
//其他
returnValue = String.valueOf(hssfCell.getRichStringCellValue());
}
项目中遇到导入表格中有公式,记录一下。