Lookup_value is the value to be found in the first column of the array. Lookup_value can be a value, a reference, or a text string.
Table_array is the table of information in which data is looked up. Use a reference to a range or a range name, such as Database or List. It is usually a range name.
If range_lookup is TRUE, the values in the first column of table_array must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise VLOOKUP may not give the correct value. If range_lookup is FALSE, table_array does not need to be sorted.
You can put the values in ascending order by choosing the Sort command from the Datamenu and selecting Ascending.
The values in the first column of table_array can be text, numbers, or logical values.
Uppercase and lowercase text are equivalent.
Col_index_num is the column number in table_array from which the matching value must be returned. A col_index_num 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 col_index_num is less than 1, VLOOKUP returns the #VALUE! error value; if col_index_num is greater than the number of columns in table_array, VLOOKUP returns the #REF! error value.
Range_lookup is a logical value that specifies whether you want VLOOKUP 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, VLOOKUP will find an exact match. If one is not found, the error value #N/A is returned.
If VLOOKUP can't find lookup_value, and range_lookup is TRUE, it uses the largest value that is less than or equal to lookup_value.
If lookup_value is smaller than the smallest value in the first column of table_array, VLOOKUP returns the #N/A error value.
If VLOOKUP can't find lookup_value, and range_lookup is FALSE, VLOOKUP returns the #N/A value.
Look at the example sheet called VlookupExample. Try the following formulas in cell E4 of the sheet:
Looks up 1 in column A, and returns the value from column B in the same row (2.17)
Looks up 1 in column A, and returns the value from column C in the same row (100)
Looks up 0.746 in column A. Because there is no exact match in column A, an error is returned (#N/A)
Looks up 0.1 in column A. Because 0.1 is less than the smallest value in column A, an error is returned (#N/A)
Looks up 2 in column A, and returns the value from column B in the same row (1.71)
Value is the value (or reference to value) we want tested. Value can be a blank (empty cell), error, logical, text, number, or reference value, or a name referring to any of these, that you want to test.
ISNA returns TRUE if the value is the #NA error string, otherwise it returns FALSE.
Usually, when we do a Vlookup, we will use the ISNA function to check and make the lookup_value we are supplying actually exists on the leftmost column of the target range or sheet.
Practice Example: First, let us create the range Testrange in sheet VlookupExample.
To create a range we select the cells, and then click the name box and type in the name.
Let us do this for the cells A2:C10 in sheet VlookupExample. Call these cells: TestRange.
What value do we see now in E14?
Now copy the formula from cell E14 to E15. Notice how the D14 becomes D15 in the formula in cell E15. What value do we see in E15?
In our project, we should use ISNA whenever we use Vlookup, to suppress any #NA errors.
Now let’s do the MID function!!!
MID returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify.
Text is the text string containing the characters you want to extract.
Start_num is the position of the first character we want to extract in text. The first character in text has start_num 1, and so on.
Num_chars specifies the number of characters we want MID to return from text.
If start_num is greater than the length of text, MID returns "" (empty text).
If start_num is less than the length of text, but start_num plus num_chars exceeds the length of text, MID returns the characters up to the end of text.
If start_num is less than 1, MID returns the #VALUE! error value.
If num_chars is negative, MID returns the #VALUE! error value.
Open the MIDExample worksheet.
In cell C3, type in:
Five characters from the string above, starting at the first character (Fluid)
Twenty characters from the string above, starting at the seventh (Flow)
A pivot table summarizes data along multiple dimensions. Open the Sheet PivotExample and study the raw data. Suppose we want to find out how much John sold in total, across sports & time. Suppose we wanted to know how much we sold in Quarter Q1. Suppose we wanted to know how much we sold for Golf? A pivot table will answer these kinds of questions by summarizing data across fields. Let us practice using the pivot table wizard in Excel. Do the following:
On the Insert menu, click PivotTable.
Follow the directions and fill in the fields. CREATE THE PIVOT SHEET SEPARATELY FROM THE CURRENT SHEET.
Usually you can lay out the report onscreen, and this method is recommended. Use the wizard to lay out the report only if you expect retrieval from a large external data source to be slow, or you need to set page fields to retrieve data one page at a time. If you aren't sure, try laying out the report onscreen. You can return to the wizard if necessary.
From the PivotTable Field List window, drag the fields with data that you want to display in rows to the drop area labeled Drop Row Fields Here.
If you don't see the field list, click within the outlines of the PivotTable drop areas, and make sure Show Field List is pressed in.
To see what levels of detail are available in fields that have levels, the click next to the field.
Drag fields with data that you want to display across columns to the drop area labeled Drop Column Fields Here.
Drag fields that contain the data that you want to summarize to the area labeled Drop Data Items Here.
If you add more than one data field, arrange these fields in the order you want: Right-click a data field, point to Order on the shortcut menu, and use the commands on the Order menu to move the field.
Drag fields that you want to use as page fields to the area labeled Drop Page Fields Here.
To rearrange fields, drag them from one area to another. To remove a field, drag it out of the PivotTable report.
Now practice creating a new sheet (call it PivotExample2) and summarizing the sales by salesperson, by quarter and by sport.
Conditional formatting is very useful in making our sheets easy to read. To make conditional formats, we highlight the cells we want to format, then FileConditional Formatting, then put in the conditions, and the desired effect. Use the ADD button to add conditions. For our practice, we will create 2 conditions that are described in sheet ConditionalFormatExample. We should go ahead and try it out!!!
Congratulations, you have finished the Excel lab!!! For a list of skills we acquired, please refer back to page 1.