You are on page 1of 4

Chapter Four: Introducing Excel Formulas

A worksheet is a set of cells aligned in rows and columns. The cell content can be a statement containing a text message, a number, or a date. In Column A Row 1: (Cell A1) the content of A1 is a number with the value 3. In Column B Row 1: (Cell B1) the content of B1 is a number with the value 5. In Column A Row 2: (Cell A2) the content of A2 is a label Text Message. In Column B Row 2: (Cell B2) the content of B2 is a number, 37333, displayed as a date. Excel assigns dates by counting the number of days since January 1, 1900. Because Excel stores each date as a number, you can add and subtract dates or easily put them in calendar order. To see the date, the number has to be formatted as a date. Column A Row 1 Row 2 3 Text Message Column B 5 March 18, 2002 Column C Column D

Cell content can also be a formula. A formula asks a question and tells Excel to display the answer to that question. A formula always starts with an = sign. Think of a formula as What is? followed by a question. A cell containing a formula is like a flash card; the cell displays the result of calculating the formula. The formula appears in the formula bar above the worksheet. If you use a cell name (called a cell reference) in a formula, Excel uses the value found in that cell to calculate the result of the formula. For example, if you enter =A1 + 5 as a formula in cell C1 Excel will look into cell A1. It sees a 3 in that cell, so it converts the formula into the form = 3 + 5. The answer, 8, will be displayed in cell C1. The formula bar will display the formula, =A1+ 5, if you select cell C1. When you enter these statements or formulas in cell C1, here is what will be displayed: These statements in cell C1 5+3 B1 + 3 A1+B1 SUM(A1:B1) 5+B1 Display this in cell C1 5+3 B1 + 3 A1+B1 SUM(A1:B1) 5+B1 These formulas in cell C1 =5+3 =B1 + 3 =A1+B1 =SUM(A1:B1) =5+B1
Display this in cell C1

8 8 8 8 10

The =SUM(A1:B1) formula works by referencing a rectangle, called a range. A range's shape is described by the two cell addresses in opposite corners. For example the range (A1:C2) would include the cells A1, B1, C1, A2, B2, and C2. The Sum instruction tells Excel to add the total of all the cells in the range. You can create Summation formulas automatically with an icon () found on the Standard toolbar. Summation is normally used to find the total of a row, column, or range of cells, not for simple addition of two cells. If you create a formula by clicking the Summation icon instead of the = sign, it wastes computer power and memory.

Example of ranges: B3:C4, E2:E4, C6:E7 A B C 1 2 3 4 5 6 7 8

Displaying Formulas: Sometimes you may want to display the actual formulas, instead of their results. You can highlight each individual cell and its formula will be displayed in the formula box located above the worksheet area. To view all of the cells as formulas, press Ctrl + ~ (tilde). The tilde key is in the upper left corner of the keyboard. There is a checkbox on the View tab where you can reset the worksheet to display formulas. You can also turn the gridlines on and off from this location. Copying formulas: When a formula is copied, Excel automatically changes the row number in any cell references if the formula is copied into a different row. It automatically changes the column letters in any cell references if the formula is copied into a different column. The adjustment is equal to the number of rows or columns between the copied-into cell and the copied-from cell. In the examples given in the tables below, the formula in the source cell C4 was copied to cells E4 (increased column references by 2), C6 (increased row references by 2) and E6 (increased both row and column references by 2). Comment 4 Letters change when you copy a formula into a 5 different column. 6 = A3+B4+C5 = C3+D4+E5 Numbers change when you copy a formula into a different row. Cell references like those in the table above are called relative (dynamic) cell references. You can include dollar signs in cell references. The dollar sign does not change the the formatting of the number, or the resulting value of the formula. For example, both A1+B2 and $A$1 + $B$2 display exactly the same output. The dollar sign in a cell reference affects what happens when the formula is copied into another cell. The part of the cell reference following the $ will not change. Cell references with dollar signs in front of just the number, C$3 or in front of just the letter, $C3, are called mixed cell references. Cell references with two dollar signs, $C$3 are called an absolute cell references. If you want to create a set of formulas that will always refer to either one specific row: A$1, or one specific column: $B2, use a dollar sign in front of the letter or row number. C = A1+B2+C3 D E = C1+D2+E3

Mixed Cell Reference for a row: The row number stays unchanged when the formula is copied. Mixed Cell Reference for a column: The column letter stays unchanged when the formula is copied. Absolute Cell Reference: The row number and column letter are unchanged if the formula is copied.

= A$1+3 = $A2 + 3 = 78 / $A$3

You can combine absolute, mixed, and relative cell references in a single formula. In the following table, the formula in cell C4 was copied into other cells. Observe which row and column numbers changed and note the effect of the dollar signs. 4 5 6 C = A$1+$B2 = A$1+$B4 D E = C$1+$B2 = C$1+$B4 Comment Notice that only the A and the 2 (in cell C4) change. Because of the $ symbol, the others dont change.

One use for an absolute reference is to divide many numbers by the same constant. First set up a constant in a cell. Then enter a formula into another cell using an absolute cell reference in the formula. The formula can be copied and the reference to the cell containing the constant value is unchanged. Changes to the cell containing the constant will cause the formulas that refer to this cell to recalculate their values. Some common error messages: Error messages start with a Pound sign (#). ##### If you see rail road tracks, your column is too narrow. Solution - widen the column. #DIV/O! You are dividing by an empty cell or zero. Solution - fix the formulas denominator. #REF! Your formula refers to a cell that no longer exists, due to a change in the worksheet. #NAME? Your formula contains text that Excel doesnt recognize. Could have many causes, usually a typo or missing punctuation in a formula. The solution to both #REF and #NAME errors is to click the cell that displays the error, click the button that appears, and then click Trace Error if it appears. CIRCULAR A formula can not refer to the cell it is located in. For example =C4+5 can not be used in cell C4. This will generate an error message below the worksheet. Examples of commonly used formulas. There is no one right way to write a formula; getting the correct result is what matters. Spaces are not necessary in formulas, but were included to allow for ease of understanding.
This table is used with the sample formulas below:

A 25

B 28

C 95

2 3

42 3

91 4

14 5 Entered in Cell D3: = A2 + B3 = B1 + 25 = SUM (A1:C1) = SUM (B1:B3) = SUM (B1:C3) = SUM (A2,B1,C3) = C1 10 = B2 B1 = A3 * 20 = B3 * C3 = A1 * .40 = B1 * 25% = C1 / 5 = A2 / C2 = B3 ^ 2 = A3 ^ 3 =SQRT(A1) = A1 ^ 0.5 = B1 ^ (1/3) = A1 + (A1 * .04) = A1 * 1.04 = A1 + (A1 * 4%) = A1 - (A1 *.08) = A1 *.92 = A1 (A1 * 8%) =A3 / $D$3 = AVG (B1:B3) = AVG (A3:C3) = AVG (B1:C2) = Sheet2!C4 Result Displayed in D3: 46 53 148 123 237 75 85 63 60 20 10 7 19 3 16 27 5 5 3.036589 26 26 26 23 23 23 25% (Format as a %) 41 4 57 The contents of cell C4 in Sheet2.

SAMPLE FORMULAS:

Type of Equation: Addition of Two Cells Addition of a Constant Addition of a Row of Cells Addition of a Column of Cells Addition of a Range of Cells Addition of Scattered Cells Subtraction of a Constant Subtraction of a Cell Multiplication by a Constant Multiplication of Two Cells Multiplication by a % Multiplication by a % Division by a Constant Division by a Cell Exponentiation (Squaring) Exponentiation (Cubing) Square Roots Square Roots Cube Roots Increasing by a Percentage (4%) Increasing by a Percentage (4%) Increasing by a Percentage (4%) Decreasing by a Percentage (8%) Decreasing by a Percentage (8%) Decreasing by a Percentage (8%) Calculate a Percentage (Part/Sum) Average of a Column Average of a Row Average of a Range Formula referring to a cell in another worksheet

You might also like