title: Get evaluated cell value of Excel with SAX-Parser of Apache POI
body: <p>I read an excel-sheet with the EventUserModel of Apache POI which operates with a SAX-Parser.</p>
  
  <p>The problem is I have some normal Cells with content like 
  "hello"
  and Cells with content like this:
  <code>=IF(SUM(P254;R254;N254)=0;V254;VLOOKUP(Z254;Cirteria!$Y$2:$Z$4;2;TRUE))</code></p>
  
  <p>I don't want these formulas but their evaluated value e.g. "hello". I know it's saved in the XML but I don't know how to access it.</p>
  
  <pre><code>&lt;Cell ss:StyleID="s168"
      ss:Formula="=IF(SUM(RC[-11],RC[-9],RC[-13])=0,RC[-5],VLOOKUP(RC[-1],Kriterien!R2C25:R4C26,2,TRUE))"&gt;
      &lt;Data ss:Type="String"&gt;hello&lt;/Data&gt;
  &lt;/Cell&gt;
  &lt;Cell ss:StyleID="s167"&gt;&lt;Data ss:Type="String"&gt;hello&lt;/Data&gt;&lt;/Cell&gt;
  </code></pre>
  
  <p>It seems as if there is a "formula" tag SAX is always returning this value instead of the Data value. Otherwise the normal "hello" is returned.</p>
  
  <p>My Code looks like this:</p>
  
  <pre><code>public void startElement(String uri, String localName, String name,
          Attributes attributes) throws SAXException {
      if (name.equals("c")) {
          String cellType = attributes.getValue("t");
          if (cellType != null &amp;&amp; cellType.equals("s")) {
              nextIsString = true;
          } else {
              nextIsString = false;
          }
      }
      lastContents = "";
  }
  public void characters(char[] ch, int start, int length)
          throws SAXException {
      lastContents = new String(ch, start, length);
  }
  public void endElement(String uri, String localName, String name)
          throws SAXException {
      if (nextIsString) {
          int idx = Integer.parseInt(lastContents);
          lastContents = new XSSFRichTextString(sst.getEntryAt(idx))
                  .toString();
          System.out.println(lastContents);
          nextIsString = false;
      }
  }
  </code></pre>
  
  <p>I get all the data I need except the data generated by formulas.</p>