While you can write a formula wherever revit is asking for a number, you cannot do that inside text notes, text parameters or multi line texts. Well, you can, of course, you are just not to expect a result. Sometimes it is helpful not only to note the result but also the formula that produced it. Maybe such formulas need to escape standard revit text handling procedures by being put into double curly brackets or similar, but that would be the idea.