You can create custom functions using regular formulas inside a document, then use your custom functions throughout the document.
It's easy to define a function. In a formula, type this basic layout:
FunctionName(param1, param2, etc) = Equation using parameters
To use the function, treat it like a normal built-in function. Type the name and put a parentheses at the end with the inputs.
Functions are treated a lot like values, so they are highlighted when used, and you can click it to use it in a formula (like a spreadsheet cell).
Functions are great for working with spreadsheets and tables. You can define the equation once, and then use it for an entire column.
If there's a formula that's used multiple times, it's easy to transform it into a function. Add the parentheses and parameters after the name and then replace the actual values with the parameter names.