Formula Basics
A formula is entered into a cell. It performs a calculation of some type and returns a result, which is displayed in the cell. Formulas use a variety of operators and worksheet functions to work with values and text. The values and text used in formulas can be located in other cells, which makes changing data easy and gives worksheets their dynamic nature. For example, you can see multiple scenarios quickly by changing the data in a worksheet and letting your formulas do the work.
A formula can consist of any of these elements:
- 1. Mathematical operators, such as + (for addition) and * (for multiplication)
- 2. Cell references (including named cells and ranges)
- 3. Values or text
- 4. Worksheet functions (such as SUM or AVERAGE)
When you are working with a table, a new feature in Excel 2007 enables you to create formulas that use column names from the table-which can make your formulas much easier to read.
After you enter a formula, the cell displays the calculated result of the formula. The formula itself appears in the Formula bar when you select the cell, however.
Following are a few examples of formulas:
=150*.05 | Multiplies 150 times 0.05. This formula uses only values and is not all that useful because it always returns the same result. You may as well just enter the value 7.5 into the cell. |
=A1+A2 | Adds the values in cells A1 and A2. |
=Income-Expenses | Subtracts the value in the cell named Expenses from the value in the cell named Income. |
=SUM(A1:A12) | Adds the values in the range A1:A12. |
=A1=C12 | Compares cell A1 with cell C12. If they are identical, the formula returns TRUE; otherwise it returns FALSE. |
Formulas always begin with the equal sign so that Excel can distinguish them from text.