Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 3: Using Formulas

Similar presentations


Presentation on theme: "Lesson 3: Using Formulas"— Presentation transcript:

1 Lesson 3: Using Formulas

2 create and edit simple formulas
what formulas are create and edit simple formulas use math operators and understand order of calculations reference other worksheets use common functions use SUBTOTAL function use a conditional function use conditional summary functions use text functions use absolute and relative cell references use mixed absolute and relative cell addresses display and print formulas use data validation Pg 67 The Exam objectives covered in this lesson are: 1.3.8 set data validation display formulas 4.1.1 demonstrate how to use references (relative, mixed, absolute) 4.1.2 define order of operations 4.1.3 reference cell ranges in formulas 4.2.1 demonstrate how to apply the SUM function 4.2.2 demonstrate how to apply the MIN and MAX functions 4.2.3 demonstrate how to apply the COUNT function 4.2.4 demonstrate how to apply the AVERAGE function 4.3.1 demonstrate how to apply the SUMIF function 4.3.2 demonstrate how to apply the AVERAGEIF function 4.3.3 demonstrate how to apply the COUNTIF function 4.4.1 demonstrate how to apply the RIGHT, LEFT, and MID functions 4.4.2 demonstrate how to apply the TRIM function 4.4.3 demonstrate how to apply the UPPER and LOWER functions 4.4.4 demonstrate how to apply the CONCATENATE function

3 Creating and Editing Simple Formulas
A formula is a calculation using any combination of: values entered directly values in worksheet cells functions A powerful feature of formulas is ability to get data from other worksheet cells using cell references First character of every formula must be ‘=‘ (equal sign) Formula can have more than one cell reference Formula results automatically update any time data is changed (or added or deleted) Pg 67

4 Creating and Editing Simple Formulas
Example formulas: If the value in cell A1 is changed, all other formulas that use this value directly or indirectly will also change Cell Formula/Value Results Description A1 10 A constant value B1 =A1 References value in cell A1 C1 =A1*8 80 Multiply value in A1 by 8 D1 =C1/5 16 Divide value in C1 by 5 E1 =SUM(A1:D1) 116 Built-in function that calculates sum of cells A1 to D1 Pg 68

5 Creating and Editing Simple Formulas
If Excel detects error or inconsistency in formula, displays message with suggestion on how to fix Displays to mark this formula as different from the formulas used in adjacent cells Clicking on the smart tag displays a menu of options: Pg 68

6 Cell References Can enter cell references into formula by:
typing cell reference directly into cell, or clicking on cells to be referenced Most formulas have one or more cell references Formulas may also use a function that uses a range of cells Example: =SUM(A1:D1) Note use of “:” to separate the two cell addresses Other rules about cell ranges: Can only be used in functions or arrays, not on their own in a formula Can be any rectangular block of multiple rows and columns of cells, or a single column or row Can be an entire row or column, example: =SUM(B:C), =SUM(3:3) Pg 69 Objective 4.1.3

7 Mathematical Operators
Perform calculations in “natural order” (precedence): 1. Exponents and roots 2. Multiplication and division 3. Addition and subtraction Can be altered by placing components of formula within parentheses Standard mathematical operators: * Multiplication / Division + Addition - Subtraction Pg 70 Objective 4.1.2

8 What-If Analysis Simple arithmetic can be done using paper and a basic calculator Spreadsheets are better when many calculations need to be repeated many times with different numbers What-if describes the trial-and-error method of repeating calculations with different numbers Pg 72

9 Referencing Other Worksheets
Can reference cells in other worksheets in same workbook General format is: ‘<worksheet name>’!<cell reference> ! indicates cell is located in different worksheet need single quotes if worksheet name has spaces Can use the point-and-click method to enter the cell reference Pg 75 Objective 4.1.3

10 Using Common Functions
Large library of functions for mathematical and data operations Functions accept values (usually numbers) and cell references as arguments in parentheses General format: =FUNCTION(numbers or values or cell reference) Most commonly used are SUM, MIN, MAX, AVERAGE, and COUNT Pg 76 Objective 4.2.1, 4.2.2, 4.2.3, 4.2.4

11 Using Common Functions
AutoSum is shortcut method to enter a SUM function: On Formulas tab, in Function Library group, click AutoSum, or on Home tab, in Editing group, click AutoSum, or click Insert Function Always verify you have correct cell range in formula Excel automatically selects range of cells immediately above or to left of selected cell, and displays it to accept or change Arrow for AutoSum displays other common functions Pg 77 Objective 4.2.1, 4.2.2, 4.2.3, 4.2.4

12 Using the Subtotal Function
Enter as: =SUBTOTAL(function #,cell range) Calculates a variety of common statistics, such as: 1 – Average 4 – Max 2 – Count 5 – Min 3 – CountA 9 - Sum Ignores other SUBTOTAL calculations in the cell range Pg 80 Objective 2.3.7

13 =IF(logical test,value if true,value if false)
Conditional Function =IF(logical test,value if true,value if false) Logical Test can include comparison operators or qualifiers: = Equal to (or the same as) > Greater than < Less than >= Greater than or equal to <= Less than or equal to <> Not equal to Value if True/False can contain text string, values, or other functions Example: =IF(B10=0,0,C10/B10) Pg 84

14 Conditional Function Nesting IF statements
=IF(A1=10, “text A”, IF(A1=20, “text B”, “text C”)) If A1 contains Then cell will display 10 text A 20 text B Any other value text C Pg 84

15 Using Conditional Summary Functions
Conditional versions of AVERAGE, COUNT, and SUM Combines IF function with AVERAGE, COUNT, and SUM Example: =SUMIF(D4:D207,"Visa",F4:F207) Logical test is "Visa" - value to look for Criteria range is D4:D207 – the cell range to look for the test value Sum range is F4:F207 – apply sum to this range if the logical test is true The logical test is applied to every cell in the criteria range If no comparison operator is used, “=“ is assumed Advanced topic - the logical test can be put into a worksheet cell, and a cell reference to it is placed into the function Sum range is optional If not specified, the sum is applied to criteria range Pg 87 Objective 4.3.1, 4.3.2, 4.3.3

16 Using Text Functions LEFT
Extract the specified number of characters starting from the left side of the text string. RIGHT Extract the specified number of characters starting from the right side of the text string. MID Extract the specified number of characters starting from any position in the text string. UPPER Convert all characters in a text string to uppercase. LOWER Convert all characters in a text string to lowercase. PROPER Convert the first letter of the text string to uppercase. All other characters are set to lowercase. CONCATENATE Join two or more strings together to create one text string. Alternatively, use the & operator to join strings together. Pg 89 Objective 4.4.1, 4.4.2, 4.4.3, 4.4.4

17 Using Absolute and Relative Cell References
Most formulas use relative addressing when formula is copied, cells automatically adjusts for new location address is not adjusted if formula is moved to another location Absolute addressing - cell addresses are not adjusted when copied elsewhere on worksheet To change to absolute cell address: type dollar sign before row number and/or column letter, or press F4 first time makes both column and row reference absolute second time makes only row references absolute third time makes only column reference absolute fourth time removes absolute references on both column and row Pg 91 Objective 4.1.1

18 Using Mixed Absolute and Relative Cell References
Select what needs to stay absolute when formula is copied to another cell: Column Data must be from same column =C10*$D2 Row Data must be from same row =C10*D$2 Both Must always be this cell =C10*$D$2 Pg 92 Objective 4.1.1

19 Displaying and Printing Formulas
To see formula, select cell and examine in formula bar To see all formulas at same time: File tab, click Options, click Advanced, click Show formulas in cells instead of their calculated results Formulas tab, in Formula Auditing group, click Show Formulas Useful for verifying accuracy of spreadsheet Pg 94 Objective

20 Data Validation Prevent errors when data entered
Validation check types: Any value No data validation. Whole number Numeric values without decimal digits. Decimal Any numeric value. List Selection only from a defined list of values. Also known as a pick list. Date Date values only. Earliest date is January 1, 1900. Time Time values only. Text length Text only, up to specified number of characters. Custom Enter a formula to validate the data. Result is True or False. Pg 96 Objective 1.3.8

21 Data Validation Displays icon and error message when incorrect data is entered Displays helpful message when user selects the cell Pg 96 Objective 1.3.8

22 Lesson Summary what formulas are create and edit simple formulas
use math operators and understand order of calculations reference other worksheets use common functions use SUBTOTAL function use a conditional function use conditional summary functions use text functions use absolute and relative cell references use mixed absolute and relative cell addresses display and print formulas use data validation Review the objectives as a quick summary so students recognize the skills they are starting to build.

23 Review Questions 1. List which standard math operators Excel uses and what is their order of precedence. 2. Give examples of how using formulas to perform a what-if analysis is beneficial to you. 3. Which of the following are invalid? a) =MAX(B5:B15) b) =MAX(B5,B6,B7,B8,B9,B10,B11,B12,B13,B14) c) =MAX(B5:B7,B8:B10,B11:B15) d) =MAX(B1,B5:B8,B9:B15) e) All of the above are invalid formulas f) None – all are valid formulas g) c h) b, c, and d Answers to the Review questions are found in the Instructor Resources and can be used at the end or beginning of a class. Alternatively, you can also assign these for homework and then mark them at the beginning of the next class.

24 Review Questions 4. Define the different parts of a reference to other worksheets using the reference Tours!B4 as an example. 5. What is the main difference between an IF function and other functions discussed in this lesson such as SUM, AVERAGE, and UPPER? 6. Are the LEFT and MID functions fully interchangeable? In other words, can you always use the LEFT function instead of MID, as well as using MID instead of LEFT. 7. Explain the difference between absolute and relative cell references. 8. Provide examples of when or why it may be beneficial to print the formulas in the worksheet Answers to the Review questions are found in the Instructor Resources and can be used at the end or beginning of a class. Alternatively, you can also assign these for homework and then mark them at the beginning of the next class.

25 Math and Statistical functions

26 Define functions, and functions within functions
The SUM function is a very commonly used math function in Excel. A basic formula example to add up a small number of cells is =A1+A2+A3+A4, but that method would be cumbersome if there were 100 cells to add up. Use Excel's SUM function to total the values in a range of cells like this: SUM(A1:A100). You can also use functions within functions. Consider the expression =ROUND(AVERAGE(A1:A100),1). This expression would first compute the average of all the values from cell A1 through A100 and then round that result to 1 digit to the right of the decimal point

27 Copy and paste formulas and functions
Copying and pasting a cell or range of cells is a simple, but highly effective means for quickly filling out a large worksheet. To copy and paste a cell or range: Select the cell or range to be copied and then click the Copy button on the standard toolbar Select the cell or range into which you want to copy the selection and then click the Paste button on the standard toolbar Once you are finished pasting, press the Esc key to deselect the selection

28 Copy and paste effects on cell references
Copied formulas or functions that have cell references are adjusted for the target cell or range of cells. For example, if cell G5 contains the formula =F5*B5/B7, and you copy and paste this formula to cell G6, the formula in cell G6 will be =F6*B6/B8. This may or may not be correct for your worksheet, depending upon what you are trying to do. You can control this automatic adjusting of cell references through the use of relative and absolute references.

29 Problems using copy and paste with formulas
When Excel does not have enough room to display an entire value in a cell, it uses a string of these # symbols to represent that value. For example, the formula in cell J5 is =F5-(H5+I5) and this was pasted into cell J6 by updating the cell references there to =F6-(H6+I6). Cell G5 has the formula =F5*B5/B7 and cell G6 contains =F6*B6/B8. This is where things went wrong. Sometimes this automatic update is very useful and other times it does not give you the desired result for your worksheet. In this case, cells B5 and B7 should be referenced in the formula in column G in all 240 payment period rows, but in column J, you want the cell references to be automatically updated. You can control this result using relative and absolute references.

30 Use relative references
A relative reference is a cell reference that shifts when you copy it to a new location on a worksheet. A relative reference changes in relation to the change of location. If you copy a formula to a cell three rows down and five columns to the right, a relative reference to cell B5 in the source cell would become G8 in the destination cell.

31 Use absolute references
An absolute reference is a cell reference that does not change when you copy the formula to a new location. To create an absolute reference, you preface the column and row designations with a dollar sign ($). For example, the absolute reference for B5 would be $B$5. This cell reference would stay the same no matter where you copied the formula.

32 Use mixed references A mixed reference combines both relative and absolute cell references. You can effectively lock either the row or the column in a mixed reference. For example, in the case of $B5, the row reference would shift, but the column reference would not In the case of B$5, the column reference would shift, but the row reference would not You can switch between absolute, relative and mixed references in the formula easily in the edit mode or on the formula bar by selecting the cell reference in your formula and then pressing the F4 key repeatedly to toggle through the reference options.

33 Open the Insert Function dialog box
To get help from Excel to insert a function, first click the cell in which you wish to insert the function. Click the Insert Function button. This action will open the Insert Function dialog box. If you do not see the Insert Function button, you may need to select the appropriate toolbar or add the button to an existing toolbar.

34 Examine the Insert Function dialog box

35 Insert Function helpful tips
In the Insert Function dialog box you can type in a description of what you would like to do in the Search for a function text box and then click the Go button, and Excel will come up with some suggestions for you. You may also select a category from the drop-down box, or choose All, which will list every function in Excel alphabetically. Once you make your selection and click the OK button, another dialog box shows you all the arguments for the function. The arguments shown in boldfaced type are required While the cursor is in an argument's text box, you can either enter a value or click a cell and that cell will appear in the text box, saving you the trouble of typing it

36 The Average Function The average function is necessary to calculate the average of a range of cells. Like any other formula, the average function may be copied across cells.

37 Use Excel's Auto Fill features
When you need to copy and paste a large number of rows or columns, you can use a technique called Auto Fill using the fill handle. The fill handle is a small black square located in the lower-right corner of a selected cell or range. When you drag the fill handle, Excel automatically fills in the formulas and formats used in the selected cells. The same rules for relative, absolute, and mixed references apply for Auto Fill as for copy and paste.

38 Auto Fill features The Fill behavior depends on the date(s) with which you start. If you select two or more dates separated by a month, then Excel will increment the auto filled dates by a month as well. If you select only one date, Excel will increment the dates by one day only. When you drag the fill handle, a small Auto Fill Options button appears to the lower right of the selected cell or range. Common options are Copy Cells, Fill Series, Fill Formatting Only and Fill Without Formatting If you are using the Auto Fill technique for dates, you have additional options to either Fill Days, Fill Weekdays, Fill Months or Fill Years.

39 Using Auto Fill To use the Auto Fill feature, select the cell range that contains the values and/or formulas you want to copy. Click and drag the fill handle in the direction you want to copy and then release the mouse button. If needed, click the Auto Fill Options button, and then select the Auto Fill option you want to apply to the selected range.

40 An example of Auto Fill

41 Auto Fill Options button menu options
The Copy Cells option will copy all values and formulas into the selected range as well as the formats used to display those values and formulas. The Fill Formatting Only option copies only the formats used to display values or formulas without copying the values and formulas themselves. The Fill Without Formatting option copies only the values and formulas without any of the formats used in the source range.

42 Date Functions

43 Excel's date functions Excel stores dates as integers, where the integer value represents the number of days since January 1, 1900. For example, the integer value for the date January 1, 2008 is because that date is 39,448 days after January 1, 1900 You typically do not see these numbers, because Excel automatically formats them to appear in a date format. This method of storing dates allows you to work with dates the same way you work with numbers. Excel's commonly used date functions are DATE, DAY, MONTH, NOW, TODAY, WEEKDAY and YEAR.

44 The TODAY and Now functions
The TODAY and NOW functions always display the current date and time. You will not normally see the time portion unless you have formatted the cell to display it. If you use the TODAY or NOW function in a cell, the date in the cell is updated to reflect the current date and time of your computer each time you open the workbook.

45 Use a formula to enter the date

46 Excel's financial functions
Financial functions are very useful to calculate information about loans. Common functions are FV, IPMT, PMT, PPMT and PV. All these financial functions will use similar arguments that differ based upon which function you are using. Think of the arguments as members of an equation The arguments represent the values of the equation that are known and the function provides the solution for a single variable, or unknown, value

47 Use the financial functions
The FV function calculates the future value of an investment based on periodic, constant payments and a constant interest rate per period. The IPMT function provides the interest payment portion of the overall periodic loan payment. The PMT function calculates the entire periodic payment of the loan. The PPMT function calculates just the principal payment portion of the overall periodic payment. The PV function calculates the present value of an investment.

48 Financial Function descriptions

49 Recognize optional arguments
In the preceding figure, note how rate and nper are arguments for each function. For some of the functions, the final two arguments of each function are in brackets. These represent optional arguments, meaning if you do not enter anything, the default values for these arguments will be used. For example, note the PMT function has fv and type as its final two arguments, which are optional. The assumed values, if no others are supplied, are 0 for both Arguments without brackets do not have default values, so you must supply values or cell references in order for the function to be able to return a value.

50 Use the Insert Function dialog box to enter function arguments

51 Create logical functions
A function that determines whether a condition is true or false is called a logical function. Excel supports several logical functions such as AND, FALSE, IF, NOT, OR and TRUE. A very common function is the IF function, which uses a logical test to determine whether an expression is true or false, and then returns one value if true or another value if false. The logical test is constructed using a comparison operator that compares two expressions to determine if they are equal, not equal, if one is greater than the other, and so forth. The comparison operators are =, >, >=, <, <=, and <> You can also make comparisons with text strings. You must enclose text strings within quotation marks.

52 Using the If function The arguments for the IF function are:
IF(logical_test,value_if_true,value_if_false) For example, the function =IF(A1=10,20,30) tests whether the value in cell A1 is equal to 10 If it is, the function returns the value 20, otherwise the function returns the value 30 Cell A1 could be empty or contain anything else besides the value 10 and the logical test would be false; therefore, the function returns the value 30 To insert an IF function, click the Insert Function button and search for the IF function, then click OK. When the Function Arguments dialog box appears, simply fill in the arguments.


Download ppt "Lesson 3: Using Formulas"

Similar presentations


Ads by Google