Nest a function within a function
Nested functions use a function as one of the arguments of another function. You can nest up to 64 levels of functions. The following formula sums a set of numbers (G2:G5) only if the average of another set of numbers (F2:F5) is greater than 50. Otherwise it returns 0.
1. The AVERAGE and SUM functions are nested within the IF function.

Click the cell in which you want to enter the formula.

To start the formula with the function, click Function Wizard on the formula bar .

Select the function you want to use. You can enter a question that describes what you want to do in the Search for a function box (for example, "add numbers" returns the SUM function), or browse from the categories in the Or Select a category box.

Enter the arguments.

To enter cell references as an argument, click Collapse Dialog next to the argument that you want (which temporarily hides the dialog box), select the cells on the worksheet, and then click Expand Dialog .

To enter another function as an argument, enter the function in the argument box that you want. For example, you can add SUM(G2:G5) in the Value_if_true edit box of the IF function.

The parts of the formula displayed in the Function Arguments dialog box reflect the function that you selected in the previous step. For example, if you clicked IF, Function arguments displays the arguments for the IF function.
