16
Page 1 of 16 Chapter 2: Writing Basic Formulas in Excel Last update: 5/3/2017 ESSENTIAL OUTCOMES 2. Students will calculate and create formulas in Excel with 85% accuracy by: a. Incorporating mathematical operators when writing formulas for basic algebraic expressions and business scenarios; b. Writing basic formulas using parenthesis ; c. Displaying formulas in a workbook; d. Calculating totals using relative and absolute cell references; e. Hide & Unhide rows and columns f. Conditional Formatting , Sparklines , Charts and other Aesthetic & Prominent features g. Connecting key terms in the chapter with application. ne benefit of using a spreadsheet is its ability to perform calculations using formulas. Formulas are mathematical statements used to calculate values. Every formula in Excel MUST begin with an equal sign (=). For example, entering the formula = 25 * 3 in a cell displays the value 75. O Mathematical Operators The following basic mathematical operators can be used in a formula: Exponentiat ion ^ Multiplicat ion * Division / Addition + Subtraction -

Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Embed Size (px)

Citation preview

Page 1: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 1 of 11

Chapter 2: Writing Basic Formulas in ExcelLast update: 5/3/2017

ESSENTIAL OUTCOMES2. Students will calculate and create formulas in Excel with 85% accuracy by:

a. Incorporating mathematical operators when writing formulas for basic algebraic expressions and business scenarios;

b. Writing basic formulas using parenthesis;c. Displaying formulas in a workbook;d. Calculating totals using relative and absolute cell references;e. Hide & Unhide rows and columnsf. Conditional Formatting , Sparklines , Charts and other Aesthetic & Prominent featuresg. Connecting key terms in the chapter with application.

ne benefit of using a spreadsheet is its ability to perform calculations using formulas. Formulas are mathematical statements used to calculate values. Every formula in Excel MUST begin with an equal sign (=). For example, entering the formula = 25 * 3

in a cell displays the value 75.OMathematical Operators

The following basic mathematical operators can be used in a formula:

Exponentiation ^Multiplication *Division /Addition +Subtraction -

Exponentiation means to raise a value to a power and is represented by the caret (^) symbol found on the #6 key. For example, 23 – 8 = 8 is expressed as 2 ^ 3 = 8.

Order for Writing Formulas

Excel evaluates a mathematical expression using a specific order of operations. The order is as follows:

1. Exponentiation is performed first.2. Multiplication and division second.3. Addition and subtraction third.

Page 2: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 2 of 11

NOTE: Two operators of the same precedence, for example + and -, are evaluated in order from left to right. For example, the expression 5 + 2 * 3 - 1 evaluates to 10 because multiplication is performed first and then the addition and subtraction.

Examples:Formula Resulting value or

answer= 2 * 2 + 3 * 2 10= 25 * 8 / 4 50= 35 + 12 /3 39= 3 + 5 * 8 + 7 50

Try these formulas yourself by typing in the numbers and creating the formula in Excel.

Writing Basic Formulas without using the AutoSum Function

1. The first step is to open up a new Excel worksheet and type in the following:

2. Next, place your cursor in E1 (since this is where you want to place your answer). Type in the “=” sign.

3. After the equal sign, click on A1; add the * sign (multiplication); click on B1; add the + sign; click on C1; add the * sign; click on D2.

4. Hit Enter. Your results should look as follows:

Page 3: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 3 of 11

Once you have successfully written the above formula, try the 2nd formula in the table on the previous page. Use the same steps as given above, but simply change the mathematical operators that are different in the equation.

Continue the process until you have written the next two formulas given in the above table. The formula bars are given below if you are still unsure how to write them.

The Role of Parentheses in a Formula

The order in which Excel evaluates a mathematical expression can be changed by including parentheses in the expression. Operations within parentheses are evaluated first. For example, the result of (5 + 2) * 3 – 1 is 20 because 5 and 2 were added before the multiplication and subtraction was performed. For example:

Formula Resulting Value

= (3 + 5) * (8 + 7) 120= 3 ^ 2 * 8 – 4 68= 6 + 2 ^ 2 10= (6 + 2) ^ 2 64

Page 4: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 4 of 11

Writing Formulas Using Parenthesis

To calculate the answers for the formulas given below, you would not be able to use the AutoSum Feature. As you have learned, the AutoSum feature is used for total, maximum, minimum and average, all which are built in functions. Plus, the formulas below have parenthesis and parenthesis are calculated first.

So, how would you write the following formulas?

1. The first step is to open the practice Excel activity for Chapter 2. You are looking at determining the formula for Problem 1.

2. Place your cursor in C4 (since this is where you want your answer to appear). Type in the “=” sign.

3. After the equal sign, insert a left parenthesis (Shift + 9).

4. Then type in 5. Close the formula by using the right parenthesis.6. Then type in the plus sign.7. Then type in the next part of the formula8. Then hit Enter.9. If you have done the formula correctly the answer should be 34.10. Continue on to write the remaining formulas on the worksheet.

Once you have completed the formulas, call me over for review.

Error Messages in a Formula

When a formula is entered in a cell, Excel automatically checks the formula for errors. Entering an invalid formula in a cell causes Excel to display an error value in the cell and a triangle in the upper-left corner of the cell. For example, a number cannot be divided by zero because the result is mathematically undefined. Therefore, entering = 10 / 0 displays #DIV/0! in the cell. Selecting

the cell with the error value displays the Trace Error button to the left of the cell. Clicking the Trace Error button displays a list of options.

Formula Resulting Value

= (3 + 5) * (8 + 7) 120= 3 ^ 2 * 8 – 4 68= 6 + 2 ^ 2 10= (6 + 2) ^ 2 64

Page 5: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 5 of 11

The error is described in the top gray line of the list. Selecting Ignore Error removes the Trace Error button and the triangle from the worksheet. Selecting Edit in Formula Bar places the formula on the Formula bar where it can be edited.

Cell Address and Cell References

A formula is an equation that performs a calculation. Like a calculator, Excel can execute formulas that add, subtract, multiply, and divide. One of the most useful features of Excel is its ability to calculate using a cell address (identifies the location of the cell in the spreadsheet—name box) to represent the value in a cell. This value is called using a cell reference (A cell containing a formula or the formula bar). In order to maximize the

capabilities of Excel, it is important to understand how to create simple formulas and use cell references.

When Excel evaluates the formula, it uses the cell reference to locate the value needed in the calculation. For example, in the worksheet to the right, cell C1 contains a formula (the actual formula appears in the formula bar) that references values in cells A1 and B1 (B1 was divided by A1).

As the cell reference is typed, the border of the referenced cell is outlined in a colored border. Cell references can be typed in uppercase or lowercase letters. However, Excel automatically converts a cell reference to uppercase letters when entered. Formulas that contain cell references are automatically recalculated when the value in a referenced cell changes. Using the example above, if we change the number in A1 to 40 instead of 20, the formula will automatically recalculate.

Relative Cell References and Absolute Cell References

elative cell references automatically change when copied. You have been using

relative cell references when you used the fill hand to copy formulas across the row or column using the AutoSum feature. In these formulas, notice that you did not skip any cells when computing the formula. By

R

Page 6: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 6 of 11

reviewing the image to the right, you will see that the formulas run from B6:B10. No cells were skipped in the formulas.Go back to your Class Practice worksheet. Select the sheet name “Practice 2”. Using the AutoSum feature, write the formulas for cells B11:B14. Then use the fill handle to copy the formulas to column C.

However, there may be times when a cell references should remain the same. A cell reference that does not change when copied is called an absolute cell reference. An absolute cell reference contains dollar signs in front of both the column letter and row number. To insert these dollars signs, just hit the short-cut key, F4. These dollar signs tell Excel to use only a particular cell when computing a formula.

Go back to your Class Practice worksheet. Select the sheet name “Practice 2”. Notice that in cell B5 there is a 7% sales tax. In B17, the cell for Sales Tax on Total has not yet been determined. To determine the Sales Tax on Total, you will take the Sum in B13 and multiple it by the sales tax in B5. Then use the fill handle to copy the formula over to C13. The answer in B17 is $9.45 if you have done the formula correctly. In C17, the formula is zero. However, this formula is not correct. Why? Because 7% x the total is not zero. This is an error.

If you look at the example on the left, you will see that the formula written for B17 is correct (B13*B5). However, if you look at the formula in C17, you should see that the formula is NOT correct. Instead of using B5, Excel used the relative cell reference, C5.

To fix the error:

1. Go back to cell B17.2. Place your cursor inside the formula in front of B5.3. Then hit the key, F4. This key should insert

dollar signs in front of the B and in front of the 5. You have now created an absolute cell reference.

4. Hit Enter. Then use the fill handle to copy the formula over to C17.

5. The answer should now be correct.

Page 7: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 7 of 11

So, whenever you are skipping over cells to determine a formula, you are using an absolute cell reference and dollar signs are needed in the cell that remains constant in the formula.

Writing a Basic Formula

When you need to write a basic formula, such as trying to find the difference between two cells, you will need to write the formula.

To do this:

1. Insert the equal sign.2. Click on the first cell.3. Add the minus sign.4. Click on the next cell.5. Hit Enter.

Displaying Formulas in an Excel document

To display all of your formulas, use the short-cut method, Ctrl + ` (grave accent). The grave accent sign can be found right above the tab key on your keyboard. When you display the formulas, the size of your cells will expand so that the formula can be fully displayed. Displaying formulas does not change the worksheet, only the way it is displayed. Printing when formulas are displayed prints the formulas stored in the cells rather than the values or totals.

To turn off the formulas, press the Ctrl + ` again and the formulas are removed, replaced once again with the values (totals).

Once you have reached this point, call me over to review your work. Make sure you have displayed your formulas in the Excel document so that I can see how you wrote your formulas.

New Aesthetic Feature Options:

Orientation Alignment: A new aesthetic feature in Excel is the Orientation Alignment feature. It is located on the Home tab, underneath the Alignment ribbon, and is to the right of the “Bottom Align” icon (see diagram to the right). This feature allows you to angle your text. It should only be used with headings, subheadings and column headings when appropriate. It should never be used for text inside a table. The example below shows the effect of “Angle Counterclockwise” features when applied to column headings for a table.

Page 8: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 8 of 11

Worksheet Tab Color: Another aesthetic feature that is new that is the tab color for each worksheet tab (tabs at the bottom of a

worksheet). At the bottom of a worksheet, each worksheet inside the workbook has a tab that contains the “Sheet name” of the worksheet. You can add color to the tab by right clicking on the “Sheet Name” and then selecting the color options. Choose the color you want for your tab.

Tables in Excel:

Tables in Excel are a little different than tables in Word. You will find the Table options underneath the Home tab, in the “Styles” ribbon toolbar section. Look for the icon called, “Format as Table” and click on the drop down arrow to the right of the icon. The following drop down will open, giving you a variety of choices for tables: Light, Medium and Dark (see diagram to the right).

To add a table, first select the data in the worksheet that you want inside a table. Then select the drop down arrow next to the Format as Table feature. Select the type of table you would like to add.

Once you select the table, the following “Format to Table” dialog box will open. Make sure you select, “My table has headers” (see diagram below). If you do not, your column headings will be outside of your table, which would be very confusing to the people trying to follow the data in the table. You will end up with two headings: One heading that is blank or has irrelevant data and the original headings that are now disconnected from the table.

Conditional Formatting

Conditional Formatting is a prominent feature in Excel. Conditional Formatting is a tool that allows you to apply formats to a cell or range of cells, and have that formatting change depending on the value of the cell or the value of a formula. For example, you can have a cell appear bold only when the value of the cell is greater than 100. This feature allows you to highlight unusual values based on criteria data using Data Bars, Color Scales and Icon Sets. By applying conditional formatting to your data, you can quickly identify variances in a range of values with a quick glance.

c

c

Page 9: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 9 of 11

Conditional formatting can be found on the Home tab, in the Styles ribbon section. When you click on the drop down menu, you will see the following list of options (see image on the right side).

Highlight Cells Rules: Top/Bottom Rules Data Bars Color Scales Icon Sets

In this class, our focus will be on using the bottom three conditional formatting. Using these requires that you review the data in the cells to find out what you want to accentuate in your worksheet. In the example below, the temperature data had conditional formatting added to the cells to show a color scale that differentiates high, medium, and low values.

Sparklines

Sparklines are also prominent features in Excel that are placed inside individual cells in a worksheet. A sparkline is a tiny chart in a worksheet cell that provides a visual representation of data. Use sparklines to show trends in a series of values, such as seasonal

increases or decreases, economic cycles, or to highlight maximum and minimum values. Position a sparkline near its data for greatest impact. You will find sparklines underneath the “Insert” tab, in the “sparkline” ribbon toolbar.

You will find three types of sparklines:

Line: inserts a line chart with a cell. Column: inserts a column chart within a cell. Win/Loss: inserts a win/loss chart within a cell.

Why use sparklines? Data presented in a row or column is useful, but patterns can be hard to spot at a glance. The context for these numbers can be provided by inserting sparklines next to the data. Taking up a small amount of room, a sparkline can display a trend based on adjacent data in a clear and compact graphical representation. Although it's not mandatory for a sparkline cell to be directly next to its underlying data, it is a good practice.

You can quickly see the relationship between a sparkline and its underlying data, and when your data changes you can see the change in the sparkline immediately. In addition to creating a single sparkline for a row or column of data, you can create several sparklines at the same time by selecting multiple cells that correspond to underlying data, as shown in the following picture.

Page 10: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 10 of 11

Defining Charts Parts

A chart is a visual representation of data presented. A chart usually contains titles, data labels, a legend, and at least one data series. Titles and labels are used to describe what is charted. A chart title identifies the chart. A legend contains labels that identify the data series. A data series, or series, is a set of related data to be plotted on the chart. The data to be charted dictates what type of chart to use. The three most commonly used chart types are pie, bar and line.

The following list below will basically identifies which chart to use:

A pie chart includes only one series of data, with each slice of the pie representing a part of the whole. Pie charts are usually used when working with percentages.

A bar/column chart is used when you want to measure two or more series of data. Bar charts are displayed with bars (up/down or horizontal/vertical) and column charts (cylinder s that run up/down or horizontal/vertical) are displayed using columns.

A line chart is also used to measure two or more series of data and is displayed through the use of lines.

Now that you have practice the skill above, go back to your Practice Excel workbook. You are to insert a Table (make sure you include Table with Headers) and chart.

Adding Table:

1. Select cells A6:D16.2. Go to the “Format as Table” icon on the Home

tab. 3. Select any type of table that you want.4. When it asks you if you want to add “headers”

to the table, click “OK”. Row 6 is the headers that need to be identified in the table. So when you add a table, make sure you also have selected the column headings as the start of your table. NOTE: do NOT include titles in the worksheet in your table.

5. When you have finished, your table should look similar to the one on the right.

Page 11: Chapter 2: Writing Basic Formulas in Excel€¦ · Web viewalculate and create formulas in Excel . with 85% accuracy by: Incorporating mathematical operators. when writing formulas

Page 11 of 11

Adding a Pie Chart

1. The next step is to add a Pie Chart.2. Since Pie Charts are only used for one column and percentages, we need to tell Excel

what columns we want inside the chart.3. Select A7:A11.4. Hold the Ctrl key down.5. Then select D7:D11.6. Let up on the Ctrl key.7. Go to Insert, and select the drop down arrow for the Pie Chart.8. Choose one of the Pie Charts.9. Every chart needs a chart title to identify its purpose. Go to “Chart Tools Layout”,

and the look for the Chart title icon. Click on the drop-down arrow and select “Above Chart”. Type in “Product % Difference”.

10. To add the percentages, click somewhere in the middle of the chart. You want the sizing handles for the individual pieces to be displayed.

11. Then go to Layout and select the drop-down arrow for the Data Label icon. Go all the way to the bottom until you see “More Data Label Options.” Under the Label Options section, select “Percentages” and then turn of the Values and Show Leaders Lines.

12. To add a Design Chart Style, click on the Design feature, go to the Chart Styles section and select a chart design.

When you have finished, show me your completed work.

Back to Top.