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.


Nested functions

Callout 1 The AVERAGE and SUM functions are nested within the IF function.

  1. Click the cell in which you want to enter the formula.
  2. To start the formula with the function, click Function Wizard Button image on the formula bar (formula bar: A bar at the top of the Excel window that you use to enter or edit values or formulas in cells or charts. Displays the constant value or formula stored in the active cell.) Formula bar.
  3. 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.
  4. Enter the arguments (argument: The values that a function uses to perform operations or calculations. The type of argument a function uses is specific to the function. Common arguments that are used within functions include numbers, text, cell references, and names.).
    • To enter cell references as an argument, click Collapse Dialog Button image next to the argument that you want (which temporarily hides the dialog box), select the cells on the worksheet, and then click Expand Dialog Button image.
    • 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.

Top of Page Top of Page

 
 
Applies to:
Excel 2007