There are five worksheet functions provided by the MathematicaLink add-in. Function | Use | EVAL | perform Mathematica evaluations | EXPR | build Mathematica expressions | DATA | specify an argument as native Excel data | RULE | build a Mathematica rule | CALC | force a function to respond to the Excel calculate command (F9) |
The Link functions. Together, these functions can be used to build up expressions and perform evaluations in Mathematica in very flexible ways. For more detailed information on each worksheet functions, see Worksheet Functions. Using the EVAL worksheet function, you can call any function defined in Mathematica. This immediately extends the number of functions available inside Excel from a few hundred to several thousand. Excel syntax | Mathematica syntax | =EVAL("f","arg1","arg2",...) | {f[}arg1{,} arg2{,} ...{]} |
The EVAL function. Example | Result | =EVAL("Simplify","x^2+2x+1") | (1 + x)^2 | =EVAL("Random","Integer","{1,6}") | an integer between 1 and 6 |
EVAL examples. As shown, Mathematica syntax must be wrapped in quotes when directly typed into an Excel formula. If this is not done, Excel's formula parser will try to interpret these as Excel syntax. To avoid having to do this, you can create references to arguments in Excel cells. This is discussed in more detail in Specifying Arguments.
In its single argument form, the EVAL function can also be used to evaluate Mathematica expressions such as symbols or operator forms of expressions. Excel syntax | Mathematica syntax | =EVAL(" expression ") | {expression} |
The single argument form of EVAL. Example | Result | =EVAL("$Version") | the version of the kernel you are running | =EVAL("7! + 5!") | 5160 |
EVAL single argument examples. |