Java poi读取Excel表格中公式的计算值

switch (cell.getCellType()) {
    case HSSFCell.CELL_TYPE_FORMULA: //公式类型
    // cell.getCellFormula();
    try {
        value = String.valueOf(cell.getNumericCellValue());    
    } catch (IllegalStateException e) {
         value = String.valueOf(cell.getRichStringCellValue());
    }
     break;
   }
原文地址:https://www.cnblogs.com/xiaoliu66007/p/14504691.html