1 / 53

Microsoft Excel Models and Functions

Microsoft Excel Models and Functions. ACCT 5329. Microsoft Excel Models and Functions. You will need to download the ExcelExample.xslx file from WebCT to work through the examples in this presentation. Microsoft Excel Models. What-If and Goal Seek. What-If Analysis.

rduque
Download Presentation

Microsoft Excel Models and Functions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microsoft Excel Models and Functions ACCT 5329

  2. Microsoft Excel Models and Functions • You will need to download the ExcelExample.xslx file from WebCT to work through the examples in this presentation

  3. Microsoft Excel Models What-If and Goal Seek

  4. What-If Analysis • Relies on the ease of copying your model and changing various input variables • Least formal method for solving a problem • Copy the input variables and formulas multiple times • Then vary input variables until you reach a suitable solution • See the What-If-GoalSeek tab in the Excel worksheet

  5. Creating a Two-Variable What-If Table • Enter a formula that points to at least two variable cells in the upper left corner of the table. • Along the left column of the table, enter various values for one of the inputs. • Along the top row of the table, enter various values for the other input variable. • Select the entire table. • From the Data Ribbon, select Data Tools, What-If Analysis, Data Table

  6. Creating a Two-Variable What-If Table • In the Data Table dialog box, enter a row input cell and a column input cell. • Select the Term cell (B15) as the row input cell • Select the Price cell (B14) as the column input cell • Click OK. Excel will fill in the monthly payment in the table using the price in the column and the terms in the top row.

  7. Apply Conditional Formatting to What-If Table • Highlight just the data in the What-If Table. • From the Home ribbon, select the Conditional Formatting drop-down box, then Highlight Cell Rules, then Between • Type in your values in the dialog box, select the highlight type from the drop-down box and Click OK.

  8. Goal Seek • Used to quickly and easily hone in on a ‘target’ value • Steps using the Car Purchase Example on the What-If-GoalSeek tab • Select the answer cell. In this example, it would be the payment in Cell B40 • From the Data Tools group of the Data ribbon, select the What If Analysis drop-down and then choose Goal Seek. The Goal Seek dialog box appears as shown below

  9. Goal Seek Steps • In the Goal Seek dialog, indicate that you want to set the answer cell to a particular value by changing a particular input cell. • In this example, you want to set Cell B40 to the value of $695 by changing Cell B37. Excel quickly tries to hone in on a value. When Excel gets to within a penny of the value, the Goal Seek Status dialog appears as shown below • This dialog reports that it was trying to reach a target value of $695 and was able to reach that value. • The worksheet then shows the proposed price of $36,828.54 in Cell B37.

  10. Goal Seek Not For All Problems • Goal Seek needs a clear mathematical relationship between the starting and ending cells

  11. Microsoft Excel Functions VLOOKUP

  12. VLOOKUP • Vertical lookup – one of the most powerful and most used functions in Excel • VLOOKUP allows you to perform the equivalent of a join operation in a database • VLOOKUP tab in the examples worksheet

  13. VLOOKUP • Setting up the Lookup Table: • Build a table showing the scores where the grading scale changes from one grade to the next • The table has to be sorted in ascending order • Make sure your lookup values are in the leftmost column of your lookup table as Excel searches the first column for the appropriate value

  14. VLOOKUP • Entering the VLOOKUP formula • We are looking up the Grade, so the formula will be entered into the cells in column C • Syntax • VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]) • The value we are looking up is the student score in column B, so in Cell C2 enter =VLOOKUP(B2, • The 2nd argument is the lookup table, so enter the range making sure to use an absolute range (press F4) or use a predefined range name. =VLOOKUP(B2, $E$2:$F$6, • The 3rd argument specifies which column of the lookup table should be returned. =VLOOKUP(B2, $E$2:$F$6, 2 • The 4th argument is TRUE or simply omitted as we are using the sorted range variety of lookup. =VLOOKUP(B2, $E$2:$F$6, 2)

  15. VLOOKUP • Using VLOOKUP with FALSE to find an exact value • Use the second table on the VLOOKUP tab • The manager wants to see the sales rep names on the report • Create the VLOOKUP function to lookup the Sales Rep name

  16. VLOOKUP • To recap, • Two versions of the VLOOKUP formula that behave very differently: • VLOOKUP with FALSE as the fourth parameter looks for an exact match, and • VLOOKUP with TRUE as the fourth parameter looks for the closest (lower) match. • The lookup table must sorted using the TRUE parameter, but in the FALSE version the table can be in any sequence

  17. VLOOKUP • Using VLOOKUP to match two lists • Use table on VLOOKUP2 tab

  18. VLOOKUP • Create the VLOOKUP formula to compare the two lists • Hint: The formula in Cell D5 should look at the value in Cell C5 to see if that person is in the approved list. • For any cells in Column D that contain a name, it means that the person was on the Approved Customer List. If the result is #N/A, you know that a sales was made to a non-approved customer • Create a VLOOKUP function to find approved customers that have made a purchase

  19. Microsoft Excel Functions COUNTIF, SUMIF, AVERAGEIF

  20. SUMIF, COUNTIF, AVERAGEIF • SUMIF(range, criteria, sum_range) • Adds the cells specified by the given criteria • COUNTIF(range, criteria) • Counts the number of cells within a range that meet the given criteria • AVERAGEIF(range, criteria, [average_range]) • Returns the average (arithmetic mean) of all the cells in a range that meet the given criteria

  21. SUMIF, COUNTIF, AVERAGEIF • Using the table in the ___IF tab in the example worksheet, complete the count, total, and average columns for each division

  22. SUMIFS, COUNTIFS, AVERAGEIFS • In Excel 2007, new versions of SUMIF, COUNTIF, and AVERAGEIF that can handle unlimited multiple conditions • SUMIFS(sum_range, criteria_range1, criteria1[,criteria_range2, criteria2…]) • COUNTIFS(range1, criteria1[,range2, criteria2…]) • AVERAGEIFS(average_range, criteria_range1, criteria1[,criteria_range2, criteria2…])

  23. SUMIFS, COUNTIFS, AVERAGEIFS • Using the table in the ___IFS tab in the example worksheet, complete the count, total, and average columns by region and division

  24. Microsoft Excel Pivot Tables

  25. Pivot Tables • A data summarization tool • Best created from transactional data • Users can create any number of views of the data such as: • Breakdown of sales by product • Sales by month, this year versus last year • Percentage of sales, by customer • Customers who bought product XYZ in the Midwest region • Sales by product, by month • Top five customers, with products • etc.

  26. Pivot Tables • Rules for Pivot Table data: • Make sure each column has a unique one-cell heading • Do not allow blank cells in a numeric column (use zeros instead) • Do not use blank rows or blank columns • Make sure no summary data is missing • Remove any embedded totals from the data • Remove any formulas from the data • Data with month (or years) spread across many columns will need to be converted to a columnar format

  27. Creating a Pivot Table • On the PivotTable tab in the example spreadsheet, Select one cell in the data. • From the Insert ribbon, click the PivotTable icon in the Tables group. • Excel displays the Create PivotTable dialog box. Excel’s IntelliSense should have chosen the correct range for the data. • Choose to place the PivotTable in a New Worksheet.

  28. Creating a Pivot Table • The PivotTable Field List box: • Can be toggled on and off by using the Show/Hide – Field List in the Options ribbon (see next slide for exact location) • The drop-down icon offers five different views of the Field List box

  29. Creating a Pivot Table • To create the pivot table, simply use the PivotTable Field List box to check which fields to include in the table. • Excel makes fairly intelligent guesses based on the field type and build a passable table. • You can then make adjustments to perfect the table.

  30. Creating a Pivot Table • Using ExcelExamples.xlsx, create a Pivot Table. • In the PivotTable Field List box, check the Region, Product, and Revenue boxes. • Notice that Excel adds a new field called Sum of Revenue to the ∑ Values section of the Field List box because the field is numeric. • Excel moves Region and Product to the Rows Labels section of the Field List box. • Excel also adds subtotals for each Region and a Grand Total at the end.

  31. Creating a Pivot Table

  32. Creating a Pivot Table • It would be easier to read the table if the Region field went across the columns with a total for the three regions in last column. • No problem! • Change the default layout of the pivot table • Move Region from the Row Labels section of the Field List box to the Column Labels section • To do this, either: • Drag and drop the Region field from the Row Labels section to the Column Labels section • Click the Region drop-down and select Move to Column Labels

  33. Creating a Pivot Table • Formatting the numeric fields *** Don’t be tempted to format the cells as you would any other worksheet as a Pivot Table is very fluid *** • Instead you want to ‘tell’ Excel that a particular field should always have the format $#,##0. • Click on the drop-down in the Sum of Revenue field in the ∑ Values section of the Field List box and select Value Field Settings from the menu. • Click the Number Format button and choose the appropriate format from the list

  34. Creating a Pivot Table • Voila!

  35. Adding New Fields to the Pivot Table • In the Field List box, check the Customer field. • Excel adds the field to the Row Labels. • Try rearranging the fields until you get a table like you want. • However you arrange the fields, you will have a lot of blank cells.

  36. Eliminating Blank Cells From a Pivot Table • To override the blank settings, on the PivotTable Tools – Options ribbon, choose the Options icon in the PivotTable group. • On the Layout & Format tab, for the For empty cells show: setting change the value to a zero.

  37. Eliminating Blank Cells From a Pivot Table

  38. Pivot Table Legacy Mode • For those who prefer the Excel 95 – Excel 2003 pivot table interface which allowed dragging and dropping fields right onto the pivot table, there is a way. • To go back to that mode: • Create a Pivot Table • On the PivotTable Tools – Options ribbon, choose the Options icon from the PivotTable group. • In the Pivot Table Options dialog box that appears, go to the Display tab and choose Classic PivotTable Layout (enables dragging of fields in the grid).

  39. Microsoft Excel Relative vs. Absolute Cell References

  40. Relative and Absolute Cell References • Excel’s ability to change cell references in formulas is called relative referencing. • Using two dollar signs, for example $G$3, indicates an absolute reference to G3. No matter where you copy the formula, the reference will always be to cell G3.

  41. Mixed References • i.e., using only one $ sign. • To allow the column to change, place the $ sign after the cell letter. • To allow the row to change, place the $ sign before the cell letter.

  42. Microsoft Excel Logical Functions

  43. IF • Syntax • IF(logical_text, value_if_true, value_if_false) • Uses the comparison operators =, >, <, >=, <=, <> • When reading an IF function, think of the first comma as the word then, and the second comma as the word otherwise (or else). • Using ExcelExample2.xlsx, complete the example on the IF tab.

  44. AND • Used if you need to test for two or more conditions. • Syntax • AND(logical1, logical2,…) Where logical1, logical2, … are from 1 to 255 expressions that evaluate to either TRUE or FALSE. The function returns TRUE only if all arguments are TRUE. • Using ExcelExample2.xlsx, complete the example on the AND tab.

  45. OR • Used for situations in which a certain formula is based on meeting one of several conditions. • Syntax • OR(logical1, logical2, …) Where logical1, logical2, … are from 1 to 255 expressions that can evaluate to TRUE or FALSE. The function returns TRUE if any arguments are TRUE. • Using ExcelExample2.xlsx, complete the example on the OR tab.

  46. Nested IF • The IF function offers only two possible formulas. Either the logical test is TRUE and the first formula is used or the logical test is FALSE and the second formula is used. • Many situation have a series of choices, thus we use nested IF functions. • Using ExcelExample2.xlsx, complete the examples on the Nested IF tabs.

  47. Nested IF • Hints for employee raise example: • Test for the highest condition first: IF(C2>=4.5, … • Instead of using a value as the third argument, start a second IF function to be used if the first test is FALSE: IF(C2>=4, … • Start a third IF functions to be used as the value_if_false argument for the second IF function: IF(C2>=3.5, … • Create the fourth IF function: IF(C2>=2.5, … • With the four IF functions, be careful to provide four closing parentheses at the end of the function.

  48. Microsoft Excel Macros

  49. Checking Security Settings • Enabling VBA Security • Select File, Excel Options to open the Excel Settings dialog. • Under the Top options for working with Excel (Popular button), Click the Show Developer Tab in the Ribbon checkbox. • Click OK to exit. • On the Developer tab, click Macro Security in the Code group. The Security dialog appears. • Make sure the Disable All Macros with Notification radio button is chosen. Excel will alert you whenever you are opening a workbook that has macros attached. • When you open a document and get the warning that the document has macros attached, click Enable to enable the macros.

  50. Recording a Macro • Before starting to record a Macro, think about how to break the task into easily repeatable steps • Plan out your macro before recording it. Think about the steps you need to perform.

More Related