CS1100: Computer Science and Its Applications Table Lookup and Error Processing Martin Schedlbauer, Ph.D.

Slides:



Advertisements
Similar presentations
Microsoft Office Grade 10 A / B Cahaya Bangsa Classical School (C) 2010 Digital Media Production Facility 16 Microsoft Excel – 07.
Advertisements

Cell Referencing Absolute Reference: A reference that does not change when copied. It is specified with a dollar sign in front of both the row and column.
CS1100: Computer Science and Its Applications Table Lookup and Error Processing Created By Martin Schedlbauer
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 1Advanced Formatting, Formulas, and Data Management Chapter 2Advanced Functions and Formulas.
Spreadsheets Relative & Absolute Addresses CIL 102 ‘08 Fall.
MIS: Chapter 14 Cumulative concepts, features and functions, plus new functions COUNTIFS, SUMIFS, AVERAGEIFS (Separate ppt on REACH.louisville.edu) All.
Pre-defined System Functions Simple IF & VLOOKUP.
Calling all Data Geeks! Corey McAfee October 24, 2014 Corey McAfee October 24, 2014.
Tutorial 7: Using Advanced Functions and Conditional Formatting
In Business Series © Prentice Hall Microsoft Office Excel 2007 In Business Core Chapter 4 Evaluating Data.
Pradeep Velugoti Lakshman Tallam.  Type in the month name “January” in any cell say A1.  Now drag the fill handle to the right to select the range (Do.
1 CA202 Spreadsheet Application Working with Database Data Lecture # 14.
Computer Science & Engineering 2111 Vlookup and Hlookup Functions Syntax 1CSE 2111 Lecture Vlookup and Hlookup.
259 Lecture 4 Spring 2010 Logical Functions and Conditional Formatting in Excel.
Turning Numbers Into Knowledge Nate Moore MBA, CPA, CMPE.
ACOT Intro/Copyright Succeeding in Business with Microsoft Excel 2010.
Tutorial 8: Working with Advanced Functions
ADVANCED EXCEL FORMULAS 1 Lesson 8. Named Ranges Name a cell or a range of cells Can make formulas easy to understand =SUM(Sales) instead of =SUM(A2:A16)
LOGO Chapter VI Advanced Functions 1. LOGO Overview  INTRODUCTION  NESTED FUNCTIONS  LOOKUP  VLOOKUP  COUNTIF  SUMIF  IF  ROUND  THE PMT, IPMT.
COMPREHENSIVE Excel Tutorial 7 Using Advanced Functions, Conditional Formatting, and Filtering.
1 Use a cell value as a KEY to a table to find and return a specific element to another cell or use in a calculation.
REACH-CRC © 2012 REACH-CRC. All Rights Reserved.FALL 2012.
Unit 2 – Spreadsheets Spreadsheets Vlookups.
Microsoft Office Excel 2013 ® ® Abdul Hameed Using Advanced Functions and Conditional Formatting.
CS105 Fall CS105 Lab 3 – Excel: The IF Function Announcements MP 1 will be released on Monday 9/14, due Monday 9/28 by 9pm Midterm 1 on Tuesday 9/29.
# 1# 1 Error Messages, VLookup, Practical Tips What use is VLookup? How do you error check in Excel? CS 105 Spring 2010.
Computer Science 1000 Spreadsheets V Permission to redistribute or use these slides is strictly prohibited without permission.
Simulation Using computers to simulate real- world observations.
REACH-CRC © 2012 REACH-CRC. All Rights Reserved.FALL 2012.
CS&E 1111 Exreference Microsoft Excel Reference Functions Objectives: l Understanding and using Reference Functions l The computer’s algorithm l Syntax.
CSCI-235 Micro-Computers in Science Microsoft Excel 2002 Chapter 3 Spreadsheets in Decision Making: What If?
Excel 2007 Part (3) Dr. Susan Al Naqshbandi
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next Generation.
Chapter 12 Creating Formulas that Look Up Values Microsoft Excel 2003.
- Professor Kurt Brandquist - IT133 Software Applications Unit 6 Seminar: Formulas and Functions Wednesday, 6/22/11.
Chapter 4 Decision Making. Agenda Function Goal Seek command AutoFilter command Worksheet operation Printing worksheet.
REACH-CRC © 2013 REACH-CRC. All Rights Reserved.Spring 2013.
1 CSE 2337 Chapter 5 Retrieving Data with Lookups.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 11 Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next Generation.
RevisionRevision Function in Spreadsheet DATE Returns the serial number of a particular date. Syntax –DATE(year,month,day) year is a number from 1900.
CIS 300- Professor Im Test #2. MICROSOFT ® EXCEL ® LOOKUP FUNCTIONS Syntax: =VLOOKUP(lookup_value,table_array,col_index_num,[range_lookup]) Arguments:
XP Life Insurance Premium Flowchart 1 Add Life Ins = “Y” Salary * Premium Rate Yes 0 No.
LOOKUP FUNCTIONS Excel Lesson 10. LOOKUP FUNCTIONS Allow the user to find data in other cells in the spreadsheet and place them in the current cell VLOOKUP:
OV Copyright © 2011 Element K Content LLC. All rights reserved. Calculating Data with Advanced Formulas  Apply Cell and Range Names  Calculate.
VLOOKUP Function Tech Tuesday January 5, What is VLOOKUP? A Function in Excel (and also in Google Sheets) for finding specific information in.
Pmt Function Vlookup Function Excel Database.  Naming a Range is very useful Makes copying more clear because formula or function contains a name rather.
CIS 300- Professor McIntosh Test #3. MICROSOFT ® EXCEL ® MATHEMATICAL FUNCTIONS Syntax: =ROUND(number, num_digits) Arguments: number Required  The number.
MS-EXCEL PART 3. Use data validation in Excel to make sure that users enter certain values into a cell. Data Validation Example In this example, we restrict.
CIS300 Test 3 Review Reinhardt. © 2009 Dale McIntosh. All Rights Reserved. Slides are Available at: uter/cistestreviews.html.
V- Look Up. Lookup Tables Often, we need to retrieve data that is stored in a table For example, consider these metals and their properties: Metal Modulus.
Logical Functions and Conditional Formatting in Excel
Excel IF Function.
VLOOKUP Finds an entry from a vertical array based on a criteria
CS1100: Computer Science and Its Applications
VLOOKUP Finds an entry from a vertical array based on a criteria
How To Use VLOOKUP In Microsoft Excel
ITI 091 MS Excel Level III 9/18/2018
VLOOKUP functions Data Analysis.
ITI 305 MS Excel Level III 11/20/2018
MS Excel 2016 Level III 12/6/2018 Copyright © Carl M. Burnett.
Vlookup.
VLookup and HLookup in Microsoft Excel
V- Look Up.
MS Excel 2016 Level III Montgomery County Government (MCG)
Excel Tips and Tricks Presented by: Tracee Baker, Business Analyst, TD Ameritrade July 21, /3/2019.
Topic 5 – Table Lookup Lesson 3 - Advanced Lookup
ITI 091 MS Excel Level III 4/9/2019
Aniko Balogh CEU Computer & Statistics Center
Table Lookup and Error Handling
Lesson 5 Topic 1 – Table Lookup and Error Handling
Presentation transcript:

CS1100: Computer Science and Its Applications Table Lookup and Error Processing Martin Schedlbauer, Ph.D.

LOOKUP AND MAPPING Excel Basics CS1100Lookup and Error Processing2

LOOKUP Tables LOOKUP Tables help you use a worksheet table as a source of information to be used elsewhere in formulas. Used to store data you want to refer to frequently. Use a LOOKUP formula from other cells to look up data Lookup formulas can work vertically, looking for values down a column, or they can work horizontally, looking for values across a row CS1100Lookup and Error Processing3

Consider This Example Employee payroll data: CS1100Lookup and Error Processing4 Job Status: full-time (FT) or part-time (PT) Salary: annual compensation Years Service: number of years employee has been with company Life Ins: Y = employee wants life insurance, N = no life insurance Health Plan: type of health plan employee participates in Life Premium: amount of life insurance premium paid by employer Health Premium: amount of health insurance premium paid by employer Total Comp: total compensation paid to employee (salary + insurance)

Calculations We need to calculate: – Life Insurance Premium – Health Insurance Premium – Total Compensation CS1100Lookup and Error Processing5

Health Insurance Rules (an exact lookup) The health insurance premium is based on the type of plan selected: CS1100Lookup and Error Processing6 Plan TypePremium HMOF$2,300 per month HMOI$1,040 per month PPOF$1,755 per month PPOI$897 per month DISF$457 per month

Life Insurance Rules (A range or interval lookup) If the employee wants life insurance, then the premium is calculated as follows: – Insurance Rate is based on salary: Up to $50,000, premium is $250 per year From $50,001 to $70,000, premium is $350 per year From $70,001 to $90,000, premium is $475 per year From $90,001 to $110,000, premium is $545 per year CS1100Lookup and Error Processing7

Table Lookup There are two Excel functions for looking up values in a table: – VLOOKUP Table is arranged as columns – HLOOKUP Table is arranged as rows Both functions support exact or range lookup. CS1100Lookup and Error Processing8

VLOOKUP Table Setup Let’s start by building a lookup table to get the health insurance premium. CS1100Lookup and Error Processing9 This table can optionally be turned into a named range for easier referencing. Assignment: Turn range A2:B6 into the named range HealthRates Lookup value in column 1 Result value in column 2

VLOOKUP Parameters General form of VLOOKUP: VLOOKUP (lookup_value, table_array, col, [option]) Definitions of the VLOOKUP parameters: – lookup_value: value to be used as a key into the table_array – table_array: table of values where first column is key – col: column to be returned as value of VLOOKUP – option: FALSE = exact match, TRUE = approximate (or interval/range) match CS1100Lookup and Error Processing10

Using VLOOKUP CS1100Lookup and Error Processing11 =VLOOKUP (F2, HealthRates, 2, FALSE)

VLOOKUP Table Setup Rules The lookup value (key value) must be in the first column. For an exact match lookup, the key values can appear in any order For an approximate (or range) lookup, the values must start with the smallest value CS1100Lookup and Error Processing12

HLOOKUP Table Setup HLOOKUP is similar to VLOOKUP except that the table is set up horizontally: CS1100Lookup and Error Processing13

HLOOKUP Parameters General form of HLOOKUP: HLOOKUP (lookup_value, table_array, row, [option]) Definitions of the HLOOKUP parameters: – lookup_value: value to be used as a key into the table_array – table_array: table of values where first column is key – row: rowto be returned as value of HLOOKUP – option: FALSE = exact match, TRUE = approximate (or interval/range) match CS1100Lookup and Error Processing14

Using HLOOKUP Using HLOOKUP is very similar to VLOOKUP: CS1100Lookup and Error Processing15 =HLOOKUP (F2, HealthRates, 2, FALSE)

Range or Interval Lookups So far we have looked up values that are either found in the lookup table or not. Some applications requires numeric intervals or ranges. For example, in a grading model, grades are assigned to ranges of scores. – 93 – 100 = A – 90 – 92 = A- and so forth CS1100Lookup and Error Processing16

Life Insurance Rules If the employee wants life insurance, then the premium is calculated as follows: – Insurance Rate is based on salary: Up to $50,000, premium is $250 per year From $50,001 to $70,000, premium is $350 per year From $70,001 to $90,000, premium is $475 per year From $90,001 to $110,000, premium is $545 per year CS1100Lookup and Error Processing17

Setting up VLOOKUP Intervals Insurance Rate is based on salary: – Up to $50,000, premium is $250 per year – From $50,000 to $69,999, premium is $350 per year – From $70,000 to $89,999, premium is $475 per year – From $90,000 to $109,999, premium is $545 per year CS1100Lookup and Error Processing18

Reading the VLOOKUP Table An interval lookup table only “codes” part of the interval, not both ends. The table MUST start with the smallest value because the search stops once the value fits the range. CS1100Lookup and Error Processing19 From To Value

Using VLOOKUP with Intervals CS1100Lookup and Error Processing20 =VLOOKUP (C2, LifeRates, 2, TRUE)

MANAGING ERRORS Excel Basics CS1100Lookup and Error Processing21

Lookup Errors What happens when VLOOKUP cannot find the value? – Returns error #N/A Use IFERROR to detect errors and provide an alternative. CS1100Lookup and Error Processing22

Catching Errors Models can contain errors, such as: – Divide by 0 – Lookup value not found – Substring not found To test if a function returns an error, use IFERROR. CS1100Lookup and Error Processing23

Using IFERROR IFERROR works almost like IF, except that there’s no condition to test: =IFERROR (value, value_if_error) Using IFERROR with VLOOKUP: =IFERROR (VLOOKUP(F2,HealthRates,2,FALSE), 0) CS1100Lookup and Error Processing24