Calculating Complex Formulas in Text Documents
You can use predefined functions in a formula, and then insert the result of the calculation into a text document.
For example, to calculate the mean value of three numbers, do the following:

Click in the document where you want to insert the formula, and then press F2.

Click the
icon, and choose "Mean" from the Statistical Functions list. 
Type the three numbers, separated by vertical slashes ().

Press Enter. The result is inserted as a field into the document.
To edit the formula, doubleclick the field in the document.