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.

The Backstage View

The Backstage View (The File Menu)

In this lesson, you will learn to work with the Backstage View (The File Menu).

Lesson Goals

  • Open a Microsoft Excel workbook.
  • Start a new Microsoft Excel workbook.
  • Use Microsoft Excel templates.
  • Print a Microsoft Excel workbook.
  • Personalize your copy of Microsoft Excel.

Introduction to the Backstage View

The Ribbon, covered in the prior lesson, is where you find all the commands necessary to make changes to your worksheets. Clicking on the tabs in the Ribbon changes the set of commands available to you while you work in your worksheet. After clicking on the File menu, you can no longer see your worksheet or the Ribbon. Instead, you see what Microsoft calls the Backstage view. This is where you:
  1. Manage your current workbook and other workbooks (Save, Open, Close, Print, etc.).
  2. See information about your current workbook (Permissions, Location, Size, Date Last Modified, Author, etc.).
  3. Manage your Excel settings and options (User Interface Options, number of sheets in new workbbooks, customize the Ribbon, etc.)
Please note that there is no FILE menu or Backstage view in Microsoft Excel 2007.
Many of the features of the Backstage view are covered in our intermediate and advanced Microsoft Excel classes. Only those that are essential to working with Microsoft Excel are covered in this class.

Opening a Workbook

There are two ways to open a Microsoft Excel workbook from the Backstage view:
  1. Select Open from the FILE menu.
Select a location from which to open the document in the Open section (in Excel 2013 only).
In the dialog box that opens up, navigate to the file you want to open and double-click it or select it and click Open.
 2. 
  1. For files you have recently used, select Recent from the FILE menu and then select the file.

Open a Workbook

Duration: 5 to 10 minutes.
In this exercise, you will practice opening Microsoft Excel workbooks from the File menu.
  1. Using the FILE menu, open My First Workbook.xlsx from the Excel2013.1/Exercises folder.
  2. Close My First Workbook.xlsx.
  3. Open My First Workbook.xlsx from the FILE menu, using a different method than you used the first time.
  4. Close My First Workbook.xlsx.

Solution:

  1. File > Open
    1. FILE > Open
    2. Navigate to Excel2013.1/Exercises.
    3. Select My First Workbook.xlsx and click the Open button.
  2. FILE > Recent
    1. FILE > Recent
    2. Click Recent Workbooks (in Excel 2013) and click the My First Workbook.xlsx workbook.

New Workbooks and Excel Templates

When creating a new Microsoft Excel workbook, you can choose between creating a blank workbook or creating your workbook from an existing template.

Creating a New Blank Workbook

To create a new blank workbook:
  1. From the FILE menu, select New:
  2. Click (double-click in Excel 2010) Blank workbook:

Creating a New Workbook from a Template

A template is a predesigned Excel workbook that you can then change to suit your needs. When you create a new workbook from a template, you are creating a copy of the original template.
To create a new workbook from a template:
  1. From the FILE menu, select New:
  2. In the Search box, search a template category and press Enter.
  3. Click a template, and to download it, click Create.
If you are using Excel 2010, you will follow step 1, and then double click a template category, select a template to view it, and select Download to download it.
Once you've downloaded a template, it is stored in the My Templates location on your computer.

Modifying a Template

You can modify an Excel template:
  1. Select the FILE menu, and select New.
  2. Select a template from the list and click Create.
  3. Make the desired changes to the template.
  4. Save the template with a new name. It will by default be saved in the Templates folder.

Select, Open and Save a Template Agenda

Duration: 5 to 10 minutes.
In this exercise, you will create a new workbook using a Microsoft template.
  1. Locate a template to use to create an agenda for a meeting.
  2. Download the template.
  3. Save the workbook as My Agenda.xlsx in your Excel2013.1/Exercises folder.
  4. Leave the file open as we will be using it in future exercises.

Solution:

  1. From the FILE menu, select New:
  2. In the Search box, search "agendas" and press Enter.
  3. Click a template, and to download it, click Create.
    1. Click FILE > Save As:
      1. Navigate to the Excel2013.1/Exercises folder.
      2. File name: type "My Agenda".
      3. Save as type: select "Excel Workbook."
      4. If a dialog box appears asking you if you want to save changes to the workbook template, click No.

    Printing Worksheets

    The Print window gives you access to several printing and page layout options. You will also see a preview of how your worksheet will print.
    To print a Microsoft Excel worksheet:
    1. From the FILE menu, select Print.
    2. Choose your print options (number of copies, printer, etc.) and click the Print button.

    Adding Your Name to Microsoft Excel

    You can personalize your copy of Microsoft Excel by adding your name. When you do so, the information is used throughout the Microsoft Office products. Excel uses this information for tracking changes and assigning comments and for prefilling data used by some of the built-in templates.
    To add your name and initials to Microsoft Excel:
    1. From the FILE menu, select Options.
    2. The options you can customize are grouped into categories, which you can see on the left side of the screenshot below. The default category is General. Fill in your name and initials under Personalize your copy of Microsoft Office

    Managing Workbook Versions

    Excel automatically saves documents as you work with them. You can manage these auto-saved versions from Backstage view.
    To set options for managing these, click Options in Backstage view and in the Excel Options dialog box, select Save. You will see autosave options here.
    To delete autosaved workbooks:
    1. From the FILE menu tab, select Info, if necessary.
    2. Under Versions, you will see any auto saved versions.
    3. To delete one, right-click it and select Delete This Version.