title: How to handle HYPERLINK function using POI SS?
body: <p>I'm trying to use POI SS to convert an Excel spreadsheet to CSV.  Unfortunately I can't seem to handle HYPERLINK functions properly:</p>
  
  <pre><code>if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
    System.out.println("formula cell: " + cell.toString());
    switch (cell.getCachedFormulaResultType()) {
      case Cell.CELL_TYPE_BOOLEAN:
        return Boolean.toString(cell.getBooleanCellValue());
      case Cell.CELL_TYPE_NUMERIC:
        return NUMERIC_FORMAT.format(cell.getNumericCellValue());
      case Cell.CELL_TYPE_BLANK:
        return "";
      default:
        // Special case handling for HYPERLINK cells
        if (cell.getHyperlink() != null) {
          System.out.println("found hyperlink: " + cell.getHyperlink().getAddress());
          return cell.getHyperlink().getAddress();
        }
        System.out.println("something else: " + cell.toString());
        return cell.toString();
    }
  }
  </code></pre>
  
  <p>Unfortunately, even though it interprets this cell as being a FORMULA cell, cell.getHyperlink() returns null so cell.toString() just returns the full formula like:</p>
  
  <p>=HYPERLINK("http:...","...")</p>
  
  <p>How do I get this to work correctly?</p>