VLOOKUP Better if we have more than two options to select from Corresponding letter grade of numeric grade Must have an accompanying lookup table VLOOKUP(x,y,z) x = cell containing value to lookup y = table range (top left and bottom right corners) z = column in table containing the result to write --- always 2 Table must be organized in ascending order from smallest to largest One table entry must match the values being looked up Direct match (equal one of the values) Bounds match (table gives lower bounds of ranges) Once the we get the value of the last cell before we cross the boundaries of range of the given value
SHOW “GRADES.XLS” FILE - TRY VLOOKUP WITH TABLE NAME
Review Power of Spreadsheets derives from Automatically reapplies formulas as data changes Automatically adapts formulas when copied to new cells Given that F11 = G23+E22*$F$2 What would L34 be if the same formula is copied there? M46 + K45*$F$2 A20? B32+#REF!*$F$2
Multiple Sheets A workbook can have many worksheets 3 initially: Sheet1, Sheet2, and Sheet3 Click on the tab for a sheet brings it to the foreground Add new sheets Right on the sheet tab Insert Delete sheets by clicking on their tab Right on the sheet tab Delete Rename sheets Right on the sheet tab Rename (ONE WORD) Rearrange sheets Click on tab, hold down the button, and drag the tab to desired location
Multiple Sheets When a cell referenced in a formula by row and column (e.g. C5) in current worksheet Reference cells in different sheets, add the sheet name followed by ! Make sure sheet name is a valid variable (1 string with no spaces) Sheet2!C5 Place table on different sheet in grades.xls
Cell Naming A frequently used cell can be named so as not to have to refer to it by its address all the time Type in name in Name Box Hit Enter A range of cells can also be named similarly by selecting it and proceeding as above If you select a row or column with a title, the title is suggested by default
Sorting Much easier than VB On a single column Click on a cell in that column Click on Ascending or Descending sort buttons under SORT AND FILTER in the EDITING group Information in ALL contiguous columns will be moved accordingly To sort only specific columns, highlight desired area and press desired button Data Sort On more than one column Sort by table by total score DESC and then by student names ASC Sort on names ASC Sort on score DESC
Graphs Click on the INSERT ribbon and use one of the chart types in the chart collection Highlight the data we wish to have on the chart Select the type of chart You can preview your data on every chart Go to Layout Ribbon and add title, gridlines, and data labels Decide where to place chart On the Design Ribbon Click on the location button Notice how updating data changes the graph accordingly
Forecasting and Simulation Not only for data entry, nice formatting and calculating formulas Many functions for simulation and forecasting (whatif analysis) One of which is the Pmt function Returns the payment amount for a loan based on the interest rate and a constant payment schedule Some of the functions are: PMT(RATE, NPER, PV) RATE is the interest rate for the loan NPER is the number of payment periods for the loan PV is the present value or principal of the loan PMT ALWAYS NEGATIVE UNLESS PV is negative Show multisheetHousepmts.xls
Exercise SandwichShop.xls N:\CS130\handouts\JimExcel_Examples