Well the only build in solution that I can think of is the Microsoft Script Control Library. It can enable you to evaluate the expressions written in VBScript or JScript.
Note that it is a COM library and in order to use it you need to add reference to "Microsoft Script Control 1.0".
Here is how you would do this:
private static string CalculateFormula(string formula, int x, int y)
{
var controler = new MSScriptControl.ScriptControl();
controler.Language = "VBScript";
return controler.Eval(
formula.Replace("x", x.ToString())
.Replace("y", y.ToString())).ToString();
}
And here is an example of its usage:
Console.WriteLine(CalculateFormula("x+y", 12, 3));
Console.WriteLine(CalculateFormula("(x + y - x/y) * (x-y) / 5", 25, 5));
If that does not suite you then you will need to look for some existing .NET formula evaluator, parser, engine or interpreter. You can find quite a few of them here on CodeProject.