Functions are predefined formulas that perform calculations by using specific values, called arguments, in a particular order, or structure. Functions can be used to perform simple or complex calculations. You can find all of Excel's functions on the Formulas tab on the Ribbon:
-
Excel function syntax
The following example of the ROUND function rounding off a number in cell A10 illustrates a function's syntax.
1. Structure. The structure of a function begins with an equal sign (=), followed by the function name, an opening parenthesis, the arguments for the function separated by commas, and a closing parenthesis.
2. Function name. For a list of available functions, click a cell and press SHIFT+F3, which will launch the Insert Function dialog.
3. Arguments. Arguments can be numbers, text, logical values such as TRUE or FALSE, arrays, error values such as #N/A, or cell references. The argument you designate must produce a valid value for that argument. Arguments can also be constants, formulas, or other functions.
4. Argument tooltip. A tooltip with the syntax and arguments appears as you type the function. For example, type =ROUND( and the tooltip appears. Tooltips appear only for built-in functions.
Note: You don't need to type functions in all caps, like =ROUND, as Excel will automatically capitalize the function name for you once you press enter. If you misspell a function name, like =SUME(A1:A10) instead of =SUM(A1:A10), then Excel will return a #NAME? error.
-
Entering Excel functions
When you create a formula that contains a function, you can use the Insert Function dialog box to help you enter worksheet functions. Once you select a function from the Insert Function dialog Excel will launch a function wizard, which displays the name of the function, each of its arguments, a description of the function and each argument, the current result of the function, and the current result of the entire formula.
To make it easier to create and edit formulas and minimize typing and syntax errors, use Formula AutoComplete. After you type an = (equal sign) and beginning letters of a function, Excel displays a dynamic drop-down list of valid functions, arguments, and names that match those letters. You can then select one from the drop-down list and Excel will enter it for you.
-
Nesting Excel functions
In certain cases, you may need to use a function as one of the arguments of another function. For example, the following formula uses a nested AVERAGE function and compares the result with the value 50.
1. The AVERAGE and SUM functions are nested within the IF function.
Valid returns When a nested function is used as an argument, the nested function must return the same type of value that the argument uses. For example, if the argument returns a TRUE or FALSE value, the nested function must return a TRUE or FALSE value. If the function doesn't, Excel displays a #VALUE! error value.
Nesting level limits A formula can contain up to seven levels of nested functions. When one function (we'll call this Function B) is used as an argument in another function (we'll call this Function A), Function B acts as a second-level function. For example, the AVERAGE function and the SUM function are both second-level functions if they are used as arguments of the IF function. A function nested within the nested AVERAGE function is then a third-level function, and so on.