19
Copyright 2003 Peter McDevitt Copyright 2003 Peter McDevitt 1 XP Microsoft Excel 2002 Microsoft Excel 2002 Lecture 2 – Working With Lecture 2 – Working With Formulas and Functions Formulas and Functions

XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Embed Size (px)

Citation preview

Page 1: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 11

XP

Microsoft Excel 2002Microsoft Excel 2002

Lecture 2 – Working With Lecture 2 – Working With Formulas and FunctionsFormulas and Functions

Page 2: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 22

OverviewOverview

FunctionsFunctionsFillsFillsCell ReferencesCell ReferencesLogical FunctionsLogical FunctionsDate FunctionsDate Functions

Page 3: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 33

Excel’s functionsExcel’s functions

A function is a predefined, or built-in, formula for a A function is a predefined, or built-in, formula for a commonly used calculationcommonly used calculation. .

Each Excel function has a name and syntax. Each Excel function has a name and syntax. The syntax :1. specifies the order in which you must enter the

different parts of the function.2. The location in which you must insert commas,

parentheses, and other punctuation. Arguments: are numbers, text, or cell references

used by the function to calculate a value. Some arguments are optional

Page 4: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 44

Insert Function ButtonInsert Function Button

Functions are organized into 10 categories:Functions are organized into 10 categories: Database, Date and Time, Engineering, Database, Date and Time, Engineering,

Financial, Math and so on.Financial, Math and so on.

You can use the Insert Function button on the You can use the Insert Function button on the Formula bar to select from a list of functions. Formula bar to select from a list of functions.

A series of dialog boxes will assist you in filling in A series of dialog boxes will assist you in filling in the arguments of the function.the arguments of the function.

Page 5: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 55

FunctionsFunctions

The SUM function is a very commonly used math The SUM function is a very commonly used math function in Excel. function in Excel.

Use Excel's SUM function to total the values in a Use Excel's SUM function to total the values in a range of cells like this: SUM(A1:A100).range of cells like this: SUM(A1:A100).

You can also use functions within functions. You can also use functions within functions. Consider the expression: Consider the expression: =ROUND(AVERAGE(A1:A100),1).=ROUND(AVERAGE(A1:A100),1).

This expression would first compute the average of all the values from cell A1 through 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 pointA100 and then round that result to 1 digit to the right of the decimal point

Page 6: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 66

The Insert Function Dialog boxThe Insert Function Dialog box

This dialog box appears when you click the Insert Function button. It can assist you in defining your function.

Page 7: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 77

The Insert Function Dialog BoxThe Insert Function Dialog Box

This figure depicts how you would enter argument values for the PMT function using the Insert Function dialog box.

Page 8: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 88

Copy & Paste Effects Copy & Paste Effects on Cell Referenceson Cell References

Copied formulas or functions that have cell references Copied formulas or functions that have cell references are adjusted for the target cell or range of cells. are adjusted for the target cell or range of cells.

This may or may not be correct for your worksheet, This may or may not be correct for your worksheet, depending upon what you are trying to do. depending upon what you are trying to do.

You can control this automatic adjusting of cell You can control this automatic adjusting of cell references through the use of relative and absolute references through the use of relative and absolute references.references.

Page 9: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 99

Relative ReferencesRelative References

A relative reference is a cell reference that shifts when A relative reference is a cell reference that shifts when you copy it to a new location on a worksheet. you copy it to a new location on a worksheet.

A relative reference changes in relation to the change of A relative reference changes in relation to the change of location. location.

If you copy a formula to a cell three rows down and five If you copy a formula to a cell three rows down and five columns to the right a relative reference will change columns to the right a relative reference will change along with it. along with it.

Page 10: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1010

Absolute ReferencesAbsolute References

An absolute reference is a cell reference that does not An absolute reference is a cell reference that does not change when you copy the formula to a new location. change when you copy the formula to a new location.

To create an absolute reference, you preface the column To create an absolute reference, you preface the column and row designations with a dollar sign ($). and row designations with a dollar sign ($).

For example, the absolute reference for B5 would be For example, the absolute reference for B5 would be $B$5.$B$5.

This cell reference would stay the same no matter where This cell reference would stay the same no matter where you copied the formula.you copied the formula.

Page 11: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1111

Mixed ReferencesMixed References

A mixed reference combines both relative and absolute A mixed reference combines both relative and absolute cell references. cell references.

You can effectively lock either the row or the column in a You can effectively lock either the row or the column in a mixed reference. mixed reference. For example, in the case of $B5, the row reference would shift, For example, in the case of $B5, the row reference would shift,

but the column reference would not but the column reference would not In the case of B$5, the column reference would shift, but the row In the case of B$5, the column reference would shift, but the row

reference would not reference would not

You can switch between absolute, relative and mixed You can switch between absolute, relative and mixed references in the formula easily in the edit mode or on references in the formula easily in the edit mode or on the formula bar.the formula bar.

Page 12: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1212

Auto Fill Auto Fill

When you need to copy and paste a large number of rows When you need to copy and paste a large number of rows or columns, you can Auto Fill using the fill handle. or columns, you can Auto Fill using the fill handle.

The fill handle is a small black square located in the The fill handle is a small black square located in the lower-right corner of a selected cell or range. lower-right corner of a selected cell or range.

When you drag the fill handle, Excel automatically fills in When you drag the fill handle, Excel automatically fills in the formulas and formats used in the selected cells. the formulas and formats used in the selected cells.

The same rules for relative, absolute, and mixed The same rules for relative, absolute, and mixed references apply for Auto Fill as for copy and paste. references apply for Auto Fill as for copy and paste.

Page 13: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1313

An example of Auto FillAn example of Auto Fill

This figure shows the payment schedule completed for all 240 payments of the mortgage example. Note the Auto Fill Options button to the lower right of the fill handle. If you were to click the Auto Fill Options button, you would then see the menu shown below.

Page 14: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1414

Logical FunctionsLogical Functions

Excel supports several logical functions: AND, FALSE, Excel supports several logical functions: AND, FALSE, IF, NOT, OR and TRUE. IF, NOT, OR and TRUE.

The IF function uses a logical test to determine whether The IF function uses a logical test to determine whether an expression is true or false. It returns one value if true an expression is true or false. It returns one value if true or another value if false. or another value if false.

The logical test is constructed using a comparison The logical test is constructed using a comparison operator. operator. The comparison operators are =, >, >=, <, <=, and <> The comparison operators are =, >, >=, <, <=, and <>

Page 15: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1515

Excel's Date FunctionsExcel's Date Functions

Excel stores dates as integers. Excel stores dates as integers.

You typically do not see these numbers, because Excel You typically do not see these numbers, because Excel automatically formats them to appear in a date format. automatically formats them to appear in a date format.

This method of storing dates allows you to work with This method of storing dates allows you to work with dates the same way you work with numbers. dates the same way you work with numbers.

Excel's commonly used date functions are DATE, DAY, Excel's commonly used date functions are DATE, DAY, MONTH, NOW, TODAY, WEEKDAY and YEAR. MONTH, NOW, TODAY, WEEKDAY and YEAR.

Page 16: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1616

Today and Now FunctionsToday and Now Functions

The TODAY and NOW functions always display the The TODAY and NOW functions always display the current date and time.current date and time.

You will not normally see the time portion unless you You will not normally see the time portion unless you have formatted the cell to display it.have formatted the cell to display it.

If you use the TODAY or NOW function in a cell, the date 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 in the cell is updated to reflect the current date and time of your computer each time you open the workbook.of your computer each time you open the workbook.

Page 17: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1717

Commonly Used Date FunctionsCommonly Used Date Functions

Since dates are stored as integers, you can subtract one date from another to see how many days there are separating the two dates. The figure below provides additional details about the common date functions in Excel.

Page 18: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1818

Use a formula to enter the Use a formula to enter the datedate

On the Documentation worksheet for the mortgage analysis workbook, there is a place for the date, as shown in the figure below. If you wanted a fixed date to remain in cell B4, you would enter that date. If you wanted the date in this cell to always reflect the current date and time when you opened the workbook, you would use the expression =NOW() or =TODAY() as shown in the formula bar in the figure.

Page 19: XP Copyright 2003 Peter McDevitt 1 Microsoft Excel 2002 Lecture 2 – Working With Formulas and Functions

Copyright 2003 Peter McDevittCopyright 2003 Peter McDevitt 1919

RecapRecap

FunctionsFunctionsFillsFillsCell ReferencesCell ReferencesLogical FunctionsLogical FunctionsDate FunctionsDate Functions

Thank You Thank You