Sabtu, 19 Desember 2015

Using Formulas in Microsoft Excel

Using Formulas in Microsoft Excel

This is the math lesson, and whether you love or hate math, by the end of this lesson you will agree that Excel makes math easy. We will start by explaining some of the basic concepts you need to understand regarding how Excel does math and then will get into entering formulas.

Lesson Goals

  • Learn about math operators and the order of operations.
  • Learn how to enter basic formulas.
  • Use AutoSum to sum data with one click.
  • Learn about absolute, relative, and mixed cell references.
  • Copy formulas and functions.

Math Operators and the Order of Operations

Math Operators

The six mathematical operators you need to know to enter basic formulas in Excel are:
  1. Addition. Plus sign (+).
  2. Subtraction. Minus sign (-).
  3. Multiplication. Asterisk (*).
  4. Division. Forward slash (/).
  5. Percent. Percent sign (%).
  6. Exponentiation. Exponents sign (^).

Math Operators

When a formula uses more than one operator, the order of operations in Excel is as follows:
  1. Parentheses. Operations contained in parentheses (or brackets) are executed first.
  2. Exponents. Exponents are executed second.
  3. Multiplication / Division. Multiplication and division, which Excel treats equally, are executed third, from left to right.
  4. Addition / Subtraction. Addition and subtraction, which Excel treats equally, are executed last, from left to right.

Entering Formulas

The simplest (not always the easiest) way to enter a formula in Excel is to:
  1. Select the cell in which you wish to enter a formula.
  2. Press "=" on your keyboard.
  3. Select the first cell which contains data you will use in your formula.
  4. Type the operator (+, -, *, or /).
  5. Select the second cell which contains data you will use in your formula.
  6. If necessary, type additional operators and select additional cells. If some operations should be performed before others, enclose those operations in parentheses.

AutoSum (and Other Common Auto-Formulas)

Some formulas can be entered simply by clicking a button in Excel. Excel will even guess which data the formula applies to, meaning that if your spreadsheet is properly laid out, you don't have to select the cells.

AutoSum

To quickly sum a row or column of data:
  1. Select the cell to the right or at the bottom of a set of numbers:
  2. On the HOME tab, in the Editing group, click the AutoSum command:
  3. Note that Excel guesses the data you wish to sum and gives you the option to edit the formula if you wish:
  4. Press Enter.

Count Numbers

To quickly count the number of cells in a row or column that have data:
  1. Select the cell to the right or at the bottom of a set of numbers:
  2. On the HOME tab, in the Editing group, click the drop-down arrow to the right of the AutoSum command:
  3. Select Count Numbers:
  4. Note that Excel guesses the cells in which you wish to count numbers and gives you the option to edit the formula if you wish:
  5. Press Enter.

Average

To quickly average the numbers in a row or column:
  1. Select the cell to the right or at the bottom of a set of numbers:
  2. On the HOME tab, in the Editing group, click the drop-down arrow to the right of the AutoSum command:
  3. Select Average:
  4. Note that Excel guesses the cells in which the data you wish to average lies and gives you the option to edit the formula if you wish:
  5. Press Enter.

Min

To quickly find the minimum number in a row or column:
  1. Select the cell to the right or at the bottom of a set of numbers:
  2. On the HOME tab, in the Editing group, click the drop-down arrow to the right of the AutoSum command:
  3. Select Min:
  4. Note that Excel guesses the cells in which you wish to find the minimum number and gives you the option to edit the formula if you wish:
  5. Press Enter.

Max

To quickly find the maximum number in a row or column:
  1. Select the cell to the right or at the bottom of a set of numbers:
  2. On the HOME tab, in the Editing group, click the drop-down arrow to the right of the AutoSum command:
  3. Select Max:
  4. Note that Excel guesses the cells in which you wish to find the maximum number and gives you the option to edit the formula if you wish:
  5. Press Enter.

Copying Formulas and Functions

Formulas can be copied from one cell to other cells in Excel. To copy formulas in Excel:
  1. Select the cell which contains the formula you wish to copy.
  2. On the HOME tab, in the Clipboard group, click the Copy command.
  3. Select the cell into which you wish to copy the formula.
  4. On the HOME tab, in the Clipboard group, click the Paste command.
Another way to copy formulas is by using Autofill, or dragging the Fill Handle in the cell containing the formula to the other cell or cells in which you wish to copy the formula. Autofill, which was introduced earlier in this course, is especially useful for copying formulas.
To use Autofill to copy formulas:
  1. Enter a formula in one cell:
  2. Click on the Fill Handle, which is located in the bottom right cell of the selected cells:
  3. Drag the Fill Handle for as many rows or columns as desired:
  4. Release the mouse to enter the formula into the desired cells:

Displaying Formulas

When working with formulas, if you wish to display the formula within its associated cell in a worksheet, in Excel 2013, select the FORMULA tab and in the Formula Auditing group, select Show Formulas.
You can toggle this option on and off by selecting and de-selecting this option.

Relative, Absolute, and Mixed Cell References

Relative Cell References

Note that in the example above, when we copied the formula from one cell to others, the formula automatically changed to add the cells in the corresponding rows:
  1. The formula in cell E4 added B4C4 and D4.
  2. The formula in E5 added B5C5 and D5.
  3. etc...
This happened because the formula we entered contained Relative cell references.
Relative cell references are the default in Excel. They are called "relative" because the actual cell row and column used in the formula are not significant. Instead, the significant thing is the location of the cell used in the formula relative to the location of the cell in which the formula is entered.
The way to think of the formula E4 = B4 + C4 + D4 is Result = (cell 3 places to the left) + (cell 2 places to the left) + (cell 1 place to the left) of the cell in which the Result is entered.

Absolute Cell References

Sometimes you want a formula to refer to a specific cell regardless of where in your worksheet the formula is executed. In the following example, the formulas in column F all refer to cell B1:
The way to tell Excel that a formula should always refer to a specific cell is to use dollar signs ($). In the above example, the formula we used in cell F4 is =E4 / $B$1. No matter where we put this formula in our worksheet, it will divide the cell one to the left of the cell in which we enter the formula by cell B1.
Finally, notice that we entered the dollar sign twice in the above formula, before the "B" and before the "1". The first $ made the column an absolute reference and the second made the row an absolute reference. In this example, it was not actually necessary to make the column an absolute reference. The takeaway here is that when you refer to a cell in a formula, you can make either or both of the column and row references Absolute or Relative.

Mixed Cell References

Mixed cell references are a combination of relative and absolute references.
Just like in absolute cell references, in mixed cell references the dollar sign ($) is used to refer to a specific cell that is fixed.
An example of a mixed cell reference would be: $F4. This would mean that the the column letter, F, is fixed, while the row number is allowed to be copied from cell to cell.

Working with Formulas

Duration: 15 to 25 minutes.
In this exercise, you will use formulas to enter additional data into the quarterly profit and loss statement we are creating for Dave's Lemonade Stand.
  1. Continue working in the workbook from the last exercise or open Dave's Lemonade Stand - Working with Formulas.xlsx from your Webucator/Excel2013/Exercises folder.
  2. Use AutoSum to sum the Total Income in row 5.
  3. Enter a formula to make payroll 30% of Total Income each quarter.
  4. Enter a formula to make marketing 25% of the each quarter's Total Income.
  5. Enter a formula to make Supplies 20% of Total Income each quarter.
  6. Use AutoSum to sum the Total Expense in row 10.
  7. Use a formula to calculate Net Income (Total Income - Total Expense).
  8. Enter "Margin" in cell A12 and then use a formula to calculate the Margin (Net Income / Total Income).
  9. Format all cells to look like they do in the below image:
  10. Save the workbook.

Solution:

  1. Open or go to the specified file.
  2. Use AutoSum to sum the Total Income in row 5.
    1. Select cell B5 and click AutoSum and press Enter.
    2. Grab the Fill Handle in cell B5 and drag the formula in cell B5 to cell E5.
  3. Enter a formula to make payroll 30% of Total Income each quarter.
    1. In cell B7, enter "=B5*.3"
    2. Grab the Fill Handle in cell B5 and drag the formula in cell B7 to cell E7.
  4. Enter a formula to make marketing 25% of the first quarter's Total Income each quarter (so all formulas refer to cell B5).
    1. In cell B8, enter "=$B$5*.25".
    2. Grab the Fill Handle in cell B8 and drag the formula in cell B8 to cell E8.
  5. Enter a formula to make Supplies 20% of Total Income each quarter.
    1. In cell B9, enter "=B5*.2".
    2. Grab the Fill Handle in cell B9 and drag the formula in cell B9 to cell E9.
  6. Use AutoSum to sum the Total Expense in row 10.
    1. Select cell B10 and click AutoSum and press Enter.
    2. Grab the Fill Handle in cell B10 and drag the formula in cell B10 to cell E10.
  7. Use a formula to calculate Net Income (Total Income - Total Expense).
    1. Select cell B11 and enter "=B5-B10".
    2. Grab the Fill Handle in cell B11 and drag the formula in cell B11 to cell E11.
  8. Enter "Margin" in cell A12 and then use a formula to calculate the Margin (Net Income / Total Income), which should be displayed as a percent.
    1. Enter "Margin" in cell A12.
    2. In cell B12 enter "=B11/B5".
    3. Grab the Fill Handle in cell B12 and drag the formula in cell B12 to cell E12.
    4. Select cells B12:E12 and click the Percent command.
  9. Make any necessary formatting changes.
  10. Save the workbook.

Tidak ada komentar:

Posting Komentar