0

Is there an easy way (i.e. without evaluating the formula) to detect the type of the cached formula value. Here is an example of a formula cell element:

<c r="N4" t="str">
  <f>CONCATENATE("3",".","5")</f>
  <v>3.5</v>
</c>

Here the type should be STRING and not NUMBER.

nakhli
  • 4,009
  • 5
  • 38
  • 61
  • Does `t="str"` not tell you it's a string then? – Gagravarr Jan 02 '14 at 23:38
  • @Gagravarr str indicates that it is a formula. It is misleading. – nakhli Jan 02 '14 at 23:43
  • If you create a formula cell with a numeric answer of 3.5 (eg `=7/2`), what do you get then? (Maybe update the question with that?) – Gagravarr Jan 03 '14 at 01:38
  • @Gagravarr simple formulas are treated differently (a bit like how a C or java compiler would do), the cell is not marked as "str" (formula) but the formula element "f" is kept. I am not interested in this cas as I know how to handle it. – nakhli Jan 03 '14 at 11:03
  • Did you try looking at the logic used in the XSSF UserModel? specifically [XSSFCell](https://svn.apache.org/repos/asf/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java) method `getCachedFormulaResultType` – Gagravarr Jan 08 '14 at 11:50

0 Answers0