We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Parsing Excel formulas

Is there a way to parse Excel formula - ideally receiving the formula name and a list of arguments?
Thanks, Tal


Thanks for your query.

Well, Aspose.Cells has its formula calculation engine to read, write, manipulate and calculate MS Excel formulas. You may use Cell.Formula Property to get/set the formula string of the cell, later on you may write your own code to split complete formula string for your needs. And you may use Cell.StringValue Property to get the resultant value. To get the result of a formula at runtime, you will use this property after calling Workbook.CalculateFormula() method, so all the formulas/functions in workbook would be calculated. See the documents in the section for your complete reference:

Hope, this helps a bit.

Thank you for the quick reply, Amjad.

I am aware of the options you mentioned. The problem I am looking for help with is the splitting of the complete formula string into the formula and its arguments (ideally with identification each argument). I have been experimenting with writing my own code for it, but since I would like to support every possible function, that would be a huge undertaking. Are you aware of a tool (by Aspose or otherwise) that could help me with this task?

Since you can calculate functions, it seems like you have the ability to parse and understand formulas and their arguments, at least internally.



I am afraid, we might not disclose internal modules of formula calculation engine, you have to write your own logic and code by yourselves.

Also, I am not sure if there is any tool available to parse the MS Excel formulas the way you want.

Thanks, Amjad!

If anyone in the community is aware f such a tool, please share it.



You are welcome and feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.