23
EXCEL ADVANCED EVALUATION COPY Unauthorized Reproduction or Distribution Prohibited

EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

EXCEL ADVANCED

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 2: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Overview

OVERVIEW.................................................................................................................................................. 2

ADVANCED FORMULAS ......................................................................................................................... 4 VIEW THE PROJECT ..................................................................................................................................... 4 Viewing Available Excel Functions ............................................................................................. 5 Help with Functions .................................................................................................................... 6

TEXT FUNCTIONS ....................................................................................................................................... 7 Text Functions Used in this Section: .................................................................................................. 7 Basic Text Functions ................................................................................................................... 7 Basic “IF” Conditional Formulas .............................................................................................. 8 Nesting “IF” Statements ............................................................................................................. 8 Concatenate Text Functions ........................................................................................................ 9 “IF” Concatenate Text Functions ............................................................................................... 9

BLANK FUNCTIONS....................................................................................................................................10 ISBLANK Function .....................................................................................................................10 COUNTBLANK Function ...........................................................................................................10

ARRAY & NAME RANGE FORMULAS .........................................................................................................11 Single Result Arrays ...................................................................................................................11 Using Name Ranges in Formulas ...............................................................................................11 Viewing Formulas ......................................................................................................................12

REVIEW .....................................................................................................................................................12

LOOK UPS & OTHER FUNCTIONS ......................................................................................................15 LOOKUPS ...................................................................................................................................................15 VLOOKUP .................................................................................................................................16 HLOOKUP .................................................................................................................................17 Lookup with a Range ..................................................................................................................17

ADDITIONAL FUNCTIONS ...........................................................................................................................18 Calculating Days of the Week ....................................................................................................18 SUMIF Function.........................................................................................................................20

REVIEW .....................................................................................................................................................21

DATA VIEWS, LAYOUTS AND RULES ................................................................................................22 TRANSPOSING ............................................................................................................................................22 Transposing Data .......................................................................................................................22 Transposing Non-Adjacent Data ................................................................................................22

VALIDATIONS ............................................................................................................................................23 Validation ...................................................................................................................................23 Copying Validations ...................................................................................................................24 List Validation ............................................................................................................................25

CUSTOM VIEWS .........................................................................................................................................26 Filters .........................................................................................................................................26 Grouping ....................................................................................................................................26 Creating Default View ................................................................................................................26 Creating a New Custom View .....................................................................................................27 Adding Custom View button to Quick Access toolbar ................................................................28

REVIEW .....................................................................................................................................................29

INTRODUCTION TO MACROS ..............................................................................................................31 WHAT IS A MACRO? ..................................................................................................................................31 Accessing the Developer Tab .....................................................................................................31 Storing (Saving) your Macros ....................................................................................................32 Saving a Macro in a Workbook ..................................................................................................32

2016©MCS Excel 2016 Advanced – version 1.0 2

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 3: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Understanding Absolute or Relative Macro References .............................................................33 Planning and Rehearsing ...........................................................................................................34 Practice the Macro Steps............................................................................................................35 Adjusting Column Width and Formatting ..................................................................................35 Recording a Macro .....................................................................................................................36 Adjusting Column Width and Formatting ..................................................................................36 Reviewing the Macro ..................................................................................................................36 Adding the Macro to the Quick Access Toolbar .........................................................................37 Change the Quick Access Toolbar Button Face Icon .................................................................37

REVIEW .....................................................................................................................................................38

ADDITIONAL TOOLS ..............................................................................................................................39 EMBEDDING AND LINKING ........................................................................................................................39 Embedding ..................................................................................................................................40 Editing an Embedded object .......................................................................................................40 Linking ........................................................................................................................................41 Editing a Linked object ...............................................................................................................41 Linking as an icon ......................................................................................................................42

PROTECTING SPREADSHEETS .....................................................................................................................43 Locking Cells ..............................................................................................................................43 Protecting the Spreadsheet .........................................................................................................44 Unprotect a Spreadsheet ............................................................................................................44 Protecting a Workbook ...............................................................................................................44

REVIEW .....................................................................................................................................................45

3 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 4: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Section I Advanced Formulas

View the Project The Gourmet Hot Dog Shoppe sells all different types of hot dogs in their cafe. We will help them in maintaining their overall inventory, sales tracking, forecasting, and order status, by using Excel.

2016©MCS Excel 2016 Advanced – version 1.0 4

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 5: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Viewing Available Excel Functions There are more functions available in Excel than you could cover in ten Excel classes. However, Excel provides a library of all available functions with links to their uses and examples if you are looking for something specific. 1. Click on the Formulas tab 2. In the Function Library group, click on the various Function category buttons

and view the different functions available 3. Note that when you highlight one of the functions

in the pop-up menu, by placing your mouse over it, a screen tip displays that gives you a definition of that function

4. You can also select the Insert Function button to view all functions at once 5. Click on the Logical function category button, and choose IF from the menu 6. In the dialog box, click the Help on this

Function link 7. View the help screen 8. Close the help window when finished, then

click the Cancel button on the dialog box Note: The definition of a function is any procedure which returns a value. There are many different types of functions in Excel: Text, Conditional, Statistical, Conversion, etc., that you can choose from to help you analyze your data.

5 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 6: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Help with Functions If you need help with functions or are simply looking for a function to help with a calculation need, there is very good help in Excel that lists all of the Excel functions, defines their syntax, and even gives you examples you can copy and paste into Excel to practice.

1. Click on the Help button in the upper right hand corner of the Excel window 2. In the Excel Help window type: functions and press Enter 3. Click on the Excel functions (by category) item 4. Click on the Logical functions link to jump to that section 5. Click on the IF function 6. Note that it gives a description, syntax breakdown, other general remarks and

examples 7. Close the Excel Help window when done

2016©MCS Excel 2016 Advanced – version 1.0 6

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 7: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Text Functions You can use text functions to manipulate your text in many ways including: to change the case of text, combine text and numbers, display or select only specific characters from a cell, and format text.

Text Functions Used in this Section:

Function What it Does Uses What it Looks Like LEFT Extracts a

designated # of characters starting from the left

Pull the first 2 characters from a string:

=LEFT(A2,2)

MID Extracts a designated # of characters starting at the designated character.

Pull the 4 characters from a string starting with the 3rd character:

=MID(A2,3,4)

CONCATENATE Combines multiple strings into one.

Add the text from multiple cells into one string, or add additional numbers (like a date’s year) to the date in a cell.

=CONCATENATE(LEFT (A2,2),2007)

Basic Text Functions Our product inventory consists of products identified by inventory numbers. Each inventory number tells us something about a product based on its: type, its product number, and the date it was ordered. The first 3 characters = the product type code, the 4th through 8th characters = the month and day it was last ordered, and the last character = the product number within its type. We can extract information from a product’s inventory number to populate other cells by writing some text functions. 1. Open the Gourmet Hot Dog Shoppe Excel document 2. Make sure the Products sheet is the active one 3. Click on cell C8 4. Type: =Left(A8,3) and press Enter. This indicates that we want the 3

characters from cell A8 starting from the Left of the string. Note that you can start typing =Le and then choose the Left function from the pop-up menu by double-clicking it

5. Copy this formula all the way down to cell C25 6. Extract the order date of the product by clicking on cell E8 and typing:

=MID(A8,4,5) and then press Enter. This indicates that we want to pull out text from the middle of the string, starting at the 4th character and pulling 5 characters.

7 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 8: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Basic “IF” Conditional Formulas Conditional Formulas make comparisons between expressions and return a result based on if they are True or False. You can use the AND, OR, NOT, and IF functions to create conditional formulas. Rather than having the Product Type code display in column C, we can have the full name of the product type listed, by creating an IF formula. Let’s create an IF formula that inserts the actual word “Food” if it reads “FOD” from the A cell. 1. Click in cell C8 then click in the formula bar to edit the formula 2. Edit your formula so that it looks like the following:

=IF(LEFT(A8,3)="FOD","Food","") 3. Press Enter and view the information in cell C8 4. Copy the formula all the way down to cell C25. Note how only the Food types are

visible because our formula only displays the text “Food” if it finds FOD, and leaves it blank if it doesn’t (indicated by two quotation marks side by side).

Nesting “IF” Statements We can write a formula that contains multiple IF statements, which is called “Nesting.” Since our Product Type can be one of 3 different types, we want it to also fill in the other types besides just the one for “Food.” So to look at the Nesting IF formula logically it would look something like this: “IF Condition then, Else IF Condition then, Else IF Condition then, False then”. In terms of our spreadsheet it would logically look like this: IF Condition (the first 3 characters in cell A6 = FOD) then (put the word “Food” in the cell), IF Condition (the first 3 characters in cell A6 = PPD) then (put the word “Paper Product” in the cell), IF Condition (the first 3 characters in cell A6 = COD) then (put the word “Condiment” in the cell), or if none of these statements is true, then (leave the cell blank). So let’s try typing out that logic in our formula. 1. Click in cell C8 then click in the formula bar to edit

the formula 2. Edit your formula so that it looks like the following:

=IF(LEFT(A8,3)="FOD","Food",IF(LEFT(A8,3)="PPD","Paper Product",IF(LEFT(A8,3)="COD","Condiment","")))

3. Press Enter and view the information in cell C8 4. Copy the formula all the way down to cell C25. Note that all product types are

now visible. Tip: When writing a conditional formula, 2 quote marks side by side ("") is the same as the word “blank” – i.e., telling the cell to remain blank.

2016©MCS Excel 2016 Advanced – version 1.0 8

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 9: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Concatenate Text Functions Concatenate means to connect separate units or items into a linked system. We want to include the current year (2017) in our date. So we can write a concatenate formula to do so. However, since it is the beginning of the year, we still have some December dates from 2016 – so we want those to actually display with that year. 1. To include the current year in our date, click on cell E8 again, then click in the

formula bar 2. Edit your formula so that it looks like the following:

=CONCATENATE(MID(A8,4,5),"-2017") 3. Note that we used quotation marks around the text -2017 because

we included a dash (-). By placing a dash between our year and the rest of the day and month date, Excel would have read that part of the formula as a subtraction, but by using quotation marks, it reads it as text.

4. Press Enter and review the contents in cell E8 5. Copy the formula from cell E8 all the way down through cell E25

“IF” Concatenate Text Functions This formula will work fine if all of our products were ordered in 2017, but we have some products that were ordered in Oct., Nov., and Dec. of 2016. So we want to create a formula with an IF scenario: If the fourth character contains the number 1 (for 12, 11, or 10 numbered months) then it needs to add the year 2016 to the date. If the fourth character does not contain the number 1, then it needs to add the year 2017 to the date. 1. Click on cell E8 again, then click in the formula bar 2. Edit your formula so that it looks like the following:

=IF(MID(A8,4,1)="1",CONCATENATE(MID(A8,4,5),"-2016"), CONCATENATE(MID(A8,4,5),"-2017"))

3. Press Enter and view the contents in cell E8 4. Now copy your formula from cell E8 all the way down through cell

E25

9 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 10: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Blank Functions The ISBLANK and COUNTBLANK functions are used to tell if cells are blank or not.

ISBLANK Function IS functions return a result based on a certain type of value found in a cell. So logically it looks like this: =IS Function Value. Let’s write a formula using the IS Function that labels a product status to “Order” if there are no more left (the cell is blank), but that gives us the number of remaining inventory if there are any left. 1. Go to the Order Status sheet 2. Click in cell B5 3. Enter the following formula:

=IF(ISBLANK(Products!F8),"Order",Products!F8) 4. Press Enter then view the contents in cell B5 5. Copy the formula from this cell all the way down to cell

B21

COUNTBLANK Function You can also create a formula that will give you the count of the total amount of blank cells in a list. This is useful to calculate how much data is missing and needs to be updated. We will write a formula that counts the total number of cells in the Current Inventory column, that are blank. Function details: COUNTBLANK(range) 1. Go to the Products spreadsheet 2. In cell G3, write the following formula to count the number of blank cells in the

Current Inventory column: =COUNTBLANK(F8:F25) 3. Press Enter when done

2016©MCS Excel 2016 Advanced – version 1.0 10

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 11: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Array & Name Range Formulas Array formulas are used to perform multiple calculations with single or multiple results. The key to array formulas is that they need to have the same number of rows and columns to work. You create array formulas in the same way that you create other formulas, except you press CTRL+SHIFT+ENTER to enter the formula.

Single Result Arrays Singe array formulas can replace several different formulas with a single array formula. For example, we have the Unit Price of our items as well as the Quantity Sold for Q1. We want to get the Total Sales for the quarter from these numbers. Without an array formula, we would have to create another column to calculate the total sales for each of these items and then total that column. But an array formula lets us get our grand total without creating any additional columns or formulas. 1. Go to the Q1 Sales sheet 2. Click on cell B11 and type the following formula: =SUM(B4:B9*C4:C9) 3. Press Ctrl+Shift+Enter on your keyboard 4. View the results in cell B11 - note that the formula

has brackets around it – indicating that it is an array formula

Using Name Ranges in Formulas You can name ranges of cells in Excel, like a column of information in a table, and then write formulas that use the names rather than cell references. This makes formulas easier to understand when looking at them, so that you don’t have to refer to the specific cells. 1. On the Q1 Sales sheet, select cells E4:E9 2. In the Name Box, above the row headings, type: Q1January then

press Enter 3. Select cells F4:F9 and name the range: Q1February then press

Enter 4. Select cells G4:G9 and name the range: Q1March then press Enter 5. Click in cell E11 and type: =Sum(Q1January) then press Enter 6. Click in cell F11 and type: =Su then double-click on Sum from the

popup menu to select it, then type: Q1 and double-click on Q1February from the popup menu to select it

7. Type a close parenthesis and then press Enter to complete 8. Click in cell G11 and type: =Sum( then click on the Formulas tab

and in the Defined Names group, click on the Use in Formula button

9. From the drop-down list, select Q1March 10. Type a close parenthesis ( and then press Enter to complete Note: You cannot use spaces in the name box when naming cells or ranges.

11 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 12: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Viewing Formulas When you look at a spreadsheet, you are seeing the value of each cell – meaning that if there is a formula behind it, you don’t see the formula, only the results or value of that formula, unless you click on the cell and view the formula in the formula bar. However, you can quickly display all formulas in a spreadsheet without having to click on each of them. 1. Press Ctrl+` and view the formulas and look at your newly created Named Range

formulas 2. Press Ctrl+` again to go back to the default display to only see the values in each

cell

2016©MCS Excel 2016 Advanced – version 1.0 12

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 13: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Review The Gourmet Hot Dog Shoppe has some additional products that they will be adding to their menu. These products need to be identified by their inventory number just like the existing products. In this case, the product code represents the date they are expected to be ordered. 1. Go to the Future Products sheet. 2. Write a formula in cell C8 that takes the first 3 letters from the Inventory

Number (in cell A8) and places it in the cell (C8). (Page 7) 3. Copy the formula down from C8 through to cell C13. 4. Write a formula in cell E8 that takes text from the middle of the string in cell A8,

starting at the 4th character, and pulling 5 characters, and then places it in the cell (E8). (Page 7)

5. In cell C8, edit the formula so that it inserts the word “Food” in the cell if the first 3 letters in cell A8 are “FOD”, and if not, it leaves the cell blank. (Page 8)

6. Now edit the same formula in cell C8 (using Nested IF statements) that also returns the words “Paper Products” in the cell, if the first 3 letters in cell A8 are “PPD”, or returns the word “Condiment” in the cell, if the first 3 letters in cell A8 are “COD”. (Page 8)

7. Copy the formula down from C8 through to cell C13. 8. In cell E8, edit your formula so that it includes a Concatenate formula to include

the year “—2017” after the date in cell E8. (Page 9) 9. Copy the formula down from E8 through to cell E13. 10. Go to the Q2 Sales sheet. 11. In cell B11 write an Array formula that gives us the Total Sales for Q2 by

multiplying cells B4:B9 by C4:C9, in a SUM function. (Page 11) 12. Name the ranges E4:E9 as: Q2April, F4:F9 as: Q2May, and G4:G9 as: Q2June

(Page 11) 13. Write a formula in cells E11, F11 and G11 using the Named Ranges, that totals

the amounts in each of those columns (Qty by month sales). (Page 11) 14. View all formulas on the Q2 Sales sheet, rather than the values, to see what your

new Named Range formulas look like. (Page 12) 15. Save your edits. Finished spreadsheets will look like diagrams 1.1, 1.2, and 1.3.

Diagram 1.1

13 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 14: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Diagram 1.2

Diagram 1.3

2016©MCS Excel 2016 Advanced – version 1.0 14

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 15: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 16: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Section II Look Ups & Other Functions

Lookups Lookups retrieve information based on its relationship to other information in a table. This is useful when the value of one argument depends on the value of another. For example: 1) a formula that allows you to see the description of a product by typing in its inventory code or 2) a formula that calculates an invoice total in which a customer’s discount is dependent on the quantity purchased. Lookups let you find data in a selection of cells by entering a parameter. There are 2 types of lookup functions: HLOOKUP and VLOOKUP. Both of these accomplish the same function except for one searches the data based horizontally (by row) and the other vertically (by column). Examples of lookup formulas:

=VLOOKUP(C11,$G$6:$H$9,2) =HLOOKUP(C13,$J$14:$M$15,2)

Syntax behind the formula: =VLOOKUP(lookup_value, table_array, column or row index_number, Range_lookup) 1. Lookup_value – identifies the cell you want the lookup to compare against the

table (i.e., the cell address of the information for which you want to search). 2. Table_array – range of cells you want to search within, for the information 3. Column_index_num or Row_index_num – the column/row number of the

selected columns/rows that has the value to return/calculate against. This does not represent the column/row header name but rather the counted number of the column/row in the selected group (table array). If there are 10 rows in the table array and the 10th row has the data that you to extract, then enter 10. Or if you have selected two columns and the second column has the data you want to extract then enter 2.

4. Range – this last part is optional and applies a Boolean value to the first part of the formula (lookup_value). For example, if you use “False” or “0”, it will only search for an exact match to the lookup_value. Or if you use “True”, it will search for the first exact match or if none found, the largest value that is less than the Lookup_value (this is the default range).

Note: There are different types of look ups – like a Range lookup (noted below in the second Vlookup scenario), or an exact match lookup (noted below in the first Vlookup and Hlookup scenario- i.e., to find a match to a cell of data).

15 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 17: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

VLOOKUP At the Gourmet Hot Dog Shoppe, they often have an Inventory Number but forget which product it represents. Rather than having to look through the long list of products, to try and find it, they want to create a look up instead, that will allow them to type in the Inventory Number (in cell A5) and then display the corresponding product (in cell B5). We will use the Insert Function Wizard to step through this formula. 1. Go to the Products spreadsheet and click in cell B5 2. On the Formulas tab on the Ribbon, in the Function Library

group, click on Lookup & Reference, then select Vlookup 3. Click in the Lookup_Value field, then click on cell A5 in the

Products spreadsheet to insert the cell reference in the field (this is the cell that contains the value you want the formula to look for in the table)

4. Click in the Table_array field and then select cells A8:B25 in your spreadsheet (to indicate the cells in your table you want to look in for the various pieces of data)

5. In the Col_Index_num field, type a 2 (to indicate which of the selected columns – counting from left to right – has the data you returned in your results)

6. In the Range_lookup field, type False (meaning you are not looking for a range of data, you want the results to return the exact match)

7. Click OK 8. Enter one of the Inventory Numbers in cell A5,

then press Enter 9. You should see the corresponding product

description in cell B5 Note: The look up value always has to be listed in the first column or row of your table array, for it to work. For example, in the above, if the inventory number was not in column A, it would not work as the look up value for our formula.

2016©MCS Excel 2016 Advanced – version 1.0 16

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 18: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

HLOOKUP We are going to create an exact match lookup to find a value like we did in the product inventory lookup we created earlier. This time we will create a lookup that shows us the total unit sales per month when we type in that month. Because the data we want to have returned is in a row, we will use an HLOOKUP this time. 1. Go to the Q2 Sales sheet 2. Click in cell K16 and type the following formula:

=HLOOKUP(K15,B22:G29,8,FALSE) – where K15 is the cell we will use to type the month, the table that contains the info is in cells B22 through G29, and the row that contains the data we want it to return is the 8th one out of the selected rows, and False to return only data that exactly matches the month parameter we type.

3. Click in cell K15 and type the word April then press Enter 4. Type May and press Enter and note how the data in cell K16 changes

Lookup with a Range We now want to create a different type of lookup using a Range VLOOKUP. The Gourmet Hot Dog Shoppe offers discounts for large orders. Customers receive deeper discounts based on the amount of units they purchase. We want to create a VLOOKUP that refers to the discount schedule to calculate what discount each customer will receive. Because we are going to use a range lookup, the VLOOKUP will search for the largest value that is less than or equal to the lookup value and apply that one. Therefore if a customer orders a quantity that falls between 2 discount prices, they will receive the lower discount price. 1. Go to the Bulk Order Discounts sheet 2. Click in cell D6 and type the following formula: =VLOOKUP(C6,G6:H9,2)

– where C6 is the cell that the formula will reference to compare to the table, the table that contains the info is in cells G6 through H9, and the column that contains the data we want it to return is the second one out of the selected columns, we do not need to type the word TRUE at the end of the formula to indicate that it is a range lookup because that is the default range.

3. Click-and-drag to copy the formula all the way down to cell D11 4. Notice that you have incorrect numbers and #N/A errors in some of your cells

because the table array portion of your formula is being updated when you copy your formula. In this case we need to add $ symbols to the table array reference in our formula to make it static.

5. Click the Undo button once, click on cell D6, then click in the formula bar and edit your formula to be: =VLOOKUP(C6,$G$6:$H$9,2)

17 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 19: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

6. Click-and-drag to copy the formula all the way down to cell D11 again. Tip: Rather than typing in the $ symbols when using a static cell reference in a formula, you can press F4 after typing the cell reference to automatically insert the $ symbols for you. Additional Functions

Calculating Days of the Week The Gourmet Hot Dog Shoppe has a list of holidays that the store will be closed. However, they would like to know what day of the week each of those dates falls. We can create a simple text formula to display those days. Function details: TEXT(Value, Format_Text) 1. Go to the Store Schedule tab 2. In cell D11, write the following formula: =TEXT(C11,"dddd") The formula indicates to display text by looking at cell C11 and providing the day of the week that it represents. You must use quotes "" around the dddd to indicate that it is displaying text (not trying to reference a cell). 3. Using the fill handle, copy the formula down to cell D16 Tip: If you wanted to display the weekday in a shorter abbreviation such as Thu, then you would use only 3 d's such as "ddd" in the formula.

2016©MCS Excel 2016 Advanced – version 1.0 18

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 20: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Calculating # of Weekdays From a Date You can calculate the number of days between 2 dates by subtracting one date from the other. However, to determine the number of weekdays from any given date, you can use the NETWORKDAYS function, which calculates the number of days between 2 dates, excluding weekends. The Gourmet Hot Dog Shoppe wants to know how many days, and then weekdays ,they have left until their big annual sale. 1. In cell C6, write the following formula to calculate total days between the 2

dates: =C5-C4 2. If your results displayed in a date format (rather than number), on the Home tab

on the Ribbon, in the Number group, click on the drop-down to change Date to General. This will format the cell to display a number rather than the date.

3. In cell C7, write the following formula: =NETWORKDAYS(C4,C5) 4. Press Enter Note: When you are writing the formula for the total number of days, you are subtracting the lesser date from the later (larger) date (C5-C4). However, when you use the NETWORKDAYS function, you reference the earlier date first (C4,C5).

Calculating # of Months Between 2 Dates If you want to calculate the amount of time between 2 dates, in increments of years, months, or days, you can use the DATEDIF function. We will calculate the number of months between now and the big annual sale. DATEDIF(Value, Value, Format) 1. In cell C8, write the following formula: =DATEDIF(C4,C5,"m") 2. Press Enter The "m" indicates to display the results in months, but you can also use "y" to display years or "d" to display days.

19 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 21: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

SUMIF Function The Gourmet Hot Dog show tracks its monthly internet and phone orders. They like to see what portion of their sales goes to their Denver customers, Phoenix customers and New Mexico. So they want to calculate the totals for those 3 categories by using a SUMIF function. Function Syntax details: SUMIF (range, criteria, sum_range) 1. Go to the Customer Orders spreadsheet 2. In cell G4, write the formula: =SUMIF(C4:C28,"=Denver",D4:D28) The first range of cells are the cells to test the criteria against (to locate the word "Denver" in), and the second range of cells are the cells to sum if the criteria is met. 3. In cell G5, write the formula: =SUMIF(C4:C28,"=Phoenix",D4:D28) 4. Format both G4 and G5 so they display in $ if not already

2016©MCS Excel 2016 Advanced – version 1.0 20

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 22: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

Review 1. Go to the Future Products sheet 2. Create a lookup formula in cell B5 that displays Product Descriptions by

entering the Inventory Number in cell A5. You will need to use a Vlookup function that looks at the value in cell A5 (which will contain the Inventory Number) and looks in the Table Array A8:B13, and displays the results from the Description column – note, you are looking for an exact match, not a Range. (Page 16 )

3. Enter the Inventory Number: PPD09-016 in cell A5 to test the lookup (it should display Souvenir Cups in cell B5, if correct.

4. Create a VLOOKUP on the Bulk Orders Discount sheet that calculates all of the bulk order discounts for the Nuts & Bolts Company Lunch order (in cells D18 – D23), based on the Discount Schedule (cells G6:H9). Finished table should look like Diagram 1.4 below. (Page 17)

5. On the Customer Orders spreadsheet, in cell G6, use a SUMIF function to write a formula that adds the amounts in column D - if it says "New Mexico" in the corresponding cells in column C. Final Totals should look like diagram 1.6 below. (page 20)

6. Save your edits. Finished spreadsheets should look like diagrams 1.4, 1.5 & 1.6.

Diagram 1.4

Diagram 1.5

Diagram 1.6

21 Excel 2016 Advanced – version 1.0 2016©MCS

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited

Page 23: EVALUATION Reproduction or COPY EXCEL ADVANCED...Text Functions . You can use text functions to manipulate your text in many ways including: to change the case of text, combine text

7400 E. Orchard Road, Suite 1450 NGreenwood Village, Colorado 80111

Ph: 303-302-5280www.ITCourseware.com

1-07-00081-000-08-24-16

EVALUATION COPY

Unauthorized Reproduction or Distribution Prohibited