Entering Functions

Functions can be entered manually, but to do this you need to know the name of the function and the syntax for the arguments.

In Excel 2002, Excel 2003, Excel 2007, and Excel 2010, if you enter the name of the function, syntax-specific help is displayed to help you complete the parameters. Programmers who work with Microsoft Visual Basic for Applications are already familiar with this type of help, which displays a ScreenTip as soon as you enter the function name and the opening parenthesis (see Figure 4-6). Each argument in turn is shown in bold as you enter the individual parameters.

The ScreenTip for the IF() function.

Figure 4-6. The ScreenTip for the IF() function.

If you are familiar with a function, you can probably enter the function faster without assistance. The section titled Viewing Arguments, later in this chapter, explains how the syntax information is displayed in the versions of Excel prior to Excel 2002.

In Excel 2007 and Excel 2010 the support for entering formulas was further improved. If you start typing a formula, a list with suggestions appears (see Figure 4-7).

Excel 2007 and Excel 2010 suggest functions starting with “I” and display a description.

Figure 4-7. Excel 2007 and Excel 2010 suggest functions starting with “I” and display a description.

The Function Wizard helps you select a function and enter the appropriate parameters. The Function Wizard button disappeared from the standard toolbar in Excel 2002 and was replaced by more options in the AutoSum menu, but the functionality is still available in Excel 2003, Excel 2007, and Excel 2010.

To start the Function Wizard, use one of the following methods:

The Function Wizard helps you enter functions and offers explanations of the arguments. During the entry process, you can terminate the creation of a function at any time by clicking the Cancel button in the Function Wizard or by pressing the Esc key.

Assume that you want to calculate the monthly repayments for a loan of $100,000 over a period of ten years and at an interest rate of 7 percent. Of course you can use a function for this calculation (see Figure 4-9).

Follow these steps:

The interest is the annual percentage rate and has been divided by 12 to provide the monthly interest rate. In the Nper argument, you have to multiply the duration of 10 years by 12 to obtain the total number of monthly installments (120).

A question frequently asked by Excel users is, “How can I find out if Excel provides a function for my problem?” This book was written to address this problem, but the Function Wizard can also offer some help.

Open the Function Wizard and enter your question in the Search For A Function box (see Figure 4-12).

A selection of suggested functions will be offered. Some of the suggestions will not be useful, but this facility provides a good starting point and searches for functions across all categories (see Figure 4-13).

When you are entering function parameters in the Function Arguments dialog box, to the right of each text box is a small button with a red arrow (see Figure 4-14).

If you click this button, the rest of the dialog box is hidden, leaving just the text box and allowing more of the underlying spreadsheet to be viewed and selected. This feature allows you to complete cell references simply by selecting cells on the sheet.

All general selection rules apply: If you select a range, the range operator (:) is inserted, and for single cells (use the Ctrl key and click to select two or more single cells), the combination operator (,) is used. This method is not only easier than entering information manually but also helps to avoid errors.

To return to the full Function Wizard view, click the button at the right end of the text box again.

The Function Wizard also allows quick access to the Excel Help facility. Excel Help explains each function with all arguments and provides detailed examples. The Help facility has improved considerably since Excel 2002, and although this section focuses on the Excel 2007 Help facility, help for functions in older versions of Excel can easily be accessed.

The Function Wizard displays tips for the selected function when you click the Help On This Function link in the lower-left corner of the dialog box, which opens the corresponding help topic (see Figure 4-15).

When defining a function, you often need to specify a function as one of the arguments of the function. This is known as nesting functions.

For example, assume that you want to calculate the sine of an angle. The angle is specified in degrees (see Figure 4-16). Because the sine function in Excel expects a radian measure, you have to use the RADIANS function. This is a nested function because you use both functions.

To enter a nested function, perform the following steps:

You can manually edit a function in the formula bar. After you make a change, press the Enter key. To directly edit the function in the cell, double-click in the cell or press the F2 key.

You can also use the Function Wizard to edit formulas with functions. To do this, click in the cell containing the function and then click the Insert Function button in the formula bar or select the Insert/Function menu option. Change the arguments as required. Click OK to close the dialog box.

See Also

Read the tips in Chapter 3, for information about entering, testing, and modifying formulas.