Entering Formulas


Entering Formulas

To enter a formula in a cell, follow these steps:

1.

Move the cursor to the desired cell.

2.

Type = to start the formula.

3.

Type the rest of the formula; remember to refer to specific cells by the "A1, B1, etc." cell reference.

4.

Press Enter to accept the formula or press Esc to reject the formula.

When you're finished entering a formula, you no longer see the formula within the cell; instead, you see the results of the formula. For example, if you entered the formula =1+2, you now see the number 3 in the cell. To view the formula itself, just select the cell, and then look in the reference area in the lower-right corner of the spreadsheet window (shown in Figure 32).

Figure 32. Viewing the formula within a cellvia the spreadsheet reference area.




Creating Formulas with Your Mouse

Instead of typing in each cell reference (in the form of A1, A2, and so on), you can simply use the mouse to point to the cell you want to refer to in your formula. For example, if you want to add the contents of cells A1 and B1, you can enter the following formula with your keyboard:

=A1+B1

Or you can use your mouse. In this instance, you'd start by moving the cursor to the cell where you want to put the answer. Use your keyboard to enter the = sign, then use your mouse to click on cell A1. Use the keyboard again to enter the + sign, then use your mouse again to click on cell B1. Press Enter on your keyboard to finish the formula.

You can also use your mouse to enter a range of cells. Let's say that you want to total all the numbers in the range of cells from A1 to A5. In this instance, you use the SUM function (which we'll discuss in due course), followed by the range; the formula looks like this:

=sum(A1:A5)

To enter this formula, start by entering the =sum( with your keyboard. Next, use your mouse to select the cells from A1 to A5. (Click the first cell, hold down the mouse button, and then drag to include all the cells in the range.) Finally, finish things up by entering the final ) with your keyboard, and press Enter.



Editing Formulas

After you've entered a formula, you can edit it by selecting the cell in question and pressing the F2 key. As you can see in Figure 33, this shows the formula within the cell, as opposed to the result of the formula (which is what normally appears). Use your keyboard to make whatever edits are appropriate, then press the Enter key to register your changes.

Figure 33. Editing a formula within a cell.




Section 12. Using Functions

A function is a type of formula built in to Google Spreadsheets. You can use Google's built-in functions instead of writing complex formulas in your spreadsheets; you can also include functions as part of your formulas.



Understanding Functions

Functions simplify the creation of complex formulas. For example, if you want to total the values of cells B4 through B7, you could enter the following formula:

=B4+B5+B6+B7

Or you could use the SUM function, which is built in to Google Spreadsheets. The SUM function lets you total (sum) a column or row of numbers without having to type every cell into the formula. In this instance, the formula to total the cells B4 through B7 could be written using the SUM function, like this:

=sum(B4:B7)

A lot easier, don't you think?

Google Spreadsheets uses most of the same functions as those used in Microsoft Excel. All Google functions use the following format:

=function(argument)

Replace function with the name of the function, and replace argument with a range reference. The argument always appears in parentheses.

Note

Functions can be written all lowercase (sum), all uppercase (SUM), or capitalized (Sum). Capitalization doesn't matter.