0

Suppose I have an Excel formula that outputs a string of the form:

"X*10 + Y*30 + Y*40 + X*20"

How do I get Excel to collect terms and output, verbatim, their sum? I.e.:

"X*30 + Y*70"

Ideally I'd like to do this with formulas instead of a VBA script.

I'm using Excel for Mac in Office 365 Business (latest version).

I examined the accepted answer at: Excel function that evaluates a string as if it were a formula?

To try implementing it, I first tried Evaluate as if it were a "hidden" built-in function ["=EVALAUTE(....)"] and that didn't work. So I saved the VBA script in the accepted answer as a module, and tried it as a worksheet function ["=ev(....)], and that didn't work either. I suspect these Evaluate functions are designed to give numerical outputs rather than symbolic ones

theorist
  • 141

1 Answers1

0

It appears the same question was asked on the Microsoft support forums: https://answers.microsoft.com/en-us/msoffice/forum/all/can-excel-do-simple-symbolic-algebra/bfb67bbc-5d9f-4dbf-868b-110237c58d89?auth=1

The answer there by a Microsoft agent was that no, Excel does not natively support this. They suggest that VBA may be leveraged to perform these more advanced computations, but that, in its default form, Excel does not perform symbolic algebraic computation.

music2myear
  • 49,799