I have cell formula like C1+C2.suppose i use get开发者_开发百科cellformula()method it returns the String C1+C2. Now i want to split the String by operator and get the each cell Address separately.Is there anyway to find out the Excel formula operator and get the each cell address separately. How i do?
Please reply me...
Saravanan.p
This answer to your other question will answer this as well.
A formula =D4+D6
when parsed via FormulaParser
gives
org.apache.poi.hssf.record.formula.RefPtg [D4]
org.apache.poi.hssf.record.formula.RefPtg [D6]
class org.apache.poi.hssf.record.formula.AddPtg
RefPtg points to the cell reference D4
, and +
is AddPtg
Note POI uses the format of Reverse Polish Notation i.e. it puts which puts the operator in the post-fix position.
In Reverse Polish notation the operators follow their operands; for instance, to add three and four, one would write "3 4 +" rather than "3 + 4".
精彩评论