You are on page 1of 107

Microsoft Excel 2007 Advanced

Participant Kit - Microsoft Excel 2007 Advanced

Microsoft Excel 2007 Advanced Version 1.2; April, 2011

Participant Kit - Microsoft Excel 2007 Advanced

Contents
EXCEL 2007 FUNCTIONS...................................................................................................... 5 Getting help with using a particular function. .......................................................................................... 5 TODAY function ............................................................................................................................................. 5 DAY function.................................................................................................................................................. 7 MONTH function............................................................................................................................................ 8 YEAR function ............................................................................................................................................... 9 SUMIF function.............................................................................................................................................. 9 ROUND function .......................................................................................................................................... 12 COUNT function ........................................................................................................................................... 13 COUNTA function ........................................................................................................................................ 15 COUNTIF function........................................................................................................................................ 16 PROPER function ........................................................................................................................................ 18 UPPER function ........................................................................................................................................... 19 LOWER function .......................................................................................................................................... 20 CONCATENATE function............................................................................................................................. 20 FV function ................................................................................................................................................... 22 NPV function................................................................................................................................................ 25 PMT function ............................................................................................................................................... 27 PV function .................................................................................................................................................. 29 RATE function.............................................................................................................................................. 32 HLOOKUP function ..................................................................................................................................... 33 VLOOKUP function ...................................................................................................................................... 35 IF function .................................................................................................................................................... 42 AND function ............................................................................................................................................... 45 OR function .................................................................................................................................................. 47 ISERROR ...................................................................................................................................................... 48 DSUM function ............................................................................................................................................ 51 DMIN function ............................................................................................................................................. 59 DMAX function ............................................................................................................................................ 68 Using nested functions ..............................................................................................................85 Nesting IF() Functions ................................................................................................................................ 85 USING ONE-INPUT OR TWO-INPUT DATA TABLES / WHAT-IF TABLES ..............................86 One input Data Table command .............................................................................................................. 86 Two input data table command ............................................................................................................... 87 EXCEL 2007 - A FIRST LOOK AT PIVOT TABLES ..................................................................89 Quick start: Create a PivotTable report ................................................................................................... 89 Modifying data and refreshing the Pivot Table ...................................................................................... 92 grouping data within a Pivot table ........................................................................................................... 93 Pivot table chart ........................................................................................................................94 What is a PivotChart report....................................................................................................................... 94 Working with the source data of a PivotTable or PivotChart report ............................................97 Creating a PivotTable or PivotChart from worksheet data .................................................................. 97 Using an external data source to create a PivotTable or PivotChart .................................................. 97 Using another PivotTable report as the data source ............................................................................ 98 Changing the source data of an existing PivotTable report ................................................................. 98 EXCEL 2007 ANALYSIS ........................................................................................................99
3

Participant Kit - Microsoft Excel 2007 Advanced Creating named Scenarios from defined cell ranges ........................................................................... 99 When to use scenarios .............................................................................................................................. 99 What-if scenarios are helpful for data analyses. ................................................................................ 99 Create scenarios .......................................................................................................................................100 Summarize scenarios ..............................................................................................................................100 Working with Goal seek ..........................................................................................................101 EXCEL 2007 - AUDITING .......................................................................................................102 Tracing precedent cells............................................................................................................................102 Tracing dependants of a cell ..................................................................................................................102 Displaying all formulas within a worksheet .........................................................................................102 Using comments .....................................................................................................................104 Inserting comments .................................................................................................................................104 Deleting Comments .................................................................................................................................104 Navigating Comments .............................................................................................................................104 Show/Hide Comments ............................................................................................................................104 EXCEL 2007 - MACROS ........................................................................................................105 Displaying the Developer tab..................................................................................................................105 Recording and running a macro ............................................................................................................105 Lowering your macro security level .......................................................................................................106 Customizing the Quick Access Toolbar ...................................................................................107 Adding Command button ........................................................................................................................107 Removing Command Button ..................................................................................................................107 Resetting Quick Access Toolbar .............................................................................................................107 Changing the Quick Toolbar Macro icon ...............................................................................................107 Removing a macro icon from the quick access toolbar .....................................................................107 Raising your macro security level ..........................................................................................................107

Participant Kit - Microsoft Excel 2007 Advanced

EXCEL 2007 FUNCTIONS


Getting help with using a particular function. 1. Using Help: Press F1 Type List of functions Select list of functions alphabetically Select the desired function 2. Typing the function in a cell: MS Excel has the feature of contextual help, simply type = and function name in a cell and just click on it.

Figure 1 TODAY function Returns the serial number of the current date. The serial number is the date-time code used by Excel for date and time calculations. If the cell format was General before the function was entered, Excel changes the cell format to Date. If you want to view the serial number, you must change the cell format to General or Number.
5

Participant Kit - Microsoft Excel 2007 Advanced

The TODAY function is useful when you need to have the current date displayed on a worksheet, regardless of when you open the workbook. It is also useful for calculating intervals. For example, if you know that someone was born in 1963, you might use the following formula to find that person's age as of this year's birthday: =YEAR(TODAY())-1963 This formula uses the TODAY function as an argument for the YEAR function to obtain the current year, and then subtracts 1963, returning the person's age. Note If the TODAY function does not update the date when you expect it to, you might need to change the settings that control when the workbook or worksheet recalculates. On the File tab, click Options, and then in the Formulas category under Calculation options, make sure that Automatic is selected. Syntax =TODAY() The TODAY function syntax has no arguments. Note: Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,447 days after January 1, 1900. Microsoft Excel for the Macintosh uses a different date system as its default. Example A 1 2 Formula =TODAY() =TODAY()+5 3 =DATEVALUE("1/1/2030")TODAY() 4 B Description Returns the current date. Returns the current date plus 5 days. For example, if the current date is 1/1/2008, this formula returns 1/6/2008. Returns the number of days between the current date and 1/1/2030. Note that cell A4 must be formatted as General or Number for

Participant Kit - Microsoft Excel 2007 Advanced

5 =DAY(TODAY()) 6 =MONTH(TODAY())

the result to display correctly. Returns the current day of the month (1 - 31). Returns the current month of the year (1 - 12). For example, if the current month is May, this formula returns 5.

DAY function Returns the day of a date, represented by a serial number. The day is given as an integer ranging from 1 to 31. Syntax DAY(serial_number) The DAY function syntax has the following arguments: Serial_number Required. The date of the day you are trying to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. Remarks Microsoft Excel stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39,448 days after January 1, 1900. Microsoft Excel for the Macintosh uses a different date system as its default. Values returned by the YEAR, MONTH and DAY functions will be Gregorian values regardless of the display format for the supplied date value. For example, if the display format of the supplied date is Hijri, the returned values for the YEAR, MONTH and DAY functions will be values associated with the equivalent Gregorian date.

Participant Kit - Microsoft Excel 2007 Advanced Example A 1 2 3 4 Date 15-Apr-2008 Formula =DAY(A2) Description (Result) Day of the date above (15) B

MONTH function Returns the month of a date represented by a serial number. The month is given as an integer, ranging from 1 (January) to 12 (December). Syntax MONTH (serial_number) The MONTH function syntax has the following arguments: Serial_number Required. The date of the month you are trying to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. Example A 1 2 3 4 Date 15-Apr-2008 Formula =MONTH(A2) Description (Result) Month of the date above (4) B

Participant Kit - Microsoft Excel 2007 Advanced

YEAR function Returns the year corresponding to a date. The year is returned as an integer in the range 19009999. Syntax YEAR(serial_number) The YEAR function syntax has the following arguments: Serial_number Required. The date of the year you want to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. Example A 1 2 3 4 5 6 Date 7/5/2008 7/5/10 Formula =YEAR(A2) =YEAR(A3) Description (Result) Year of the first date (2008) Year of the second date (2010) B

SUMIF function You use the SUMIF function to sum the values in a range that meet criteria that you specify. For example, suppose that in a column that contains numbers, you want to sum only the values that are larger than 5. You can use the following formula: =SUMIF(B2:B25,">5") In this example, the criteria is applied the same values that are being summed. If you want, you can apply the criteria to one range and sum the corresponding values in a different range. For example, the formula =SUMIF(B2:B5, "John", C2:C5) sums only the values in the range C2:C5, where the corresponding cells in the range B2:B5 equal "John." Note: To sum cells based on multiple criteria, see SUMIFS function.

Participant Kit - Microsoft Excel 2007 Advanced Syntax SUMIF(range, criteria, [sum_range]) The SUMIF function syntax has the following arguments: range Required. The range of cells that you want evaluated by criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored. criteria Required. The criteria in the form of a number, expression, a cell reference, text, or a function that defines which cells will be added. For example, criteria can be expressed as 32, ">32", B5, 32, "32", "apples", or TODAY(). Important Any text criteria or any criteria that includes logical or mathematical symbols must be enclosed in double quotation marks ("). If the criteria is numeric, double quotation marks are not required. sum_range Optional. The actual cells to add, if you want to add cells other than those specified in the range argument. If the sum_range argument is omitted, Excel adds the cells that are specified in the range argument (the same cells to which the criteria is applied). Notes The sum_range argument does not have to be the same size and shape as the range argument. The actual cells that are added are determined by using theupper leftmost cell in the sum_range argument as the beginning cell, and then including cells that correspond in size and shape to the range argument. For example: If range is A1:A5 A1:A5 A1:B4 A1:B4 And sum_range is B1:B5 B1:B3 C1:D4 C1:C2 Then the actual cells are B1:B5 B1:B5 C1:D4 C1:D4

You can use the wildcard characters the question mark (?) and asterisk (*) as the criteria argument. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the character.

10

Participant Kit - Microsoft Excel 2007 Advanced

Example 1 A 1 2 3 4 5 6 7 8 9 =SUMIF(A2:A5,">160000") =SUMIF(A2:A5,300000,B2:B5) Property Value 100,000 200,000 300,000 400,000 Formula =SUMIF(A2:A5,">160000",B2:B5) B Commission 7,000 14,000 21,000 28,000 Description Sum of the commissions for property values over 160,000. Sum of the property values over 160,000. Sum of the commissions for property values equal to 300,000. Sum of the commissions for property values greater than the value in C2. Result 63,000 C Data 250,000

900,000 21,000

10

=SUMIF(A2:A5,">" & C2,B2:B5)

49,000

Example 2 A 1 2 3 4 5 6 7 8 Vegetables Fruits Formula =SUMIF(A2:A7,"Fruits",C2:C7) Category Vegetables Vegetables Fruits B Food Tomatoes Celery Oranges Butter Carrots Apples Description Sum of the sales of all C Sales 2300 5500 800 400 4200 1200 Result 2000

11

Participant Kit - Microsoft Excel 2007 Advanced 9 10 =SUMIF(A2:A7,"Vegetables",C2:C7) foods in category. the "Fruits" 12000

Sum of the sales of all foods in the "Vegetables" category. Sum of the sales of all foods that end in "es" (Tomatoes, Oranges, and Apples). Sum of the sales of all foods that do not have a category specified.

11 12

=SUMIF(B2:B7,"*es",C2:C7)

4300

=SUMIF(A2:A7,"",C2:C7)

400

ROUND function The ROUND function rounds a number to a specified number of digits. For example, if cell A1 contains 23.7825, and you want to round that value to two decimal places, you can use the following formula: =ROUND(A1, 2) The result of this function is 23.78. Syntax ROUND(number, num_digits) The ROUND function syntax has the following arguments: number Required. The number that you want to round. num_digits Required. The number of digits to which you want to round the number argument. Remarks If num_digits is greater than 0 (zero), then number is rounded to the specified number of decimal places. If num_digits is 0, the number is rounded to the nearest integer. If num_digits is less than 0, the number is rounded to the left of the decimal point. To always round up (away from zero), use the ROUNDUP function.

12

Participant Kit - Microsoft Excel 2007 Advanced

To always round down (toward zero), use the ROUNDDOWN function. To round a number to a specific multiple (for example, to round to the nearest 0.5), use the MROUND function. Example A 1 2 3 4 5 COUNT function The COUNT function counts the number of cells that contain numbers, and counts numbers within the list of arguments. Use the COUNT function to get the number of entries in a number field that is in a range or array of numbers. For example, you can enter the following formula to count the numbers in the range A1:A20: =COUNT(A1:A20) In this example, if five of the cells in the range contain numbers, the result is 5. Syntax COUNT(value1, [value2], ...) The COUNT function syntax has the following arguments: value1 Required. The first item, cell reference, or range within which you want to count numbers. value2, ... Optional. Up to 255 additional items, cell references, or ranges within which you want to count numbers. Formula =ROUND(2.15, 1) =ROUND(2.149, 1) =ROUND(-1.475, 2) =ROUND(21.5, -1) B Description Rounds 2.15 to one decimal place Rounds 2.149 to one decimal place Rounds -1.475 to two decimal places Rounds 21.5 to one decimal place to the left of the decimal point C Result 2.2 2.1 -1.48 20

13

Participant Kit - Microsoft Excel 2007 Advanced Note: The arguments can contain or refer to a variety of different types of data, but only numbers are counted. Remarks Arguments that are numbers, dates, or a text representation of numbers (for example, a number enclosed in quotation marks, such as "1") are counted. Logical values and text representations of numbers that you type directly into the list of arguments are counted. Arguments that are error values or text that cannot be translated into numbers are not counted. If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are not counted. If you want to count logical values, text, or error values, use the COUNTA function. If you want to count only numbers that meet certain criteria, use the COUNTIF function or the COUNTIFS function. Example A 1 2 3 4 5 6 7 8 9 10 =COUNT(A5:A8) 11 =COUNT(A2:A8,2) 19 22.24 TRUE #DIV/0! Formula =COUNT(A2:A8) Description Counts the number of cells that contain numbers in cells A2 through A8. Counts the number of cells that contain numbers in cells A5 through A8. Counts the number of cells that contain
14

Data Sales 12/8/2008

Result 3 2 4

Participant Kit - Microsoft Excel 2007 Advanced

12

numbers in cells A2 through A8, and the value 2

COUNTA function The COUNTA function counts the number of cells that are not empty in a range. Syntax COUNTA(value1, [value2], ...) The COUNTA function syntax has the following arguments: value1 Required. The first argument representing the values that you want to count. value2, ... Optional. Additional arguments representing the values that you want to count, up to a maximum of 255 arguments. Remarks The COUNTA function counts cells containing any type of information, including error values and empty text (""). For example, if the range contains a formula that returns an empty string, the COUNTA function counts that value. The COUNTA function does not count empty cells. If you do not need to count logical values, text, or error values (in other words, if you want to count only cells that contain numbers), use the COUNT function. If you want to count only cells that meet certain criteria, use the COUNTIF function or the COUNTIFS function. Example A 1 2 3 4 5 19 Data Sales 12/8/2008 B C

15

Participant Kit - Microsoft Excel 2007 Advanced 6 7 8 9 10 22.24 TRUE #DIV/0! Formula =COUNTA(A2:A8) Description Counts the number of nonblank cells in cells A2 through A8. Result 6

COUNTIF function The COUNTIF function counts the number of cells within a range that meet a single criterion that you specify. For example, you can count all the cells that start with a certain letter, or you can count all the cells that contain a number that is larger or smaller than a number you specify. For example, suppose you have a worksheet that contains a list of tasks in column A, and the first name of the person assigned to each task in column B. You can use the COUNTIF function to count how many times a person's name appears in column B and, in that way, determine how many tasks are assigned to that person. For example: =COUNTIF(B2:B25,"Nancy") Note: To count cells based on multiple criteria, see COUNTIFS function. Syntax COUNTIF(range, criteria) The COUNTIF function syntax has the following arguments: range Required. One or more cells to count, including numbers or names, arrays, or references that contain numbers. Blank and text values are ignored. criteria Required. A number, expression, cell reference, or text string that defines which cells will be counted. For example, criteria can be expressed as 32, ">32", B4, "apples", or "32". Notes You can use the wildcard characters the question mark (?) and the asterisk (*) in criteria. A question mark matches any single character, and an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character. Criteria are case insensitive; for example, the string "apples" and the string "APPLES" will match the same cells. Example
16

Participant Kit - Microsoft Excel 2007 Advanced

Example 1: Common COUNTIF formulas A 1 2 3 4 5 6 7 8 9 =COUNTIF(A2:A5,A3)+COUNTIF(A2:A5,A2) 10 11 =COUNTIF(A2:A5,A4) Data apples oranges peaches apples Formula =COUNTIF(A2:A5,"apples") B Data 32 54 75 86 Description Number of cells with apples in cells A2 through A5. Number of cells with peaches in cells A2 through A5. Number of cells with oranges and apples in cells A2 through A5. Number of cells with a value greater than 55 in cells B2 through B5. Number of cells with a value not equal to 75 in cells B2 through B5. Number of cells with a value greater than or equal to 32 and less than or equal to 85 in cells B2 through B5. Result 2 C

=COUNTIF(B2:B5,">55")

12 =COUNTIF(B2:B5,"<>"&B4)

=COUNTIF(B2:B5,">=32")COUNTIF(B2:B5,">85")

Example 2: COUNTIF formulas using wildcard characters and handling blank values

17

Participant Kit - Microsoft Excel 2007 Advanced A 1 2 3 4 5 6 7 8 apples Formula =COUNTIF(A2:A7,"*es") yes Description Number of cells ending with the letters "es" in cells A2 through A7. Number of cells ending with the letters "les" and having exactly 7 letters in cells A2 through A7. Number of cells containing any text in cells A2 through A7. Number of cells not containing text in cells A2 through A7. / The average number of No votes (including blank cells) in cells B2 through B7. The average number of Yes votes (excluding blank cells) in cells B2 through B7. Result 4 oranges peaches NO No Data apples B Data Yes C

9 =COUNTIF(A2:A7,"?????es")

10 =COUNTIF(A2:A7,"*") 11 =COUNTIF(A2:A7,"<>"&"*") 12 =COUNTIF(B2:B7,"No") ROWS(B2:B7) 13 =COUNTIF(B2:B7,"Yes") / (ROWS(B2:B7) -COUNTIF(B2:B7, "<>"&"*")) 14

0.333333333

0.5

PROPER function Capitalizes the first letter in a text string and any other letters in text that follow any character other than a letter.Converts all other letters to lowercase letters.

18

Participant Kit - Microsoft Excel 2007 Advanced

Syntax PROPER(text) The PROPER function syntax has the following arguments: Text Required. Text enclosed in quotation marks, a formula that returns text, or a reference to a cell containing the text you want to partially capitalize. Example A 1 2 3 4 5 6 7 8 Data this is a TITLE 2-cent's worth 76BudGet Formula =PROPER(A2) =PROPER(A3) =PROPER(A4) Description (Result) Proper case of first string (This Is A Title) Proper case of second string (2-Cent'S Worth) Proper case of third string (76Budget) B

UPPER function Converts text to uppercase. Syntax UPPER(text) The UPPER function syntax has the following arguments: Text Required. The text you want converted to uppercase. Text can be a reference or text string. Example A 1 2 Data total
19

Participant Kit - Microsoft Excel 2007 Advanced 3 4 5 6 Yield Formula =UPPER(A2) =UPPER(A3) Description (Result) Upper case of first string (TOTAL) Upper case of second string (YIELD)

LOWER function Converts all uppercase letters in a text string to lowercase. Syntax LOWER(text) The LOWER function syntax has the following arguments: Text Required. The text you want to convert to lowercase. LOWER does not change characters in text that are not letters. Example A 1 2 3 4 5 6 Data E. E. Cummings Apt. 2B Formula =LOWER(A2) =LOWER(A3) Description (Result) Lower case of first string (e. e. cummings) Lower case of last string (apt. 2b) B

CONCATENATE function The CONCATENATE function joins up to 255 text strings into one text string. The joined items can be text, numbers, cell references, or a combination of those items. For example, if your worksheet contains a person's first name in cell A1 and the person's last name in cell B1, you can combine the two values in another cell by using the following formula: =CONCATENATE(A1," ",B1) The second argument in this example (" ") is a space character. You must specify any spaces or punctuation that you want to appear in the results as an argument that is enclosed in quotation marks.

20

Participant Kit - Microsoft Excel 2007 Advanced

Syntax CONCATENATE(text1, [text2], ...) The CONCATENATE function syntax has the following arguments: Text1 Required. The first text item to be concatenated. Text2, ... Optional. Additional text items, up to a maximum of 255 items. The items must be separated by commas. Note You can also use the ampersand (&) calculation operator instead of the CONCATENATE function to join text items. For example, =A1 & B1 returns the same value as =CONCATENATE(A1, B1) Example A 1 2 3 4 5 Data brook trout species 32 Formula =CONCATENATE("Stream population for ", A2, " ", A3, " is ", A4, "/mile") 6 =CONCATENATE(B2, " ", C2) Concatenates the string in cell B2, a space character, and the value in cell C2. Concatenates the string in cell C2, a string consisting of a comma and a space Description Creates a sentence by concatenating the data in column A with other text. Result Stream population for brook trout species is 32/mile Andreas Hauser Hauser, Andreas Andreas Fourth Hauser Pine B C

=CONCATENATE(C2, ", ", B2)

21

Participant Kit - Microsoft Excel 2007 Advanced character, and the value in cell B2. =CONCATENATE(B3, " & ", C3) 8 Concatenates the string in cell B3, a string consisting of a space, an ampersand, another space, and the value in cell C3. Concatenates the same items as the previous example, but by using the ampersand (&) calculation operator instead of the CONCATENATE function. Fourth & Pine

=B3 & " & " & C3

Fourth & Pine

FV function Returns the future value of an investment based on periodic, constant payments and a constant interest rate. Syntax FV(rate,nper,pmt,[pv],[type]) For a more complete description of the arguments in FV and for more information on annuity functions, see PV. The FV function syntax has the following arguments: Rate Required. The interest rate per period. Nper Required. The total number of payment periods in an annuity. Pmt Required. The payment made each period; it cannot change over the life of the annuity. Typically, pmt contains principal and interest but no other fees or taxes. If pmt is omitted, you must include the pv argument. Pv Optional. The present value, or the lump-sum amount that a series of future payments is worth right now. If pv is omitted, it is assumed to be 0 (zero), and you must include the pmt argument. Type Optional. The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0. Set type equal to If payments are due

22

Participant Kit - Microsoft Excel 2007 Advanced

0 1 Remarks

At the end of the period At the beginning of the period

Make sure that you are consistent about the units you use for specifying rate and nper. If you make monthly payments on a four-year loan at 12 percent annual interest, use 12%/12 for rate and 4*12 for nper. If you make annual payments on the same loan, use 12% for rate and 4 for nper. For all the arguments, cash you pay out, such as deposits to savings, is represented by negative numbers; cash you receive, such as dividend checks, is represented by positive numbers. Examples Example 1 A 1 2 3 4 5 6 7 8 Note: Formula =FV(A2/12, A3, A4, A5, A6) Data 6% 10 -200 -500 1 B Description Annual interest rate Number of payments Amount of the payment Present value Payment is due at the beginning of the period (see above) Description (Result) Future value of an investment with the above terms (2581.40)

The annual interest rate is divided by 12 because it is compounded monthly.

Example 2 A 1 2 Data 12% B Description Annual interest rate

23

Participant Kit - Microsoft Excel 2007 Advanced 3 4 5 6 Note: 12 -1000 Formula =FV(A2/12, A4) A3, Number of payments Amount of the payment Description (Result) Future value of an investment with the above terms (12,682.50)

The annual interest rate is divided by 12 because it is compounded monthly.

Example 3 A 1 2 3 4 5 6 7 Note: Formula =FV(A2/12, A3, A4,, A5) Data 11% 35 -2000 1 B Description Annual interest rate Number of payments Amount of the payment Payment is due at the beginning of the year (see above) Description (Result) Future value of an investment with the above terms (82,846.25)

The annual interest rate is divided by 12 because it is compounded monthly.

Example 4 A 1 2 3 4 5 6 7 8 Formula =FV(A2/12, A3, A4, A5, A6) Data 6% 12 -100 -1000 1 B Description Annual interest rate Number of payments Amount of the payment Present value Payment is due at the beginning of the year (see above) Description (Result) Future value of an investment with the above terms (2301.40)

Note: The annual interest rate is divided by 12 because it is compounded monthly.


24

Participant Kit - Microsoft Excel 2007 Advanced

NPV function Calculates the net present value of an investment by using a discount rate and a series of future payments (negative values) and income (positive values). Syntax NPV(rate,value1,[value2],...) The NPV function syntax has the following arguments: Rate Required. The rate of discount over the length of one period. Value1, value2, ... Value1 is required, subsequent values are optional. 1 to 254 arguments representing the payments and income. Value1, value2, ... must be equally spaced in time and occur at the end of each period. NPV uses the order of value1, value2, ... to interpret the order of cash flows. Be sure to enter your payment and income values in the correct sequence. Arguments that are empty cells, logical values, or text representations of numbers, error values, or text that cannot be translated into numbers are ignored. If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are ignored. Remarks The NPV investment begins one period before the date of the value1 cash flow and ends with the last cash flow in the list. The NPV calculation is based on future cash flows. If your first cash flow occurs at the beginning of the first period, the first value must be added to the NPV result, not included in the values arguments. For more information, see the examples below. If n is the number of cash flows in the list of values, the formula for NPV is:

NPV is similar to the PV function (present value). The primary difference between PV and NPV is that PV allows cash flows to begin either at the end or at the beginning of the period.

25

Participant Kit - Microsoft Excel 2007 Advanced Unlike the variable NPV cash flow values, PV cash flows must be constant throughout the investment. For information about annuities and financial functions, see PV. NPV is also related to the IRR function (internal rate of return). IRR is the rate for which NPV equals zero: NPV(IRR(...), ...) = 0. Example 1 A 1 2 3 4 5 6 7 8 Data 10% -10,000 3,000 4,200 6,800 Formula =NPV(A2, A3, A4, A5, A6) B Description Annual discount rate Initial cost of investment one year from today Return from first year Return from second year Return from third year Description (Result) Net present value of this investment (1,188.44)

In the preceding example, you include the initial $10,000 cost as one of the values, because the payment occurs at the end of the first period. Example 2 A 1 2 3 4 5 6 7 8 9 10 -40,000 8,000 9,200 10,000 12,000 14,500 Formula =NPV(A2, A4:A8)+A3 Data 8% B Description Annual discount rate. This might represent the rate of inflation or the interest rate of a competing investment. Initial cost of investment Return from first year Return from second year Return from third year Return from fourth year Return from fifth year Description (Result) Net present value of this investment (1,922.06)

26

Participant Kit - Microsoft Excel 2007 Advanced

11

=NPV(A2, A4:A8, 9000)+A3

Net present value of this investment, with a loss in the sixth year of 9000 (-3,749.47)

In the preceding example, you don't include the initial $40,000 cost as one of the values, because the payment occurs at the beginning of the first period. PMT function Calculates the payment for a loan based on constant payments and a constant interest rate. Syntax PMT(rate, nper, pv, [fv], [type]) Note For a more complete description of the arguments in PMT, see the PV function. The PMT function syntax has the following arguments: Rate Required. The interest rate for the loan. Nper Required. The total number of payments for the loan. Pv Required. The present value, or the total amount that a series of future payments is worth now; also known as the principal. Fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0. Type Optional. The number 0 (zero) or 1 and indicates when payments are due. Set type equal to 0 or omitted 1 Remarks The payment returned by PMT includes principal and interest but no taxes, reserve payments, or fees sometimes associated with loans. Make sure that you are consistent about the units you use for specifying rate and nper. If you make monthly payments on a four-year loan at an annual interest rate of 12 percent, use 12%/12 for rate and 4*12 for nper. If you make annual payments on the same loan, use 12 percent for rate and 4 for nper. If payments are due At the end of the period At the beginning of the period

27

Participant Kit - Microsoft Excel 2007 Advanced Tip To find the total amount paid over the duration of the loan, multiply the returned PMT value by nper.

28

Participant Kit - Microsoft Excel 2007 Advanced

Example 1 A 1 2 3 4 5 6 Data 8% 10 10000 Formula =PMT(A2/12, A3, A4) =PMT(A2/12, A3, A4, 0, 1) 7 Example 2 You can use PMT to determine payments to annuities other than loans. A 1 2 3 4 5 6 Data 6% 18 50,000 Formula =PMT(A2/12, A3*12, 0, A4) B Description Annual interest rate Years you plan on saving Amount you want to have save in 18 years Description (Result) Amount to save each month to have 50,000 at the end of 18 years (-129.08) B Description Annual interest rate Number of months of payments Amount of loan Description (Result) Monthly payment for a loan with the above terms (1,037.03) Monthly payment for a loan with the above terms, except payments are due at the beginning of the period (1,030.16)

Note The interest rate is divided by 12 to get a monthly rate. The number of years the money is paid out is multiplied by 12 to get the number of payments. PV function Description Returns the present value of an investment. The present value is the total amount that a series of future payments is worth now. For example, when you borrow money, the loan amount is the present value to the lender. Syntax
29

Participant Kit - Microsoft Excel 2007 Advanced PV(rate, nper, pmt, [fv], [type]) The PV function syntax has the following arguments: Rate Required. The interest rate per period. For example, if you obtain an automobile loan at a 10 percent annual interest rate and make monthly payments, your interest rate per month is 10%/12, or 0.83%. You would enter 10%/12, or 0.83%, or 0.0083, into the formula as the rate. Nper Required. The total number of payment periods in an annuity. For example, if you get a four-year car loan and make monthly payments, your loan has 4*12 (or 48) periods. You would enter 48 into the formula for nper. Pmt Required. The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. For example, the monthly payments on a $10,000, four-year car loan at 12 percent are $263.33. You would enter -263.33 into the formula as the pmt. If pmt is omitted, you must include the fv argument. Fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). For example, if you want to save $50,000 to pay for a special project in 18 years, then $50,000 is the future value. You could then make a conservative guess at an interest rate and determine how much you must save each month. If fv is omitted, you must include the pmt argument. Type Optional. The number 0 or 1 and indicates when payments are due. Set type equal to 0 or omitted 1 Remarks Make sure that you are consistent about the units you use for specifying rate and nper. If you make monthly payments on a four-year loan at 12 percent annual interest, use 12%/12 for rate and 4*12 for nper. If you make annual payments on the same loan, use 12% for rate and 4 for nper. The following functions apply to annuities: CUMIPMT CUMPRINC FV PPMT PV RATE If payments are due At the end of the period At the beginning of the period

30

Participant Kit - Microsoft Excel 2007 Advanced

FVSCHEDULE IPMT PMT

XIRR XNPV

An annuity is a series of constant cash payments made over a continuous period. For example, a car loan or a mortgage is an annuity. For more information, see the description for each annuity function. In annuity functions, cash you pay out, such as a deposit to savings, is represented by a negative number; cash you receive, such as a dividend check, is represented by a positive number. For example, a $1,000 deposit to the bank would be represented by the argument -1000 if you are the depositor and by the argument 1000 if you are the bank. Microsoft Excel solves for one financial argument in terms of the others. If rate is not 0, then:

If rate is 0, then: (pmt * nper) + pv + fv = 0 Example A 1 2 3 4 5 6 20 Formula =PV(A3/12, 12*A4, A2, , 0) 8% Data 500 B Description Money paid out of an insurance annuity at the end of every month Interest rate earned on the money paid out Years the money will be paid out Description (Result) Present value of an annuity with the terms above (-59,777.15).

The result is negative because it represents money that you would pay, an outgoing cash flow. If you are asked to pay (60,000) for the annuity, you would determine this would not be a good
31

Participant Kit - Microsoft Excel 2007 Advanced investment because the present value of the annuity (59,777.15) is less than what you are asked to pay. Note The interest rate is divided by 12 to get a monthly rate. The years the money is paid out is multiplied by 12 to get the number of payments. RATE function Description Returns the interest rate per period of an annuity. RATE is calculated by iteration and can have zero or more solutions. If the successive results of RATE do not converge to within 0.0000001 after 20 iterations, RATE returns the #NUM! error value. Syntax RATE(nper, pmt, pv, [fv], [type], [guess]) Note For a complete description of the arguments nper, pmt, pv, fv, and type, see PV. The RATE function syntax has the following arguments: Nper Required. The total number of payment periods in an annuity. Pmt Required. The payment made each period and cannot change over the life of the annuity. Typically, pmt includes principal and interest but no other fees or taxes. If pmt is omitted, you must include the fv argument. Pv Required. The present value the total amount that a series of future payments is worth now. Fv Optional. The future value, or a cash balance you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). Type Optional. The number 0 or 1 and indicates when payments are due. Set type equal to 0 or omitted 1 If payments are due At the end of the period At the beginning of the period

Guess Optional. Your guess for what the rate will be. If you omit guess, it is assumed to be 10 percent. If RATE does not converge, try different values for guess. RATE usually converges if guess is between 0 and 1. Remarks
32

Participant Kit - Microsoft Excel 2007 Advanced

Make sure that you are consistent about the units you use for specifying guess and nper. If you make monthly payments on a four-year loan at 12 percent annual interest, use 12%/12 for guess and 4*12 for nper. If you make annual payments on the same loan, use 12% for guess and 4 for nper. Example A 1 2 3 4 5 6 7 Note The number of years of the loan is multiplied by 12 to get the number of months HLOOKUP function Description Searches for a value in the top row of a table or an array of values, and then returns a value in the same column from a row you specify in the table or array. Use HLOOKUP when your comparison values are located in a row across the top of a table of data, and you want to look down a specified number of rows. Use VLOOKUP when your comparison values are located in a column to the left of the data you want to find. The H in HLOOKUP stands for "Horizontal." Syntax HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup]) The HLOOKUP function syntax has the following arguments: Lookup_value Required. The value to be found in the first row of the table. Lookup_value can be a value, a reference, or a text string. Data 4 -200 8000 Formula =RATE(A2*12, A3, A4) =RATE(A2*12, A4)*12 A3, B Description Years of the loan Monthly payment Amount of the loan Description (Result) Monthly rate of the loan with the above terms (1%) Annual rate of the loan with the above terms (0.09241767 or 9.24%)

33

Participant Kit - Microsoft Excel 2007 Advanced Table_array Required. A table of information in which data is looked up. Use a reference to a range or a range name. The values in the first row of table_array can be text, numbers, or logical values. If range_lookup is TRUE, the values in the first row of table_array must be placed in ascending order: ...-2, -1, 0, 1, 2,... , A-Z, FALSE, TRUE; otherwise, HLOOKUP may not give the correct value. If range_lookup is FALSE, table_array does not need to be sorted. Uppercase and lowercase text are equivalent. Sort the values in ascending order, left to right. Row_index_num Required. The row number in table_array from which the matching value will be returned. A row_index_num of 1 returns the first row value in table_array, a row_index_num of 2 returns the second row value in table_array, and so on. If row_index_num is less than 1, HLOOKUP returns the #VALUE! error value; if row_index_num is greater than the number of rows on table_array, HLOOKUP returns the #REF! error value. Range_lookup Optional. A logical value that specifies whether you want HLOOKUP to find an exact match or an approximate match. If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, HLOOKUP will find an exact match. If one is not found, the error value #N/A is returned. Remark If HLOOKUP can't find lookup_value, and range_lookup is TRUE, it uses the largest value that is less than lookup_value. If lookup_value is smaller than the smallest value in the first row of table_array, HLOOKUP returns the #N/A error value. If range_lookup is FALSE and lookup_value is text, you can use the wildcard characters, question mark (?) and asterisk (*), in lookup_value. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character. Example A 1 2 Axles 4 B Bearings 4 C Bolts 9

34

Participant Kit - Microsoft Excel 2007 Advanced

3 4 5

5 6 Formula =HLOOKUP("Axles", A1:C4, 2, TRUE)

7 8 Description (Result) Looks up Axles in row 1, and returns the value from row 2 that's in the same column. (4) Looks up Bearings in row 1, and returns the value from row 3 that's in the same column. (7) Looks up B in row 1, and returns the value from row 3 that's in the same column. Because B is not an exact match, the next largest value that is less than B is used: Axles. (5) Looks up Bolts in row 1, and returns the value from row 4 that's in the same column. (11) Looks up 3 in the first row of the array constant, and returns the value from row 2 in same column. (c)

10 11

6 =HLOOKUP("Bearings", A1:C4, 3, FALSE) 7 =HLOOKUP("B", A1:C4, 3, TRUE)

8 =HLOOKUP("Bolts", A1:C4, 4) 9 =HLOOKUP(3, {1, 2, 3, "a", "b", "c", "d", "e", "f"}, 2, TRUE)

10

VLOOKUP function Description You can use the VLOOKUP function to search the first column of a range of cells, and then return a value from any cell on the same row of the range. For example, suppose that you have a list of employees contained in the range A2:C10. The employees' ID numbers are stored in the first column of the range, as shown in the following illustration.

35

Participant Kit - Microsoft Excel 2007 Advanced

Figure 2 If you know the employee's ID number, you can use the VLOOKUP function to return either the department or the name of that employee. To obtain the name of employee number 38, you can use the formula =VLOOKUP(38, A2:C10, 3, FALSE). This formula searches for the value 38 in the first column of the range A2:C10, and then returns the value that is contained in the third column of the range and on the same row as the lookup value ("Axel Delgado"). The V in VLOOKUP stands for vertical. Use VLOOKUP instead of HLOOKUP when your comparison values are located in a column to the left of the data that you want to find. Syntax VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]) The VLOOKUP function syntax has the following arguments: lookup_value Required. The value to search in the first column of the table or range. The lookup_value argument can be a value or a reference. If the value you supply for the lookup_value argument is smaller than the smallest value in the first column of the table_array argument, VLOOKUP returns the #N/A error value. table_array Required. The range of cells that contains the data. You can use a reference to a range (for example, A2:D8), or a range name. The values in the first column of table_array are the values searched by lookup_value. These values can be text, numbers, or logical values. Uppercase and lowercase text are equivalent. col_index_num Required. The column number in the table_array argument from which the matching value must be returned. A col_index_num argument of 1 returns the value in the first column in table_array; a col_index_num of 2 returns the value in the second column in table_array, and so on. If the col_index_num argument is:

36

Participant Kit - Microsoft Excel 2007 Advanced

Less than 1, VLOOKUP returns the #VALUE! error value. Greater than the number of columns in table_array, VLOOKUP returns the #REF! error value. range_lookup Optional. A logical value that specifies whether you want VLOOKUP to find an exact match or an approximate match: If range_lookup is either TRUE or is omitted, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned. Important Ifrange_lookup is either TRUE or is omitted, the values in the first column of table_array must be placed in ascending sort order; otherwise, VLOOKUP might not return the correct value. For more information, see Sort data in a range or table. If range_lookup is FALSE, the values in the first column of table_array do not need to be sorted. If the range_lookup argument is FALSE, VLOOKUP will find only an exact match. If there are two or more values in the first column of table_array that match the lookup_value, the first value found is used. If an exact match is not found, the error value #N/A is returned. Remarks When searching text values in the first column of table_array, ensure that the data in the first column of table_array does not contain leading spaces, trailing spaces, inconsistent use of straight ( ' or " ) and curly ( or ) quotation marks, or nonprinting characters. In these cases, VLOOKUP might return an incorrect or unexpected value. For more information, see CLEAN function and TRIM function. When searching number or date values, ensure that the data in the first column of table_array is not stored as text values. In this case, VLOOKUP might return an incorrect or unexpected value. If range_lookup is FALSE and lookup_value is text, you can use the wildcard characters the question mark (?) and asterisk (*) in lookup_value. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the character.

37

Participant Kit - Microsoft Excel 2007 Advanced Example 1 This example searches the Density column of an atmospheric properties table to find corresponding values in the Viscosity and Temperature columns. (The values are for air at 0 degrees Celsius at sea level, or 1 atmosphere.) A 1 2 3 4 5 6 7 8 9 10 11 Density 0.457 0.525 0.606 0.675 0.746 0.835 0.946 1.09 1.29 Formula =VLOOKUP(1,A2:C10,2) B Viscosity 3.55 3.25 2.93 2.75 2.57 2.38 2.17 1.95 1.71 Description Using an approximate match, searches for the value 1 in column A, finds the largest value less than or equal to 1 in column A which is 0.946, and then returns the value from column B in the same row. Using an approximate match, searches for the value 1 in column A, finds the largest value less than or equal to 1 in column A, which is 0.946, and then returns the value from column C in the same row. Using an exact match, searches for the value
38

C Temperature 500 400 300 250 200 150 100 50 0 Result 2.17

12

=VLOOKUP(1,A2:C10,3,TRUE)

100

13

14 =VLOOKUP(0.7,A2:C10,3,FALSE)

#N/A

Participant Kit - Microsoft Excel 2007 Advanced

15 =VLOOKUP(0.1,A2:C10,2,TRUE)

0.7 in column A. Because there is no exact match in column A, an error is returned. Using an approximate match, searches for the value 0.1 in column A. Because 0.1 is less than the smallest value in column A, an error is returned. Using an approximate match, searches for the value 2 in column A, finds the largest value less than or equal to 2 in column A, which is 1.29, and then returns the value from column B in the same row. #N/A

16 =VLOOKUP(2,A2:C10,2,TRUE)

1.71

Example 2 This example searches the Item-ID column of a baby products table and matches values in the Cost and Markup columns to calculate prices and test conditions. A 1 2 3 4 5 6 7 Item-ID ST-340 BI-567 DI-328 WI-989 AS-469 Formula = VLOOKUP("DI-328", A2:D6, 3, FALSE) * (1 + VLOOKUP("DI-328", B Item Stroller Bib Diapers Wipes Aspirator Description Calculates the retail price of diapers by adding the markup percentage to the cost. C Cost $145.67 $3.56 $21.45 $5.12 $2.56 D Markup 30% 40% 35% 40% 45% Result $28.96

39

Participant Kit - Microsoft Excel 2007 Advanced 8 A2:D6, 4, FALSE)) = (VLOOKUP("WI-989", A2:D6, 3, FALSE) * (1 + VLOOKUP("WI-989", A2:D6, 4, FALSE))) * (1 20%) = IF(VLOOKUP(A2, A2:D6, 3, FALSE) >= 20, "Markup is " & 100 * VLOOKUP(A2, A2:D6, 4, FALSE) &"%", "Cost is under $20.00") 10 = IF(VLOOKUP(A3, A2:D6, 3, FALSE) >= 20, "Markup is: " & 100 * VLOOKUP(A3, A2:D6, 4, FALSE) &"%", "Cost is $" & VLOOKUP(A3, A2:D6, 3, FALSE)) Calculates the sale price of wipes by subtracting a specified discount from the retail price. $5.73

If the cost of an item is greater than or equal to $20.00, displays the string "Markup is nn%"; otherwise, displays the string "Cost is under $20.00". If the cost of an item is greater than or equal to $20.00, displays the string Markup is nn%"; otherwise, displays the string "Cost is $n.nn".

Markup is 30%

Cost is $3.56

11 Example 3 This example searches the ID column of an employee table and matches values in other columns to calculate ages and test for error conditions. A ID 1 1 2 3 2 4 5 6 Fonta na Olivier B Last name Davis C First name Sara D Title Sal es Rep . V.P. of Sal es Sal es Rep . E Birth date 12/8/19 68

2/19/19 52

Leal

Karin a

8/30/19 63

40

Participant Kit - Microsoft Excel 2007 Advanced

7 8

Patte n

Micha el

Sal es Rep . Sal es Mgr . Sal es Rep .

9/19/19 58

Burke

Brian

3/4/195 5

Sousa

Luis

7/2/196 3

Formula =INT(YEARFRAC(DATE(2004,6,3 0), VLOOKUP(5,A2:E7,5, FALSE), 1)) 1 0

Description For the fiscal year 2004, finds the age of the employee with ID equal to 5. Uses the YEARFRAC function to subtract the birth date from the fiscal year end date and displays the result as an integer using the INT function. If there is an employee with an ID of 5, displays the employee's last name; otherwise, displays the message "Employee not found". The ISNA function returns a TRUE value when the VLOOKUP function returns the #NA error value. If there is an employee with an ID of 15, displays the employee's last name; otherwise, displays the message "Employee not found". The ISNA function returns a
41

Result 49

=IF(ISNA(VLOOKUP(5,A2:E7,2,FA LSE)) = TRUE, "Employee not found", VLOOKUP(5,A2:E7,2,FALSE)) 1 1

Burke

1 2

=IF(ISNA(VLOOKUP(15,A3:E8,2,F ALSE)) = TRUE, "Employee not found", VLOOKUP(15,A3:E8,2,FALSE))

Employe e not found

Participant Kit - Microsoft Excel 2007 Advanced TRUE value when the VLOOKUP function returns the #NA error value. =VLOOKUP(4,A2:E7,3,FALSE) & " " & VLOOKUP(4,A2:E7,2,FALSE) & " is a " & VLOOKUP(4,A2:E7,4,FALSE) IF function Description The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that condition evaluates to FALSE. For example, the formula =IF(A1>10,"Over 10","10 or less") returns "Over 10" if A1 is greater than 10, and "10 or less" if A1 is less than or equal to 10. Syntax IF(logical_test, [value_if_true], [value_if_false]) The IF function syntax has the following arguments: logical_test Required. Any value or expression that can be evaluated to TRUE or FALSE. For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100, the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE. This argument can use any comparison calculation operator. value_if_true Optional. The value that you want to be returned if the logical_test argument evaluates to TRUE. For example, if the value of this argument is the text string "Within budget" and the logical_test argument evaluates to TRUE, the IF function returns the text "Within budget." If logical_test evaluates to TRUE and the value_if_true argument is omitted (that is, there is only a comma following the logical_test argument), the IF function returns 0 (zero). To display the word TRUE, use the logical value TRUE for the value_if_true argument. value_if_false Optional. The value that you want to be returned if the logical_test argument evaluates to FALSE. For example, if the value of this argument is the text string "Over budget" and the logical_test argument evaluates to FALSE, the IF function returns the text "Over budget." If logical_test evaluates to FALSE and the value_if_false argument is omitted, (that is, there is no comma following the value_if_true argument), the IF function returns the logical value FALSE. If logical_test evaluates to FALSE and the value of the value_if_false argument is omitted (that is, in the IF function, there is no comma following the value_if_true argument), the IF function returns the value 0 (zero). Remarks
42

For the employee with an ID of 4, concatenates the values of three cells into a complete sentence.

Michael Patten is a Sales Rep.

Participant Kit - Microsoft Excel 2007 Advanced

Up to 64 IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests. (See Example 3 for a sample of nested IF functions.) Alternatively, to test many conditions, consider using the LOOKUP, VLOOKUP, HLOOKUP, or CHOOSE functions. (See Example 4 for a sample of the LOOKUP function.) If any of the arguments to IF are arrays, every element of the array is evaluated when the IF statement is carried out. Excel provides additional functions that can be used to analyze your data based on a condition. For example, to count the number of occurrences of a string of text or a number within a range of cells, use the COUNTIF or the COUNTIFS worksheet functions. To calculate a sum based on a string of text or a number within a range, use the SUMIF or the SUMIFS worksheet functions. Example 1 A 1 2 3 Data 50 Formula =IF(A2<=100,"Within budget","Over budget") 4 =IF(A2=100,A2+B2,"") 23 Description If the number in cell A2 is less than or equal to 100, the formula returns "Within budget." Otherwise, the function displays "Over budget." If the number in cell A2 is equal to 100, A2 + B2 is calculated and returned. Otherwise, empty text ("") is returned. Result Within budget B C

Empty text ("")

5 Example 2 A 1 2 3 4 5 Actual Expenses 1500 500 500 Formula B

Predicted Expenses 900 900 925 Description Result

43

Participant Kit - Microsoft Excel 2007 Advanced =IF(A2>B2,"Over Budget","OK") =IF(A3>B3,"Over Budget","OK") Checks whether the expenses in row 2 are over budget Checks whether the expenses in row 3 are over budget Over Budget OK

6 7 Example 3

A 1 2 3 4 5 6 7 8 Score 45 90 78 Formula =IF(A2>89,"A",IF(A2>79,"B", IF(A2>69,"C",IF(A2>59,"D","F")))) =IF(A3>89,"A",IF(A3>79,"B", IF(A3>69,"C",IF(A3>59,"D","F")))) =IF(A4>89,"A",IF(A4>79,"B", IF(A4>69,"C",IF(A4>59,"D","F"))))

Description Assigns a letter grade to the score in cell A2 Assigns a letter grade to the score in cell A3 Assigns a letter grade to the score in cell A4

Result F A C

The preceding example demonstrates how you can nest IF statements. In each formula, the fourth IF statement is also the value_if_false argument to the third IF statement. Similarly, the third IF statement is the value_if_false argument to the second IF statement, and the second IF statement is the value_if_false argument to the first IF statement. For example, if the first logical_test argument (Average>89) evaluates to TRUE, "A" is returned. If the first logical_test argument evaluates to FALSE, the second IF statement is evaluated, and so on. You can also use other functions as arguments. The letter grades are assigned to numbers, using the following key. If Score is Greater than 89 From 80 to 89 From 70 to 79 From 60 to 69 Less than 60 Then return A B C D F

44

Participant Kit - Microsoft Excel 2007 Advanced

Example 4 In this example, the LOOKUP function is used instead of the IF function because there are thirteen conditions to test. You may find the LOOKUP function easier to read and maintain than the IF function. A 1 2 3 4 5 Score 45 90 78 Formula =LOOKUP(A2,{0,60,63,67,70,73,77,80,83,87,90,93,97}, {"F","D-","D","D+","C-","C","C+","B-","B","B+","A","A","A+"}) Descripti on Assigns a letter grade to the score in cell A2 Assigns a letter grade to the score in cell A3 Assigns a letter grade to the score in cell A4 Resu lt F B C

7 =LOOKUP(A3,{0,60,63,67,70,73,77,80,83,87,90,93,97}, {"F","D-","D","D+","C-","C","C+","B-","B","B+","A","A","A+"})

A-

=LOOKUP(A4,{0,60,63,67,70,73,77,80,83,87,90,93,97}, {"F","D-","D","D+","C-","C","C+","B-","B","B+","A","A","A+"})

C+

AND function This article describes the formula syntax and usage of the ANDfunction in Microsoft Excel. Description Returns TRUE if all its arguments evaluate to TRUE; returns FALSE if one or more arguments evaluate to FALSE. One common use for the AND function is to expand the usefulness of other functions that perform logical tests. For example, the IF function performs a logical test and then returns one
45

Participant Kit - Microsoft Excel 2007 Advanced value if the test evaluates to TRUE and another value if the test evaluates to FALSE. By using the AND function as thelogical_test argument of the IF function, you can test many different conditions instead of just one. Syntax AND(logical1, [logical2], ...) The AND function syntax has the following arguments:
1. logical1 Required. The first condition that you want to test that can evaluate to either TRUE

or FALSE.
2. logical2, ... Optional. Additional conditions that you want to test that can evaluate to either

TRUE or FALSE, up to a maximum of 255 conditions. Remarks The arguments must evaluate to logical values, such as TRUE or FALSE, or the arguments must be arrays or references that contain logical values. If an array or reference argument contains text or empty cells, those values are ignored. If the specified range contains no logical values, the AND function returns the #VALUE! error value. Example 1 The example may be easier to understand if you copy it to a blank worksheet. A 1 2 3 4 Example 2 A 1 2 3 Data 50 104 B C Formula =AND(TRUE, TRUE) =AND(TRUE, FALSE) =AND(2+2=4, 2+3=5) B Description All arguments are TRUE One argument is FALSE All arguments evaluate to TRUE C Result TRUE FALSE TRUE

46

Participant Kit - Microsoft Excel 2007 Advanced

Formula =AND(1<A2, A2<100)

Description Displays TRUE if the number in cell A2 is between 1 and 100. Otherwise, it displays FALSE. Displays the number in cell A3, if it is between 1 and 100. Otherwise, it displays the message "The value is out of range." Displays the number in cell A2, if it is between 1 and 100. Otherwise, it displays a message.

Result TRUE

5 =IF(AND(1<A3, A3<100), A3, "The value is out of range.") 6 =IF(AND(1<A2, A2<100), A2, "The value is out of range.")

The value is out of range. 50

OR function This article describes the formula syntax and usage of the ORfunction in Microsoft Excel. Description Returns TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE. Syntax OR(logical1, [logical2], ...) The OR function syntax has the following arguments: Logical1, logical2, ... Logical1 is required, subsequent logical values are optional. 1 to 255 conditions you want to test that can be either TRUE or FALSE. Remarks The arguments must evaluate to logical values such as TRUE or FALSE, or in arrays or references that contain logical values. If an array or reference argument contains text or empty cells, those values are ignored. If the specified range contains no logical values, OR returns the #VALUE! error value. You can use an OR array formula to see if a value occurs in an array. To enter an array formula, press CTRL+SHIFT+ENTER.
47

Participant Kit - Microsoft Excel 2007 Advanced Example A 1 2 3 4 Formula =OR(TRUE) =OR(1+1=1,2+2=5) =OR(TRUE,FALSE,TRUE) B Description (Result) One argument is TRUE (TRUE) All arguments evaluate to FALSE (FALSE) At least one argument is TRUE (TRUE)

ISERROR IS functions This article describes the formula syntax and usage of the ISfunctions in Microsoft Excel. Description Each of these functions, referred to collectively as the IS functions, checks the specified value and returns TRUE or FALSE depending on the outcome. For example, the ISBLANK function returns the logical value TRUE if the value argument is a reference to an empty cell; otherwise it returns FALSE. You can use an IS function to get information about a value before performing a calculation or other action with it. For example, you can use the ISERROR function in conjunction with the IF function to perform a different action if an error occurs: =IF(ISERROR(A1), "An error occurred.", A1 * 2) This formula checks to see if an error condition exists in A1. If so, the IF function returns the message "An error occurred." If no error exists, the IF function performs the calculation A1*2. Syntax ISBLANK(value) ISERR(value) ISERROR(value) ISLOGICAL(value) ISNA(value) ISNONTEXT(value)

48

Participant Kit - Microsoft Excel 2007 Advanced

ISNUMBER(value) ISREF(value) ISTEXT(value) The IS function syntax has the following argument: value Required. The value that you want tested. The value argument can be a blank (empty cell), error, logical value, text, number, or reference value, or a name referring to any of these. Function ISBLANK ISERR ISERROR ISLOGICAL ISNA ISNONTEXT ISNUMBER ISREF ISTEXT Remarks The value arguments of the IS functions are not converted. Any numeric values that are enclosed in double quotation marks are treated as text. For example, in most other functions where a number is required, the text value "19" is converted to the number 19. However, in the formula ISNUMBER("19"), "19" is not converted from a text value to a number value, and the ISNUMBER function returns FALSE. The IS functions are useful in formulas for testing the outcome of a calculation. When combined with the IF function, these functions provide a method for locating errors in formulas (see the following examples). Returns TRUE if Value refers to an empty cell. Value refers to any error value except #N/A. Value refers to any error value (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!). Value refers to a logical value. Value refers to the #N/A (value not available) error value. Value refers to any item that is not text. (Note that this function returns TRUE if the value refers to a blank cell.) Value refers to a number. Value refers to a reference. Value refers to text.

49

Participant Kit - Microsoft Excel 2007 Advanced Example 1 A 1 2 3 4 5 6 Example 2 A 1 2 3 4 5 6 7 8 9 =ISNA(A4) 10 =ISNA(A6) 11 =ISERR(A6) 12 =ISNUMBER(A5) 13 =ISTEXT(A3) 14 Data Gold Region1 #REF! 330.92 #N/A Formula =ISBLANK(A2) =ISERROR(A4) Description Checks whether cell A2 is blank. Checks whether the value in cell A4, #REF!, is an error. Checks whether the value in cell A4, #REF!, is the #N/A error. Checks whether the value in cell A6, #N/A, is the #N/A error. Checks whether the value in cell A6, #N/A, is an error. Checks whether the value in cell A5, 330.92, is a number. Checks whether the value in cell A3, Region1, is text. Result FALSE TRUE FALSE TRUE FALSE TRUE TRUE B C Formula =ISLOGICAL(TRUE) =ISLOGICAL("TRUE") =ISNUMBER(4) =ISREF(G8) =ISREF(XYZ1) B Description Checks whether TRUE is a logical value Checks whether "TRUE" is a logical value Checks whether 4 is a number Checks whether G8 is a valid reference Checks whether XYZ1 is a valid reference C Result TRUE FALSE TRUE TRUE FALSE

50

Participant Kit - Microsoft Excel 2007 Advanced

DSUM function Description Adds the numbers in a field (column) of records in a list or database that match conditions that you specify. Syntax DSUM(database, field, criteria) The DSUM function syntax has the following arguments: Database Required. The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. Field Required. Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. Criteria Required. Is the range of cells that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. Remarks You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount $10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions. Although the criteria range can be located anywhere on the worksheet, do not place the criteria range below the list. If you add more information to the list, the new information is added to the first row below the list. If the row below the list is not blank, Microsoft Excel cannot add the new information. Make sure that the criteria range does not overlap the list. To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.
51

Participant Kit - Microsoft Excel 2007 Advanced

52

Participant Kit - Microsoft Excel 2007 Advanced

Examples A 1 2 3 4 5 6 7 8 9 10 11 Tree ="=Apple" ="=Pear" Tree Apple Pear Cherry Apple Pear Apple Formula =DSUM(A4:E10, "Profit", A1:A2) Height 18 12 13 14 9 8 Description (Result) The profit apple (225) total from trees. Age 20 12 14 15 8 9 Yield 14 10 9 10 8 6 Profit 105.00 96.00 105.00 75.00 76.80 45.00 B Height >10 C Age D Yield E Profit F Height <16

12

13

=DSUM(A4:E10, "Profit", A1:F2)

The total profit from apple trees with a height between 10 and 16. (75)

Criteria examples Important Because the equal sign is used to indicate a formula when you type text or a value in a cell, Microsoft Excel evaluates what you type; however, this may cause unexpected filter results. To indicate an equality comparison operator for either text or a value, type the criteria as a string expression in the appropriate cell in the criteria range: =''=entry'' Where entry is the text or value you want to find. For example:
53

Participant Kit - Microsoft Excel 2007 Advanced What you type in the cell ="=Davolio" ="=3000" What Excel evaluates and displays =Davolio =3000

When filtering text data, Excel does not distinguish between uppercase and lowercase characters. However, you can use a formula to perform a case-sensitive search. The following sections provide examples of complex criteria. Multiple criteria in one column Boolean logic: (Salesperson = "Davolio" OR Salesperson = "Buchanan") To find rows that meet multiple criteria for one column, type the criteria directly below each other in separate rows of the criteria range. In the following data range (A6:C10), the criteria range (B1:B3) displays the rows that contain either "Davolio" or "Buchanan" in the Salesperson column (A8:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson =Davolio =Buchanan C Sales

Multiple criteria in multiple columns where all criteria must be true Boolean logic: (Type = "Produce" AND Sales > 1000) To find rows that meet multiple criteria in multiple columns, type all of the criteria in the same row of the criteria range. In the following data range (A6:C10), the criteria range (A1:C2) displays all rows that contain "Produce" in the Type column and a value greater than $1,000 in the Sales column (A9:C10).

54

Participant Kit - Microsoft Excel 2007 Advanced

A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Type =Produce

B Salesperson

C Sales >1000

Salesperson Suyama Davolio Buchanan Davolio

Sales $5122 $450 $6328 $6544

Multiple criteria in multiple columns where any criteria can be true Boolean logic: (Type = "Produce" OR Salesperson = "Davolio") To find rows that meet multiple criteria in multiple columns, where any criteria can be true, type the criteria in different rows of the criteria range. In the following data range (A6:C10), the criteria range (A1:B3) displays all rows that contain "Produce" in the Type column or "Davolio" in the Salesperson column (A8:C10). A 1 2 3 4 5 6 7 8 9 Type Beverages Meat produce Salesperson Suyama Davolio Buchanan Sales $5122 $450 $6328 Type =Produce =Davolio B Salesperson C Sales

55

Participant Kit - Microsoft Excel 2007 Advanced 10 Produce Davolio $6544

Multiple sets of criteria where each set includes criteria for multiple columns Boolean logic: ( (Salesperson = "Davolio" AND Sales >3000) OR (Salesperson = "Buchanan" AND Sales > 1500) ) To find rows that meet multiple sets of criteria, where each set includes criteria for multiple columns, type each set of criteria in separate rows. In the following data range (A6:C10), the criteria range (B1:C3) displays the rows that contain both "Davolio" in the Salesperson column and a value greater than $3,000 in the Sales column, or displays the rows that contain "Buchanan" in the Salesperson and a value greater than $1,500 in the Sales column (A9:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson =Davolio =Buchanan C Sales >3000 >1500

Multiple sets of criteria where each set includes criteria for one column Boolean logic: ( (Sales > 6000 AND Sales < 6500 ) OR (Sales < 500) ) To find rows that meet multiple sets of criteria, where each set includes criteria for one column, include multiple columns with the same column heading. In the following data range (A6:C10), the criteria range (C1:D3) displays rows that contain values between 6,000 and 6,500 and values less than 500 in the Sales column (A8:C10). A 1 2 Type B Salesperson C Sales >6000 D Sales <6500

56

Participant Kit - Microsoft Excel 2007 Advanced

3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio

<500

Sales $5122 $450 $6328 $6544

Criteria to find text values that share some characters but not others To find text values that share some characters but not others, do one or more of the following: Type one or more characters without an equal sign (=) to find rows with a text value in a column that begin with those characters. For example, if you type the text Dav as a criterion, Excel finds "Davolio," "David," and "Davis." Use a wildcard character. The following wildcard characters can be used as comparison criteria. Use ? (question mark) * (asterisk) ~ (tilde) followed by ?, *, or ~ To find Any single character For example, sm?th finds "smith" and "smyth" Any number of characters For example, *east finds "Northeast" and "Southeast" A question mark, asterisk, For example, fy91~? finds "fy91?" or tilde

In the following data range (A6:C10), the criteria range (A1:B3) displays rows with "Me" as the first characters in the Type column or rows with the second character equal to "u" in the Salesperson column (A7:C9). A 1 2 3 Type Me =?u* B Salesperson C Sales

57

Participant Kit - Microsoft Excel 2007 Advanced 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544

Criteria created as the result of a formula You can use a calculated value that is the result of a formula as your criterion. Remember the following important points: The formula must evaluate to TRUE or FALSE. Because you are using a formula, enter the formula as you normally would, and do not type the expression in the following way: =''=entry'' Do not use a column label for criteria labels; either keep the criteria labels blank or use a label that is not a column label in the range (in the examples below, Calculated Average and Exact Match). If you use a column label in the formula instead of a relative cell reference or a range name, Excel displays an error value such as #NAME? or #VALUE! in the cell that contains the criterion. You can ignore this error because it does not affect how the range is filtered. The formula that you use for criteria must use a relative reference to refer to the corresponding cell in the first row (in the examples below, C7 and A7). All other references in the formula must be absolute references. The following subsections provide specific examples of criteria created as the result of a formula. Filtering for values greater than the average of all values in the data range In the following data range (A6:D10), the criteria range (D1:D2) displays rows that have a value in the Sales column greater than the average of all the Sales values (C7:C10). In the formula, "C7" refers to the filtered column (C) of the first row of the data range (7).

58

Participant Kit - Microsoft Excel 2007 Advanced

A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Type

B Salesperson

C Sales

D Calculated Average =C7>AVERAGE($C$7:$C$10)

Salesperson Suyama Davolio Buchanan Davolio

Sales $5122 $450 $6328 $6544

Filtering for text by using a case-sensitive search In the data range (A6:D10), the criteria range (D1:D2) displays rows that contain "Produce" in the Type column by using the EXACT function to perform a case-sensitive search (A10:C10). In the formula, "A7" refers to the filtered column (A) of the first row of the data range (7). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson C Sales D Exact Match =EXACT(A7, "Produce")

DMIN function This article describes the formula syntax and usage of the DMINfunction in Microsoft Excel.
59

Participant Kit - Microsoft Excel 2007 Advanced Description Returns the smallest number in a field (column) of records in a list or database that matches conditions that you specify. Syntax DMIN(database, field, criteria) The DMIN function syntax has the following arguments: Database Required. The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. Field Required. Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. Criteria Required. The range of cells that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. Remarks You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount $10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions. Although the criteria range can be located anywhere on the worksheet, do not place the criteria range below the list. If you add more information to the list, the new information is added to the first row below the list. If the row below the list is not blank, Microsoft Excel cannot add the new information. Make sure that the criteria range does not overlap the list. To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

60

Participant Kit - Microsoft Excel 2007 Advanced

Examples A 1 2 3 4 5 6 7 8 9 10 11 Tree ="=Apple" ="=Pear" Tree Apple Pear Cherry Apple Pear Apple Formula =DMIN(A4:E10, "Profit", A1:B2) Height 18 12 13 14 9 8 Description (Result) The minimum profit of apple trees over 10 in height. (75) Age 20 12 14 15 8 9 Yield 14 10 9 10 8 6 Profit 105.00 96.00 105.00 75.00 76.80 45.00 B Height >10 C Age D Yield E Profit F Height <16

12

Criteria examples Important Because the equal sign is used to indicate a formula when you type text or a value in a cell, Microsoft Excel evaluates what you type; however, this may cause unexpected filter results. To indicate an equality comparison operator for either text or a value, type the criteria as a string expression in the appropriate cell in the criteria range: =''=entry'' Where entry is the text or value you want to find. For example: What you type in the cell ="=Davolio" ="=3000" What Excel evaluates and displays =Davolio =3000

61

Participant Kit - Microsoft Excel 2007 Advanced When filtering text data, Excel does not distinguish between uppercase and lowercase characters. However, you can use a formula to perform a case-sensitive search. The following sections provide examples of complex criteria. Multiple criteria in one column Boolean logic: (Salesperson = "Davolio" OR Salesperson = "Buchanan") To find rows that meet multiple criteria for one column, type the criteria directly below each other in separate rows of the criteria range. In the following data range (A6:C10), the criteria range (B1:B3) displays the rows that contain either "Davolio" or "Buchanan" in the Salesperson column (A8:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson =Davolio =Buchanan C Sales

Multiple criteria in multiple columns where all criteria must be true Boolean logic: (Type = "Produce" AND Sales > 1000) To find rows that meet multiple criteria in multiple columns, type all of the criteria in the same row of the criteria range. In the following data range (A6:C10), the criteria range (A1:C2) displays all rows that contain "Produce" in the Type column and a value greater than $1,000 in the Sales column (A9:C10). A 1 2 3 Type =Produce B Salesperson C Sales >1000

62

Participant Kit - Microsoft Excel 2007 Advanced

4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544

Multiple criteria in multiple columns where any criteria can be true Boolean logic: (Type = "Produce" OR Salesperson = "Davolio") To find rows that meet multiple criteria in multiple columns, where any criteria can be true, type the criteria in different rows of the criteria range. In the following data range (A6:C10), the criteria range (A1:B3) displays all rows that contain "Produce" in the Type column or "Davolio" in the Salesperson column (A8:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type =Produce =Davolio B Salesperson C Sales

Multiple sets of criteria where each set includes criteria for multiple columns Boolean logic: ( (Salesperson = "Davolio" AND Sales >3000) OR (Salesperson = "Buchanan" AND Sales > 1500) ) To find rows that meet multiple sets of criteria, where each set includes criteria for multiple columns, type each set of criteria in separate rows.
63

Participant Kit - Microsoft Excel 2007 Advanced In the following data range (A6:C10), the criteria range (B1:C3) displays the rows that contain both "Davolio" in the Salesperson column and a value greater than $3,000 in the Sales column, or displays the rows that contain "Buchanan" in the Salesperson and a value greater than $1,500 in the Sales column (A9:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson =Davolio =Buchanan C Sales >3000 >1500

Multiple sets of criteria where each set includes criteria for one column Boolean logic: ( (Sales > 6000 AND Sales < 6500 ) OR (Sales < 500) ) To find rows that meet multiple sets of criteria, where each set includes criteria for one column, include multiple columns with the same column heading. In the following data range (A6:C10), the criteria range (C1:D3) displays rows that contain values between 6,000 and 6,500 and values less than 500 in the Sales column (A8:C10). A 1 2 3 4 5 6 7 8 9 Type Beverages Meat produce Salesperson Suyama Davolio Buchanan
64

B Salesperson

C Sales >6000 <500

D Sales <6500

Type

Sales $5122 $450 $6328

Participant Kit - Microsoft Excel 2007 Advanced

10

Produce

Davolio

$6544

Criteria to find text values that share some characters but not others To find text values that share some characters but not others, do one or more of the following: Type one or more characters without an equal sign (=) to find rows with a text value in a column that begin with those characters. For example, if you type the text Dav as a criterion, Excel finds "Davolio," "David," and "Davis." Use a wildcard character. The following wildcard characters can be used as comparison criteria. Use ? (question mark) * (asterisk) ~ (tilde) followed by ?, *, or ~ To find Any single character For example, sm?th finds "smith" and "smyth" Any number of characters For example, *east finds "Northeast" and "Southeast" A question mark, asterisk, For example, fy91~? finds "fy91?" or tilde

In the following data range (A6:C10), the criteria range (A1:B3) displays rows with "Me" as the first characters in the Type column or rows with the second character equal to "u" in the Salesperson column (A7:C9). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type Me =?u* B Salesperson C Sales

65

Participant Kit - Microsoft Excel 2007 Advanced

66

Participant Kit - Microsoft Excel 2007 Advanced

Criteria created as the result of a formula You can use a calculated value that is the result of a formula as your criterion. Remember the following important points: The formula must evaluate to TRUE or FALSE. Because you are using a formula, enter the formula as you normally would, and do not type the expression in the following way: =''=entry'' Do not use a column label for criteria labels; either keep the criteria labels blank or use a label that is not a column label in the range (in the examples below, Calculated Average and Exact Match). If you use a column label in the formula instead of a relative cell reference or a range name, Excel displays an error value such as #NAME? or #VALUE! in the cell that contains the criterion. You can ignore this error because it does not affect how the range is filtered. The formula that you use for criteria must use a relative reference to refer to the corresponding cell in the first row (in the examples below, C7 and A7). All other references in the formula must be absolute references. The following subsections provide specific examples of criteria created as the result of a formula. Filtering for values greater than the average of all values in the data range In the following data range (A6:D10), the criteria range (D1:D2) displays rows that have a value in the Sales column greater than the average of all the Sales values (C7:C10). In the formula, "C7" refers to the filtered column (C) of the first row of the data range (7). A 1 2 3 4 5 6 Type Salesperson Sales
67

B Salesperson

C Sales

D Calculated Average =C7>AVERAGE($C$7:$C$10)

Type

Participant Kit - Microsoft Excel 2007 Advanced 7 8 9 10 Beverages Meat produce Produce Suyama Davolio Buchanan Davolio $5122 $450 $6328 $6544

Filtering for text by using a case-sensitive search In the data range (A6:D10), the criteria range (D1:D2) displays rows that contain "Produce" in the Type column by using the EXACT function to perform a case-sensitive search (A10:C10). In the formula, "A7" refers to the filtered column (A) of the first row of the data range (7). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson C Sales D Exact Match =EXACT(A7, "Produce")

DMAX function This article describes the formula syntax and usage of the DMAXfunction in Microsoft Excel. Description Returns the largest number in a field (column) of records in a list or database that matches conditions you that specify. Syntax DMAX(database, field, criteria) The DMAX function syntax has the following arguments: Database Required. The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.
68

Participant Kit - Microsoft Excel 2007 Advanced

Field Required. Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. Criteria Required. The range of cells that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. Remarks You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount $10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions. Although the criteria range can be located anywhere on the worksheet, do not place the criteria range below the list. If you add more information to the list, the new information is added to the first row below the list. If the row below the list is not blank, Microsoft Excel cannot add the new information. Make sure that the criteria range does not overlap the list. To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range. Examples A 1 2 3 4 5 6 7 8 Tree ="=Apple" ="=Pear" Tree Apple Pear Cherry Apple Height 18 12 13 14 Age 20 12 14 15 Yield 14 10 9 10 Profit 105.00 96.00 105.00 75.00 B Height >10 C Age D Yield E Profit F Height <16

69

Participant Kit - Microsoft Excel 2007 Advanced 9 10 11 Pear Apple Formula =DMAX(A4:E10, "Profit", A1:A3) 9 8 Description (Result) The maximum profit of apple and pear trees. (105) 8 9 8 6 76.80 45.00

12

Important Because the equal sign is used to indicate a formula when you type text or a value in a cell, Microsoft Excel evaluates what you type; however, this may cause unexpected filter results. To indicate an equality comparison operator for either text or a value, type the criteria as a string expression in the appropriate cell in the criteria range: =''=entry'' Where entry is the text or value you want to find. For example: What you type in the cell ="=Davolio" ="=3000" What Excel evaluates and displays =Davolio =3000

When filtering text data, Excel does not distinguish between uppercase and lowercase characters. However, you can use a formula to perform a case-sensitive search. The following sections provide examples of complex criteria. Multiple criteria in one column Boolean logic: (Salesperson = "Davolio" OR Salesperson = "Buchanan") To find rows that meet multiple criteria for one column, type the criteria directly below each other in separate rows of the criteria range. In the following data range (A6:C10), the criteria range (B1:B3) displays the rows that contain either "Davolio" or "Buchanan" in the Salesperson column (A8:C10). A 1 2 Type B Salesperson =Davolio
70

C Sales

Participant Kit - Microsoft Excel 2007 Advanced

3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce

=Buchanan

Salesperson Suyama Davolio Buchanan Davolio

Sales $5122 $450 $6328 $6544

Multiple criteria in multiple columns where all criteria must be true Boolean logic: (Type = "Produce" AND Sales > 1000) To find rows that meet multiple criteria in multiple columns, type all of the criteria in the same row of the criteria range. In the following data range (A6:C10), the criteria range (A1:C2) displays all rows that contain "Produce" in the Type column and a value greater than $1,000 in the Sales column (A9:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type =Produce B Salesperson C Sales >1000

Multiple criteria in multiple columns where any criteria can be true Boolean logic: (Type = "Produce" OR Salesperson = "Davolio") To find rows that meet multiple criteria in multiple columns, where any criteria can be true, type the criteria in different rows of the criteria range.
71

Participant Kit - Microsoft Excel 2007 Advanced In the following data range (A6:C10), the criteria range (A1:B3) displays all rows that contain "Produce" in the Type column or "Davolio" in the Salesperson column (A8:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type =Produce =Davolio B Salesperson C Sales

Multiple sets of criteria where each set includes criteria for multiple columns Boolean logic: ( (Salesperson = "Davolio" AND Sales >3000) OR (Salesperson = "Buchanan" AND Sales > 1500) ) To find rows that meet multiple sets of criteria, where each set includes criteria for multiple columns, type each set of criteria in separate rows. In the following data range (A6:C10), the criteria range (B1:C3) displays the rows that contain both "Davolio" in the Salesperson column and a value greater than $3,000 in the Sales column, or displays the rows that contain "Buchanan" in the Salesperson and a value greater than $1,500 in the Sales column (A9:C10). A 1 2 3 4 5 6 7 8 Type Beverages Meat Salesperson Suyama Davolio Sales $5122 $450 Type B Salesperson =Davolio =Buchanan C Sales >3000 >1500

72

Participant Kit - Microsoft Excel 2007 Advanced

9 10

produce Produce

Buchanan Davolio

$6328 $6544

Multiple sets of criteria where each set includes criteria for one column Boolean logic: ( (Sales > 6000 AND Sales < 6500 ) OR (Sales < 500) ) To find rows that meet multiple sets of criteria, where each set includes criteria for one column, include multiple columns with the same column heading. In the following data range (A6:C10), the criteria range (C1:D3) displays rows that contain values between 6,000 and 6,500 and values less than 500 in the Sales column (A8:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson C Sales >6000 <500 D Sales <6500

Criteria to find text values that share some characters but not others To find text values that share some characters but not others, do one or more of the following: Type one or more characters without an equal sign (=) to find rows with a text value in a column that begin with those characters. For example, if you type the text Dav as a criterion, Excel finds "Davolio," "David," and "Davis." Use a wildcard character. The following wildcard characters can be used as comparison criteria. Use ? (question mark) To find Any
73

single

character

Participant Kit - Microsoft Excel 2007 Advanced For example, sm?th finds "smith" and "smyth" * (asterisk) ~ (tilde) followed by ?, *, or ~ Any number of characters For example, *east finds "Northeast" and "Southeast" A question mark, asterisk, For example, fy91~? finds "fy91?" or tilde

In the following data range (A6:C10), the criteria range (A1:B3) displays rows with "Me" as the first characters in the Type column or rows with the second character equal to "u" in the Salesperson column (A7:C9). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type Me =?u* B Salesperson C Sales

Criteria created as the result of a formula You can use a calculated value that is the result of a formula as your criterion. Remember the following important points: The formula must evaluate to TRUE or FALSE. Because you are using a formula, enter the formula as you normally would, and do not type the expression in the following way: =''=entry'' Do not use a column label for criteria labels; either keep the criteria labels blank or use a label that is not a column label in the range (in the examples below, Calculated Average and Exact Match). If you use a column label in the formula instead of a relative cell reference or a range name, Excel displays an error value such as #NAME? or #VALUE! in the cell that contains the criterion. You can ignore this error because it does not affect how the range is filtered.
74

Participant Kit - Microsoft Excel 2007 Advanced

The formula that you use for criteria must use a relative reference to refer to the corresponding cell in the first row (in the examples below, C7 and A7). All other references in the formula must be absolute references. The following subsections provide specific examples of criteria created as the result of a formula. Filtering for values greater than the average of all values in the data range In the following data range (A6:D10), the criteria range (D1:D2) displays rows that have a value in the Sales column greater than the average of all the Sales values (C7:C10). In the formula, "C7" refers to the filtered column (C) of the first row of the data range (7). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson C Sales D Calculated Average =C7>AVERAGE($C$7:$C$10)

Filtering for text by using a case-sensitive search In the data range (A6:D10), the criteria range (D1:D2) displays rows that contain "Produce" in the Type column by using the EXACT function to perform a case-sensitive search (A10:C10). In the formula, "A7" refers to the filtered column (A) of the first row of the data range (7). A 1 2 3 4 Type B Salesperson C Sales D Exact Match =EXACT(A7, "Produce")

75

Participant Kit - Microsoft Excel 2007 Advanced 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544

DCOUNT function This article describes the formula syntax and usage of the DCOUNTfunction in Microsoft Excel. Description Counts the cells that contain numbers in a field (column) of records in a list or database that match conditions that you specify. The field argument is optional. If field is omitted, DCOUNT counts all records in the database that match the criteria. Syntax DCOUNT(database, field, criteria) The DCOUNT function syntax has the following arguments: Database Required. The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. Field Required. Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. Criteria Required. The range of cells that contains the conditions that you specify. You can use any range for the criteria argument, as long as the argument includes at least one column label and at least one cell below the column label in which you specify a condition for the column. Remarks

76

Participant Kit - Microsoft Excel 2007 Advanced

You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount $10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions. Although the criteria range can be located anywhere on the worksheet, do not place the criteria range below the list. If you add more information to the list, the new information is added to the first row below the list. If the row below the list is not blank, Microsoft Excel cannot add the new information. Make sure that the criteria range does not overlap the list. To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range. Examples A 1 2 3 4 5 6 7 8 9 10 11 Tree ="=Apple" ="=Pear" Tree Apple Pear Cherry Apple Pear Apple Formula =DCOUNT(A4:E10, "Age", A1:F2) Height 18 12 13 14 9 8 Description (Result) This function looks at the records of apple trees Age 20 12 14 15 8 9 Yield 14 10 9 10 8 6 Profit 105.00 96.00 105.00 75.00 76.80 45.00 B Height >10 C Age D Yield E Profit F Height <16

77

Participant Kit - Microsoft Excel 2007 Advanced 12 between a height of 10 and 16 and counts how many of the Age fields in those records contain numbers. (1)

Important Because the equal sign is used to indicate a formula when you type text or a value in a cell, Microsoft Excel evaluates what you type; however, this may cause unexpected filter results. To indicate an equality comparison operator for either text or a value, type the criteria as a string expression in the appropriate cell in the criteria range: =''=entry'' Where entry is the text or value you want to find. For example: What you type in the cell ="=Davolio" ="=3000" What Excel evaluates and displays =Davolio =3000

When filtering text data, Excel does not distinguish between uppercase and lowercase characters. However, you can use a formula to perform a case-sensitive search.The following sections provide examples of complex criteria. Multiple criteria in one column Boolean logic: (Salesperson = "Davolio" OR Salesperson = "Buchanan") To find rows that meet multiple criteria for one column, type the criteria directly below each other in separate rows of the criteria range. In the following data range (A6:C10), the criteria range (B1:B3) displays the rows that contain either "Davolio" or "Buchanan" in the Salesperson column (A8:C10). A 1 2 Type B Salesperson =Davolio
78

C Sales

Participant Kit - Microsoft Excel 2007 Advanced

3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce

=Buchanan

Salesperson Suyama Davolio Buchanan Davolio

Sales $5122 $450 $6328 $6544

Multiple criteria in multiple columns where all criteria must be true Boolean logic: (Type = "Produce" AND Sales > 1000) To find rows that meet multiple criteria in multiple columns, type all of the criteria in the same row of the criteria range. In the following data range (A6:C10), the criteria range (A1:C2) displays all rows that contain "Produce" in the Type column and a value greater than $1,000 in the Sales column (A9:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type =Produce B Salesperson C Sales >1000

Multiple criteria in multiple columns where any criteria can be true Boolean logic: (Type = "Produce" OR Salesperson = "Davolio") To find rows that meet multiple criteria in multiple columns, where any criteria can be true, type the criteria in different rows of the criteria range.
79

Participant Kit - Microsoft Excel 2007 Advanced In the following data range (A6:C10), the criteria range (A1:B3) displays all rows that contain "Produce" in the Type column or "Davolio" in the Salesperson column (A8:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type =Produce =Davolio B Salesperson C Sales

Multiple sets of criteria where each set includes criteria for multiple columns Boolean logic: ( (Salesperson = "Davolio" AND Sales >3000) OR (Salesperson = "Buchanan" AND Sales > 1500) ) To find rows that meet multiple sets of criteria, where each set includes criteria for multiple columns, type each set of criteria in separate rows. In the following data range (A6:C10), the criteria range (B1:C3) displays the rows that contain both "Davolio" in the Salesperson column and a value greater than $3,000 in the Sales column, or displays the rows that contain "Buchanan" in the Salesperson and a value greater than $1,500 in the Sales column (A9:C10). A 1 2 3 4 5 6 7 8 Type Beverages Meat Salesperson Suyama Davolio Sales $5122 $450 Type B Salesperson =Davolio =Buchanan C Sales >3000 >1500

80

Participant Kit - Microsoft Excel 2007 Advanced

9 10

produce Produce

Buchanan Davolio

$6328 $6544

Multiple sets of criteria where each set includes criteria for one column Boolean logic: ( (Sales > 6000 AND Sales < 6500 ) OR (Sales < 500) ) To find rows that meet multiple sets of criteria, where each set includes criteria for one column, include multiple columns with the same column heading. In the following data range (A6:C10), the criteria range (C1:D3) displays rows that contain values between 6,000 and 6,500 and values less than 500 in the Sales column (A8:C10). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson C Sales >6000 <500 D Sales <6500

Criteria to find text values that share some characters but not others To find text values that share some characters but not others, do one or more of the following: Type one or more characters without an equal sign (=) to find rows with a text value in a column that begin with those characters. For example, if you type the text Dav as a criterion, Excel finds "Davolio," "David," and "Davis." Use a wildcard character. The following wildcard characters can be used as comparison criteria. Use ? (question mark) To find Any
81

single

character

Participant Kit - Microsoft Excel 2007 Advanced For example, sm?th finds "smith" and "smyth" * (asterisk) ~ (tilde) followed by ?, *, or ~ Any number of characters For example, *east finds "Northeast" and "Southeast" A question mark, asterisk, For example, fy91~? finds "fy91?" or tilde

In the following data range (A6:C10), the criteria range (A1:B3) displays rows with "Me" as the first characters in the Type column or rows with the second character equal to "u" in the Salesperson column (A7:C9). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type Me =?u* B Salesperson C Sales

Criteria created as the result of a formula You can use a calculated value that is the result of a formula as your criterion. Remember the following important points: The formula must evaluate to TRUE or FALSE. Because you are using a formula, enter the formula as you normally would, and do not type the expression in the following way: =''=entry'' Do not use a column label for criteria labels; either keep the criteria labels blank or use a label that is not a column label in the range (in the examples below, Calculated Average and Exact Match). If you use a column label in the formula instead of a relative cell reference or a range name, Excel displays an error value such as #NAME? or #VALUE! in the cell that contains the criterion. You can ignore this error because it does not affect how the range is filtered.
82

Participant Kit - Microsoft Excel 2007 Advanced

The formula that you use for criteria must use a relative reference to refer to the corresponding cell in the first row (in the examples below, C7 and A7). All other references in the formula must be absolute references. The following subsections provide specific examples of criteria created as the result of a formula. Filtering for values greater than the average of all values in the data range In the following data range (A6:D10), the criteria range (D1:D2) displays rows that have a value in the Sales column greater than the average of all the Sales values (C7:C10). In the formula, "C7" refers to the filtered column (C) of the first row of the data range (7). A 1 2 3 4 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544 Type B Salesperson C Sales D Calculated Average =C7>AVERAGE($C$7:$C$10)

Filtering for text by using a case-sensitive search In the data range (A6:D10), the criteria range (D1:D2) displays rows that contain "Produce" in the Type column by using the EXACT function to perform a case-sensitive search (A10:C10). In the formula, "A7" refers to the filtered column (A) of the first row of the data range (7). A 1 2 3 4 Type B Salesperson C Sales D Exact Match =EXACT(A7, "Produce")

83

Participant Kit - Microsoft Excel 2007 Advanced 5 6 7 8 9 10 Type Beverages Meat produce Produce Salesperson Suyama Davolio Buchanan Davolio Sales $5122 $450 $6328 $6544

84

Participant Kit - Microsoft Excel 2007 Advanced

Using nested functions


You can use a function as an argument for another function. This is called nesting functions. For example, the function AVERAGE(SUM(A1:A10), SUM(B1:B15)) sums two columns of numbers and returns the average of the two sums. Nesting IF() Functions When building models using IF(), its common to come upon a second fork in the road when evaluating either the value_if_true or value_if_false arguments. For example, consider the variation of our formula that outputs a description based on the value in cell A1:

=IF(A1 >= 1000, Big!, Not big)

What if you wanted to return a different string for values greater than, say, 10,000? In other words, if the condition A1 > 1000 proves to be true, you want to run another test that checks to see if A1 > 10000. You can handle this scenario by nesting a second IF() function inside the first as the value_if_true argument:

=IF(A1 >= 1000, IF(A1 >= 10000, Really big!!, Big!), Not big)

If A1 > 1000 returns TRUE, the formula evaluates the nested IF(), which returns Really big!! if A1 > 10000 is TRUE, and returns Big! if its FALSE; if A1 > 1000 returns FALSE, the formula returns Not big.

Note: Ideally we can put maximum 255 arguments in a function, however the levels of nested are limited to 64 only.

85

Participant Kit - Microsoft Excel 2007 Advanced

USING ONE-INPUT OR TWO-INPUT DATA TABLES / WHAT-IF TABLES


In MS Excel we can create Horizontal or Vertical calculation tables on the basis of a formula. These tables can be either one dimensional (Single Input) or Two Dimensional (Two Input) One input Data Table command Setting Up a One-Input Data Table The problem with modifying formula variables is that you see only a single result at one time. If youre interested in studying the effect a range of values has on the formula, you need to set up a data table. In the investment analysis worksheet, for example, suppose that you want to see the future value of the investment with the annual deposit varying between $7,000 and $13,000. You could just enter these values in a row or column and then create the appropriate formulas. Setting up a data table, however, is much easier, as the following procedure shows: 1. Add to the worksheet the values you want to input into the formula. You have two choices for the placement of these values: If you want to enter the values in a row, start the row one cell up and one cell to the right of the formula. If you want to enter the values in a column, start the column one cell down and one cell to the left of the cell containing the formula, as shown in Figure 14.2. 2. Select the range that includes the input values and the formula. (In Figure 14.2, this is B9:C16.) 3. Choose Data, Table. Excel displays the Table dialog box. 4. How you fill in this dialog box depends on how you set up your data table: If you entered the input values in a row, use the Row Input Cell text box to enter the cell address of the input cell. If the input values are in a column, enter the input cells address in the Column Input Cell text box. In the investment analysis example, you enter C4 in the Column Input Cell,

86

Participant Kit - Microsoft Excel 2007 Advanced

Figure 3

Figure 4 Two input data table command Setting Up a Two-Input Table You also can set up data tables that take two input variables. This option enables you to see the effect on an investments future value when you enter different values for, say, the annual deposit and the interest rate. The following steps show you how to set up a twoinput data table:

87

Participant Kit - Microsoft Excel 2007 Advanced 1. Enter one set of values in a column below the formula and the second set of values to the right of the formula in the same row 2. Select the range that includes the input values and the formula. 3. Choose Data, Table to display the Table dialog box. 4. In the Row Input Cell text box, enter the cell address of the input cell that corresponds to the row values you entered (C2the Interest Rate variable). 5. In the Column Input Cell text box, enter the cell address of the input cell you want to use for the column values (C4the Annual Deposit variable). 6. Click OK. Excel runs through the various input combinations and then displays the results in the data table

Figure 5

88

Participant Kit - Microsoft Excel 2007 Advanced

EXCEL 2007 - A FIRST LOOK AT PIVOT TABLES


Quick start: Create a PivotTable report By using a PivotTable report, you can summarize, analyze, explore, and present a summary of your worksheet data or an external data source. A PivotTable report is especially useful when you have a long list of figures to sum, and aggregated data or subtotals would help you look at the data from different perspectives and compare figures of similar data. For example, the following PivotTable report shows how the total third-quarter Golf department sales in cell F3 compare to sales for another sport, or quarter, or to the total sales of all departments.

Figure 6 1. Source data, in this case, from a worksheet 2. The source values for Qtr3 Golf summary in the PivotTable report 3. The entire PivotTable report 4. The summary of the source values in C2 and C8 from the source data Important Although you can also create a PivotTable report for an external data source, this quick start article describes how to create one for worksheet data. How? 1. Define the data source for the PivotTable report
89

Participant Kit - Microsoft Excel 2007 Advanced To use worksheet data as the data source, click a cell in the range of cells that contains the data. To use data in a Microsoft Excel table as the data source, click a cell inside the Excel table. Note Make sure that the range has column headings or that headers are displayed in the table, and that there are no blank rows in the range or table. 2. Create the PivotTable report 1. On the Insert tab, in the Tables group, click PivotTable. Tip To create a PivotChart that is based on the PivotTable report at the same time, click the arrow below PivotTable, and then click PivotChart.

Figure 7 2. In the Create PivotTable dialog box, make sure that Select a table or range is selected, and then in the Table/Range box, verify the range of cells.

Figure 8 Excel automatically determines the range for the PivotTable report, but you can replace it by typing a different range or a name that you defined for the range. For data in another worksheet or workbook, include the workbook and worksheet name by using the following syntax [workbookname]sheetname!range.

90

Participant Kit - Microsoft Excel 2007 Advanced

Tip You can also click Collapse Dialog

to temporarily hide the dialog box, select the range on .

the worksheet, and then click Expand Dialog 3. Do one of the following:

To place the PivotTable report in a new worksheet starting at cell A1, click New Worksheet. To place the PivotTable report at a specific location in an existing worksheet, select Existing Worksheet, and then in the Location box, specify the first cell in the range of cells where you want to position the PivotTable report. 4. Click OK. Excel adds an empty PivotTable report to the specified location and displays the PivotTable Field List so that you can add fields, create a layout, and customize the PivotTable report. Note If you created a PivotChart at the same time, it is displayed on top of the associated PivotTable report. A PivotChart and its associated PivotTable report must always be in the same workbook. Add fields to the PivotTable report In the PivotTable Field List, do one or more of the following: To place a field in the default area of the layout section, select the check box next to the field name in the field section. By default, nonnumeric fields are added to the Row Labels area, numeric fields are added to the Values area, and Online Analytical Processing (OLAP) date and time hierarchies are added to the Column Labels area.

91

Participant Kit - Microsoft Excel 2007 Advanced

Figure 9 The field section contains the field names of the fields you can add to the Layout section The layout section contains the Report Filter area, the Column Labels area, the Row Labels area, and the Values area. To place a field in a specific area of the layout section, right-click the field name in the field section, and then select Add to Report Filter, Add to Column Label, Add to Row Label, or Add to Values. To drag a field to the area that you want, click and hold the field name in the field section, and then drag it to an area in the layout section. Tip You can use the PivotTable Field List to rearrange the fields later as needed by right-clicking the fields in the layout section, and then selecting the area that you want, or by dragging the fields between the areas in the layout section. Modifying data and refreshing the Pivot Table Changes that you make to the source data after you create the PivotTable report are reflected in the report when you refresh the selected PivotTable report (PivotTable Tools, Options tab, Data group, Refresh button). If you add rows to the range of source data, you can include those rows in the PivotTable report by changing the source data (PivotTable Tools, Options tab, Data group, Change

92

Participant Kit - Microsoft Excel 2007 Advanced

Source Data button). If the source data is in an Excel table, additional rows are automatically displayed when you refresh the PivotTable report. grouping data within a Pivot table

Figure 10

93

Participant Kit - Microsoft Excel 2007 Advanced

Pivot table chart


What is a PivotChart report A PivotChart report provides a graphical representation of the data in a PivotTable report, which in this case is called the associated PivotTable report. Like a PivotTable report, a PivotChart report is interactive. When you create a PivotChart report, PivotChart report filters are displayed in the chart area so that you can sort and filter the underlying data of the PivotChart report. Changes that you make to the field layout and data in the associated PivotTable report are immediately reflected in the PivotChart report. A PivotChart report displays data series, categories, data markers, and axes just as standard charts do. You can also change the chart type and other options such as the titles, the legend placement, the data labels, and the chart location. A PivotChart report of sport sales by quarter

Figure 11

You can automatically create a PivotChart report when you first create a PivotTable report, or you can create a PivotChart report from an existing PivotTable report. Comparing a PivotTable report and a PivotChart report When you create a PivotChart report from a PivotTable report, the layout of the PivotChart report, that is, the position of its fields, is determined initially by the layout of the PivotTable report. When you create the PivotChart report first, you determine the chart layout by dragging fields from the PivotTable Field List to specific areas on the chart sheet. Note The Totals and Subtotals of an associated PivotTable report are ignored in a PivotChart report.
94

Participant Kit - Microsoft Excel 2007 Advanced

The following PivotTable and PivotChart reports of sales data illustrate the relationship between the two.

Figure 12 A row label corresponds to a category A column label corresponds to a data series Differences between a PivotChart and a standard chart If you are familiar with standard charts, you will find that most operations are the same in PivotChart reports. However, there are some differences: Row/Column orientation Unlike a standard chart, you cannot switch the row/column orientation of a PivotChart report by using the Select Data Source dialog box. However, you can pivot the Row and Column labels of the associated PivotTable report to achieve the same effect. Chart types You can change a PivotChart report to any chart type except an xy (scatter), stock, or bubble chart. Source data Standard charts are linked directly to worksheet cells. PivotChart reports are based on the data source of the associated PivotTable report. Unlike a standard chart, you cannot change the chart data range in the Select Data Source dialog box of a PivotChart report. Formatting Most formatting including chart elements that you add, layout, and style is preserved when you refresh a PivotChart report. However, trendlines, data labels, error bars, and
95

Participant Kit - Microsoft Excel 2007 Advanced other changes to data sets are not preserved. Standard charts do not lose this formatting once it is applied. Although you cannot directly resize the data labels in a PivotChart report, you can increase the font size of the text to effectively resize the labels.

96

Participant Kit - Microsoft Excel 2007 Advanced

Working with the source data of a PivotTable or PivotChart report


When you create a PivotTable or a PivotChart report, you can use any of several different types of source data. Creating a PivotTable or PivotChart from worksheet data You can use data from a Microsoft Excel worksheet as the basis for a report. The data should be in list format, with column labels in the first row. Each cell in subsequent rows should contain data appropriate to its column heading. There should not be any blank rows or columns within the data of interest. Excel uses your column labels for the field names in the report. Using a named range To make the report easier to update, name the source range, and use the name when you create the report. If the named range expands to include more data, you can refresh the report to include the new data. Excel tables Excel tables are already in list format and are good candidates for PivotTable source data. When you refresh the PivotTable report, new and updated data from the Excel table is automatically included in the refresh operation. Including totals Excel automatically creates subtotals and grand totals in a PivotTable report. If the source data contains automatic subtotals and grand totals that you created by using the Subtotals command in the Outline group on the Data tab, use that same command to remove the subtotals and grand totals before you create the report. Using an external data source to create a PivotTable or PivotChart You can retrieve data from a source that is external to Excel such as a database, an Online Analytical Processing (OLAP) cube, or a text file. For example, you might maintain a database of sales records you want to summarize and analyze. Office Data Connection files If you use an Office Data Connection (ODC) file (.odc) to retrieve external data for your report, you can input the data directly into a PivotTable report. We recommend that you retrieve external data for your reports by using ODC files. OLAP source data When you retrieve source data from an OLAP database or a cube file, the data is returned to Excel only as a PivotTable report or a PivotTable report that has been converted to worksheet functions. Non-OLAP source data This is the underlying data for a PivotTable report or a PivotChart report that comes from a source other than an OLAP database. For example, data from relational databases or text files.

97

Participant Kit - Microsoft Excel 2007 Advanced Using another PivotTable report as the data source The PivotTable cache Each time that you create a new PivotTable report or PivotChart report, Excel stores a copy of the data for the report in memory, and saves this storage area as part of the workbook file. Thus, each new report requires additional memory and disk space. However, when you use an existing PivotTable report as the source for a new report in the same workbook, both reports share the same copy of the data. Because you reuse the same storage area, the size of the workbook file is reduced and less data is kept in memory. Location requirements To use a PivotTable report as the source for another report, both reports must be in the same workbook. If the source PivotTable report is in a different workbook, copy the source report to the workbook location where you want the new report to appear. PivotTable reports and PivotChart reports in different workbooks are separate, each with its own copy of the data in memory and in the workbook files. Changes affect both reports When you refresh the data in the new report, Excel also updates the data in the source report, and vice versa. When you group or ungroup items in one report, both reports are affected. When you create calculated fields or calculated items in one report, both reports are affected. PivotChart reports You can base a new PivotTable report or PivotChart report on another PivotTable report, but you cannot base it directly on another PivotChart report. However, Excel creates an associated PivotTable report from the same data whenever you create a PivotChart report; therefore, you can base a new report on the associated report. Changes to a PivotChart report affect the associated PivotTable report, and vice versa. Changing the source data of an existing PivotTable report Changes in the source data can result in different data being available for analysis. For example, you may want to conveniently switch from a test database to a production database. You can update a PivotTable report or a PivotChart report with new data that is similar to the original data connection information by refreshing the report. To include additional data or different data, you can redefine the source data for the report. If the data is substantially different with many new or additional fields, it may be easier to create a new report. Displaying new data brought in by refresh Refreshing a report can also change the data that is available for display. For reports based on worksheet lists, Excel retrieves new fields within the source range or named range that you specified. For reports based on external data, Excel retrieves new data that meets the criteria for the underlying query or data that becomes available in an OLAP cube. You can view any new fields in the Field List and add the fields to the report. Changing OLAP cubes that you create Reports based on OLAP data always have access to all of the data in the cube. If you created an offline cube file that contains a subset of the data in a server cube, you can use the Offline OLAP command to modify your cube file so that it contains different data from the server.
98

Participant Kit - Microsoft Excel 2007 Advanced

EXCEL 2007 ANALYSIS


Creating named Scenarios from defined cell ranges When to use scenarios You could use scenarios to take snapshots of data as you change certain variables or conditions, such as what would happen to the temperature of a material if you gradually increased the temperature of the environment. You can create and save different groups of values on a worksheet and then switch to any of those scenarios to view different results. In the following example, a user can switch between scenarios that show what happens to a personal budget when payments on a second car are added and what happens when a second car is added with lower working hours.

Figure 13 What-if scenarios are helpful for data analyses. Students can use scenarios to explore what-if possibilities for many types of school projects, such as materials testing, environmental studies, trend analysis, and genetic predictions. After a number of scenarios have been saved, you can create a summary, the results of which can be used to build charts or graphs.

99

Participant Kit - Microsoft Excel 2007 Advanced

Figure 14 You can use summaries of what-if scenarios to build charts or graphs. Create scenarios 1. Start Office Excel 2007. Either open a file that includes some formulas that you would like to use for your analysis, or start from a new worksheet, and then type in your data and formulas. 2. Decide which values in the worksheet you will change and which will display the results. For example, you might want to see what happens when you change several variables that affect the budget and then display the result as an amount over or under budget. 3. To create a new scenario, on the Data tab, in the Data Tools group, click What-If Analysis, and then click Scenario Manager 4. Click Add. 5. In the Scenario name box, type a name for the new scenario. 6. In the Changing cells box, enter the references for the cells that you want to change. To add a cell to the list, press CTRL and then click the cell. Note: To preserve the original values for the changing cells, first create a scenario that contains the original cell values. Then, create the scenarios in which you change the values. 7. Under Protection, select the options that you want, and then click OK. 8. Next, in the Scenario Values dialog box, type the values that you want for the changing cells, and then click OK. 9. If you want to create additional scenarios, click Add again, and then repeat steps 5 through 9. When you finish creating scenarios, click OK. 10. Double-click a scenario on the list in Scenario Manager to view it on the worksheet. Summarize scenarios 1. On the Data tab, in the Data Tools group, click What-If Analysis, and then click Scenario Manager. 2. To summarize the data in the scenarios, click Summary. 3. Decide whether you want a summary or PivotTable report. 4. Enter the cells that display the results, and then click OK. Excel 2007 creates a new worksheet that summarizes the data in your scenarios. You can also merge the data from scenarios on different worksheets.

100

Participant Kit - Microsoft Excel 2007 Advanced

Working with Goal seek


If you know the result that you want from a formula, but not the input value the formula needs to get that result, you can use the Goal Seek feature. For example, use Goal Seek to change the interest rate in cell B3 until the payment value in B4 equals ($900.00).

Figure 15 1. On the Data tab, in the Data Tools group, click What-If Analysis, and then click Goal Seek. 2. In the Set cell box, enter the reference for the cell that contains the formula you want to resolve. (In the example, this is cell B4.) 3. In the To value box, type the result you want. (In the example, this is -900.) 4. In the By changing cell box, enter the reference for the cell that contains the value you want to adjust. (In the example, this is cell B3.) Note This cell must be referenced by the formula in the cell you specified in the Set cell box.

101

Participant Kit - Microsoft Excel 2007 Advanced

EXCEL 2007 - AUDITING


Tracing precedent cells Select formula Formula bar Trace precedents in formula auditing group

Figure 16 Tracing dependants of a cell Select formula Formula bar Trace dependents in formula auditing group

Figure 17 Displaying all formulas within a worksheet Formula TabShow Formulas in formula auditing group

102

Participant Kit - Microsoft Excel 2007 Advanced

103

Participant Kit - Microsoft Excel 2007 Advanced

Using comments
Inserting comments Select CellReview TabNew Comment in Comments GroupType Comment Deleting Comments Select comments containing cellReview TabDelete in Comments Group Navigating Comments Review TabNavigation Buttons in Comments Group Show/Hide Comments Review TabShow/hide Comments in Comments Group

Figure 18

104

Participant Kit - Microsoft Excel 2007 Advanced

EXCEL 2007 - MACROS


Displaying the Developer tab Office button General Show Developer Tab Recording and running a macro 1. Recording a Macro View Tab Macro in Macro Group Record MacroGive a macro Name Give a Keyboard Shortcut

Figure 19 (Perform activities) View Tab Macro in Macro Group Stop Macro

105

Participant Kit - Microsoft Excel 2007 Advanced

Figure 20
2. Running a Macro

View Tab Macro in Macro Group View Macro Select MacroRun

Figure 21 Or Press keyboard shortcut assigned to the macro Lowering your macro security level Office button Excel Options Trust CenterTrust Center Setting Macro Settings Enable all Macros

106

Participant Kit - Microsoft Excel 2007 Advanced

Customizing the Quick Access Toolbar


Adding Command button Right click the Button Add to quick access toolbar Removing Command Button Right Click the button on quick access toolbar Remove from quick access toolbar Resetting Quick Access Toolbar Quick Access Toolbar More commands Reset Changing the Quick Toolbar Macro icon Quick Access Toolbar More Commands Select a command button ModifyChange the Icon Removing a macro icon from the quick access toolbar Quick Access Toolbar Right Click Macro Icon Remove From Quick Access Toolbar Raising your macro security level Office button Excel Options Trust CenterTrust Center Setting Macro Settings Disable all Macros with notification

107

You might also like