excel look up functions

24
VLOOKUP HLOOKUP LOOKUP INDEX CHOOSE MATCH Arguments lookup_value table_array col_index_num range_lookup steps 1 2 3 4 VLOOKUP: Looks when it finds

Upload: ansh305

Post on 12-Nov-2015

70 views

Category:

Documents


7 download

DESCRIPTION

Excel Look Up Functions

TRANSCRIPT

LookupDetailsThree basic LOOKUP functions and INDEX and CHOOSE and MATCH:VLOOKUPMost common because most lookup tables like tax tables and price tables are orientated verticallyHLOOKUPMost tables are vertical, not horizontal, so using HLOOKUP is rare.LOOKUPAlthough LOOKUP was one of the first functions in a spreadsheet, the VLOOKUP can do almost everything that the LOOKUP does and more. The one thing that the LOOKUP can do that the VLOOKUP (or HLOOKUP) can't do is retrieve a value to the left or above a lookup_value column or row; it can also have a column and a row area. LOOKUP function must have the lookup_vector sorted in ascending order. LOOKUP looks up the greatest value that does not exceed a specified value anywhere in a table or range.INDEXGood when you have more than one table to look values up in. (non-contiguous ranges must be in parenthesis and stored all on the same worksheet). You can also have a table with intersection lookup values where INDEX and MATCH can be used together to look up labels and return intersection of two labels. Also can be used as a replacement for VLOOKUP when the data you want to retrieve is to the left of the lookup column.CHOOSECHOOSE can return a value or a range from a list of 1 to 254 arguments.MATCHThis function tells you the ordinal position of an item in a listVLOOKUP: Looks at a cell, then takes that value and goes over to a look up table where it looks in the first column, and when it finds the corresponding value in the first columns, it moves to the left in that row and retrieves a value from one of the tables columns and brings it back to the cell.ArgumentsDescriptionslookup_valueThe date you want to look up. This value can be a number, text, a logical value, or a name or cell reference that refers to a value.table_arrayThe lookup table. The first column must have the values to look up such as part number, part name, tax bracket wage figures, grade number intervals. The other columns can have data that you want to retrieve such as part price, tax rates, tax paid from earlier brackets.col_index_numThe number of the column containing the data you want to retrieve. The number 1 indicates that first column; 2 indicates the second column.range_lookupThe type of lookup you want to perform: TRUE or FALSE. With TRUE (the default), the VLOOKUP function finds the greatest value that does not exceed the lookup_value value. When the lookup type is TRUE, the first column must be sorted in ascending order, otherwise the VLOOKUP might not retrieve the correct value. With FALSE, the VLOOKUP looks for an exact match of the lookup_value.stepsVLOOKUP Algorithm1Looks for an exact match. If duplicate values it ignores the second value. If no match it goes to step 22If the lookup_value is smaller than the first value in the first column, #N/A error is displayed. If the value is greater than the first value in the first column, it goes to step 33The VLOOKUP function continues checking until it sees a value bigger than the lookup_value, then it uses the previous row and retrieves a value from that row.4It looks to see if the next value is the last value in the table, if it is it retrieves a value from this row, otherwise it repeats step 3

VLOOKUP1)The V in VLOOKUP means Vertical.2)VLOOKUP function returns something to a cell or formula that it found in a lookup table.3)VLOOKUP(cell you want to lookup, Lookup Table, Column Designation of value you want to return to the cell, Exact Match = 0 or approximate value = 1 (default))4)Approximate value means that when the function sees a value that is bigger than the lookup_value, it stops and uses that row above that value.5)For approximate value, VLOOKUP takes the value you tell it to look at, goes to the first column of the lookup table (sorted ascending) and if the first value is less than the lookup_value it returns #N/A otherwise it races down the column until it sees a value bigger than the lookup_value and then it uses the row above, then it goes to the column that you specified and gets that value, then brings it back to the cell or formula.6)Using named ranges for lookup table is usually efficient. Using Data Validation for the lookup cell helps the accuracy of your task.7)When creating the lookup_table in the formula itself: 1) enclose the table in curly brackets { }; 2) column elements are separated by commas ,; 3) row elements are separated by semicolons ;.1Example 1: Deliver value to cell. Find approximate value from column 2 of lookup table.0F0.65D0.75C0.85B0.95AScoreGrade0.752Example 2: Deliver value to cell. Find exact value from column 2 of lookup table.Product 1$20.00Product 2$25.00Product 3$15.00Product 4$15.00Product 5$16.00ProductPriceProduct 23Example 3: Deliver value to cell. Find value from column 2 & 3. Use COLUMN function (tells you what column you are in).ProductPriceDescriptionBoom01$15.00Flying Range is 10Boom02$30.00Flying Range is 20Boom03$40.00Flying Range is 50Boom04$45.00Flying Range is 60Boom05$65.00Flying Range is 70Boom06$69.00Flying Range is 80Boom07$100.00Flying Range is 85Boom08$110.00Flying Range is 110Boom09$165.00Flying Range is 160ProductPriceDescriptionBoom074Example 4: Use VLOOKUP to deliver a value to a formula.Days Late% Late Fee01%302%603%905%Days LateBalanceLate Charge89$500.005Example 5: Use multiple VLOOKUPs in 1 formula to deliver mutiple values to a formula. Also, Use IF function or IFERROR function to solve #N/A error problemManufacturers PlusIncome StatementProjected Net Income For The Years Ended December 31200320042005200620072008Net Revenues$450,000.00$495,000.00$544,500.00$598,950.00$658,845.00$724,729.50Expenses500,000.00510,000.00520,200.00530,604.00541,216.08552,040.40Net Income Before Income Taxes(50,000.00)(15,000.00)24,300.0068,346.00117,628.92172,689.10Tax ExpenseNet Income($50,000.00)($15,000.00)$24,300.00$68,346.00$117,628.92$172,689.10Tax Tables 2004If Taxable Income Is:VLOOKUPReferenceOver -But Not OverTax Amount FromPrevious BracketTax Rate ForRemaining Amount0$0$50,00015%50,00150,00075,0007,50025%75,00175,000100,00013,75034%100,001100,000335,00022,25039%335,001335,00010,000,000113,90034%10,000,00110,000,00015,000,0003,400,00035%15,000,00115,000,00018,333,3335,150,00038%18,333,33418,333,3336,416,66735%AssumptionsIncrease In Sales10%Increase in Expenses2%6Example 6: Create lookup_table in formula itself "hard code table into formula": 1) enclose the table in curly brackets { }; 2) column elements are separated by commas ,; 3) row elements are separated by semicolons ;. Use RANDBETWEEN to generate random integers (in 2003 you have to go to Tools menu, Add-ins, then check Analysis ToolPak".)1Suix2Fred3Chin4SheliadawnFind Name RandomlyFind Name Randomly

HLOOKUP1)HLOOKUP is the same as VLOOKUP except the H means Horizontal2)Most tables are vertical, not horizontal, so using HLOOKUP is rare.Product 1Product 2Product 3Product 4Product 5ProductProduct 2$20.00$25.00$15.00$15.00$16.00Price

LOOKUP1)Although LOOKUP was one of the first functions in a spreadsheet, the VLOOKUP can do almost everything that the LOOKUP does and more. The one thing that the LOOKUP can do that the VLOOKUP (or HLOOKUP) can't do is retrieve a value to the left or above a lookup_value column or row; it can also have a column and a row area. LOOKUP function must have the lookup_vector sorted in ascending order. LOOKUP looks up the greatest value that does not exceed a specified value anywhere in a table or range.2)ProductPriceDescriptionBoom01$15.00Flying Range is 10Boom08$110.00Flying Range is 110Boom09$165.00Flying Range is 160Boom02$30.00Flying Range is 20Boom03$40.00Flying Range is 50Boom04$45.00Flying Range is 60Boom05$65.00Flying Range is 70Boom06$69.00Flying Range is 80Boom07$100.00Flying Range is 85DescriptionProductFlying Range is 60

MATCH1)The MATCH function looks up a value and tells you what relative position it is in the list.2)If match_type is 1, MATCH finds the largest value that is less than or equal to lookup_value. Lookup_array must be placed in ascending order: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE.3)If match_type is 0, MATCH finds the first value that is exactly equal to lookup_value. Lookup_array can be in any order.4)If match_type is -1, MATCH finds the smallest value that is greater than or equal to lookup_value. Lookup_array must be placed in descending order: TRUE, FALSE, Z-A, ...2, 1, 0, -1, -2, ..., and so on.5)If match_type is omitted, it is assumed to be 1.AllowancesIncome0123450$6.00$5.00$4.00$3.00$2.00$1.00100$7.00$6.00$5.00$4.00$3.00$2.00200$8.00$7.00$6.00$5.00$4.00$3.00300$9.00$8.00$7.00$6.00$5.00$4.00400$10.00$9.00$8.00$7.00$6.00$5.00500$11.00$10.00$9.00$8.00$7.00$6.00600$12.00$11.00$10.00$9.00$8.00$7.00700$13.00$12.00$11.00$10.00$9.00$8.00Relative Position in listIncome250Allowances2

INDEX1)INDEX has 2 different uses: 1) look up a value that is at the intersection of a row and column, or 2) look up a specific table and then within that specific table look up a value that is at the intersection of a row and column.2)Good when you have more than one table to look values up in. (non-contiguous ranges must be in parenthesis and stored all on the same worksheet). You can also have a table with intersection lookup values where INDEX and MATCH can be used together to look up labels and return intersection of two labels. Also can be used as a replacement for VLOOKUP when the data you want to retrieve is to the left of the lookup column.3)Example 1: Look up a value that is at the intersection of a row and column.4)Example 2: Look up a specific table and then within that specific table look up a value that is at the intersection of a row and column.1AllowancesIncome0123450$6.00$5.00$4.00$3.00$2.00$1.00100$7.00$6.00$5.00$4.00$3.00$2.00200$8.00$7.00$6.00$5.00$4.00$3.00300$9.00$8.00$7.00$6.00$5.00$4.00400$10.00$9.00$8.00$7.00$6.00$5.00500$11.00$10.00$9.00$8.00$7.00$6.00600$12.00$11.00$10.00$9.00$8.00$7.00700$13.00$12.00$11.00$10.00$9.00$8.00Relative Position in listTaxIncome2503Allowances232Customer Type 10RegionShipping MethodCustomer TypeShipping Method - StandardNWRailCustomer Type 10RegionRailTruckPlaneShipWestTruckCustomer Type 20NW$0.125$0.135$1.525$0.225SWPlaneCustomer Type 30West$0.205$0.145$2.025$0.245MidWestShipSW$0.265$0.165$2.125$0.225EastMidWest$0.305$0.185$2.275$0.225East$0.475$0.425$3.525$0.375RegionWestCustomer Type 20Shipping MethodShipping Method - PreferredTruckRegionRailTruckPlaneShipCustomer TypeNW$0.115$0.125$1.375$0.205Customer Type 20West$0.185$0.135$1.825$0.215Shipping per UnitSW$0.245$0.155$1.915$0.205MidWest$0.275$0.165$2.055$0.205East$0.435$0.385$3.175$0.345Customer Type 30Shipping Method - Most PreferredRegionRailTruckPlaneShipNW$0.105$0.115$1.245$0.175West$0.175$0.125$1.645$0.165SW$0.215$0.135$1.725$0.185MidWest$0.255$0.155$1.845$0.185East$0.385$0.345$2.865$0.305

MATCH & INDEX1)INDEX has 2 different uses: 1) look up a value that is at the intersection of a row and column, or 2) look up a specific table and then within that specific table look up a value that is at the intersection of a row and column.2)The MATCH function looks up a value and tells you what relative position it is in the list.3)Good when you have more than one table to look values up in. (non-contiguous ranges must be in parenthesis and stored all on the same worksheet). You can also have a table with intersection lookup values where INDEX and MATCH can be used together to look up labels and return intersection of two labels. Also can be used as a replacement for VLOOKUP when the data you want to retrieve is to the left of the lookup column.1Example 1: INDEX and MATCH can be used together to look up labels and return intersection of two labelsAllowancesIncome0123450$6.00$5.00$4.00$3.00$2.00$1.00100$7.00$6.00$5.00$4.00$3.00$2.00200$8.00$7.00$6.00$5.00$4.00$3.00300$9.00$8.00$7.00$6.00$5.00$4.00400$10.00$9.00$8.00$7.00$6.00$5.00500$11.00$10.00$9.00$8.00$7.00$6.00600$12.00$11.00$10.00$9.00$8.00$7.00700$13.00$12.00$11.00$10.00$9.00$8.00TaxIncome250Allowances22Example 2: Use INDEX as a substitute for VLOOKUP when the value you want to return is to the left of the lookup column.ProductPriceDescriptionBoom01$15.00Flying Range is 10Boom02$30.00Flying Range is 20Boom03$40.00Flying Range is 50Boom04$45.00Flying Range is 60Boom05$65.00Flying Range is 70Boom06$69.00Flying Range is 80Boom07$100.00Flying Range is 85Boom08$110.00Flying Range is 110Boom09$165.00Flying Range is 160DescriptionProductFlying Range is 603Example 3: Use INDEX and MATCH for looking up a specific table and then within that specific table looking up a value that is at the intersection of a row and column.Customer Type 10RegionShipping MethodCustomer TypeShipping Method - StandardNWRailCustomer Type 10RegionRailTruckPlaneShipWestTruckCustomer Type 20NW$0.125$0.135$1.525$0.225SWPlaneCustomer Type 30West$0.205$0.145$2.025$0.245MidWestShipSW$0.265$0.165$2.125$0.225EastMidWest$0.305$0.185$2.275$0.225East$0.475$0.425$3.525$0.375RegionWestCustomer Type 20Shipping MethodShipping Method - PreferredTruckRegionRailTruckPlaneShipCustomer TypeNW$0.115$0.125$1.375$0.205Customer Type 20West$0.185$0.135$1.825$0.215Shipping per UnitSW$0.245$0.155$1.915$0.205MidWest$0.275$0.165$2.055$0.205East$0.435$0.385$3.175$0.345Customer Type 30Shipping Method - Most PreferredRegionRailTruckPlaneShipNW$0.105$0.115$1.245$0.175West$0.175$0.125$1.645$0.165SW$0.215$0.135$1.725$0.185MidWest$0.255$0.155$1.845$0.185East$0.385$0.345$2.865$0.305

CHOOSE1)CHOOSE can return a value or a range from a list of 1 to 254 arguments.2)Select Garbage Duty for WeekSelect Garbage Duty for WeekJoel

Intersector Operator1)Ctrl + Shift + F3 "Create Names From Selection"2)A space is the intersector operator3)4)5)Dept01Dept02Dept03Dept04Dept05Jan$4,921$3,733$2,677$1,544$806Feb$5,698$4,703$3,616$2,995$1,872Mar$6,518$5,569$4,885$3,626$2,504Apr$7,823$6,552$5,887$4,896$3,979May$8,630$7,515$6,555$5,786$4,600Jun$9,778$8,832$7,694$6,964$5,741Jul$10,771$9,650$8,613$7,788$6,853Aug$11,798$10,980$9,838$8,834$7,897Sep$12,838$11,851$10,630$9,834$8,952Oct$13,871$12,759$11,839$10,817$9,756Nov$14,587$13,599$12,500$11,772$10,688Dec$15,903$14,706$13,558$12,872$11,959Type Intersection in:AprDept04