building analytic applications using ms-excelkc.niitstaff.com/niitstaffupgrade/cg/iec track 3... ·...

46
©NIIT Building Analytic Applications Using Excel 1 Building Analytic Applications Using MS-Excel

Upload: others

Post on 12-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 1

Building Analytic Applications Using MS-Excel

Page 2: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

2 Building Analytic Applications Using Excel ©NIIT

Table of Contents Introduction

Rationale ..................................................................................................................................................................3 Course Objectives ..................................................................................................................................................4 Entry Profile............................................................................................................................................................5 Exit Profile...............................................................................................................................................................6 Recommended System Configuration ...............................................................................................................7 Implementation Manual .......................................................................................................................................9 Session-Wise Inputs .............................................................................................................................................11

Session One........................................................................................................................................................11 Session Two.......................................................................................................................................................18 Session Three.....................................................................................................................................................25 Session Four.......................................................................................................................................................31 Session Five .......................................................................................................................................................34 Session Six .........................................................................................................................................................39 Session Seven ....................................................................................................................................................42

Page 3: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 3

RATIONALE

Why This Module MS-Excel is one of the most widely used enterprise level application. It can be ported and integrated with other enterprise level applications MS-Access, MS-Outlook, and MS-Word. After completing this course, students will be able to appreciate and develop an application using MS Excel. MS Excel being a popular application is used in business units. The students will be exposed to the key features of the product.

Page 4: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

4 Building Analytic Applications Using Excel ©NIIT

COURSE OBJECTIVES

After completing this course, students will be able to:

Analyze data in business operations

Represent data graphically

Analyze data using pivot tables

Automate business operations using VBA

Create business applications using VBA objects

Customize charts and PivotTables

Secure and package applications

Page 5: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 5

ENTRY PROFILE

Target audience is the learner with the knowledge of any Windows OS, which includes the basic understanding of a hardware and desktop PC. In addition, the students should have:

Should have Completed Class XII

Should be able to understand and converse in English.

Working knowledge of any programming language.

Basic knowledge of Excel: features of excel, rows, columns, cells, how to write a formulas, relative and absolute referencing, formatting of cells, chart creation.

Page 6: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

6 Building Analytic Applications Using Excel ©NIIT

EXIT PROFILE

At the end of this course, the students will be able to create and manage a database, modify tables and relationships, create queries and analyze data for a business organization using MS Access. The student will be able to develop solutions to simple business needs with Advanced Excel and Visual Basic for Applications as enabling tools. At the end of this unit the student will be able to:

Work on the advanced features of Excel

Develop code using VBA programming

Use Excel and VBA programming knowledge in common business applications like Inventory, Payroll and Finance

Page 7: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 7

RECOMMENDED SYSTEM CONFIGURATION

# TYPE MR OCR

1 # Machines

1.1 Faculty Node 1 NA

1.2 Server NA NA

1.3 Student Nodes <Depends on the Class room setup>

<Depends on the Class room setup>

2 H/w Configuration

2.1 Faculty Node 333 MHz Pentium Processor, 256 MB RAM, 10 GB HDD, 1.44 FDD, NIC

NA

2.2 Server NA NA

2.3 Student Nodes 333 MHz Pentium Processor, 256 MB RAM

333 MHz Pentium Processor, 256 MB RAM

2.4 Printer Network or Shared printer Network or Shared printer

3 S/w Configuration

3.1 Faculty Node • Multi boot with: Windows 98, Windows XP, and Windows 2000

• Since Win98 is also required, it is recommended that primary partition be kept as FAT.

• MS PowerPoint (to run the slide shows)

NA

3.2 Server NA NA

3.3 Student Nodes NA

(The course methodology does not require students to practice in the OCR sessions.)

NA

Page 8: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

8 Building Analytic Applications Using Excel ©NIIT

# TYPE MR OCR

4 Network Configuration

TCP/IP

TCP/IP

Page 9: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 9

IMPLEMENTATION MANUAL

Installing MS Office 2000 Professional The steps to install MS Office 2000 Professional are as follows:

1. Insert the MS Office 2000 Professional CD in the CD drive and double click the CD drive to run the CD. You are lead to the first screen of the installation wizard for MS Office 2000. Click Next to begin the installation.

2. You are led to the license and support information screen. Select the 'I accept the terms in the License

agreement' radio button. Click Next to continue.

3. In the next screen, click the 'Install Now' icon. The installation process of MS office 2000 begins.

Page 10: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

10 Building Analytic Applications Using Excel ©NIIT

4. You can check the progress of the installation from the 'Installing Microsoft Office 2000' progress bar.

5. At the end of the installation, you get a message stating the successful setup of MS Office 2000

Professional. Click Ok to confirm the installation.

After a successful installation, to open any of the office applications, you need to type the the CD key in the screen similar to the first screen of the installation wizard. This screen automatically appears when you click any of the Office applications for the first time after installation of MS Office 2000 Professional. The CD key is given along with the MS Office 2000 Professional CD pack.

Page 11: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 11

SESSION-WISE INPUTS

Session One

Session Aim This session will help the student analyze data in business operations using the mathematical, logical, and statistical functions.

Session Plan This session will cover Chapter 1.

Topic/Activity Name Time Input Data File Solution Data file

Chapter 1: Objectives 5

Chapter 1: Processing Data Using Mathematical and Logical Functions

20

Chapter 1: Problem Statement 1.1 (Practice)

10 Data Files for Student/OCR/OCR1/ PS1.1.xls

Data Files for Faculty/ OCR/Solution/OCR1/ PS1.1.xls

Chapter 1: Processing Data Using Mathematical and Logical Functions (Demonstration)

10 Data Files for Faculty/ OCR/Input/OCR1/ D1.1.xls

Data Files for Faculty/ OCR/Solution/OCR1/ D1.1.xls

Chapter 1: Problem Statement 1.2 (Practice)

10 Data Files for Student/ OCR/OCR1/ PS1.2.xls

Data Files for Faculty/ OCR/Solution/OCR1/ PS1.2.xls

Chapter 1: Predicting Trends Using Statistical Functions

30

Chapter 1: Problem Statement 1.3 (Practice)

20 Data Files for Student/ OCR/OCR1/ PS1.3.xls

Data Files for Faculty/ OCR/Solution/OCR1/ PS1.3.xls

Summary 5

Total Time 110

Demonstration means the activity has to be done by the Faculty in the OCR. Practice means the activity has to be done by the student in the OCR.

Page 12: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

12 Building Analytic Applications Using Excel ©NIIT

Session Handling Inputs Initiate a discussion on how the business of a company is dependent on data analysis. Provide an example of a monthly sales report of a company and how the company takes decisions based on the data representation of the sales report using Excel. Drive the discussion to help students understand the importance of data analysis in business scenarios.

Processing Data Using Mathematical and Logical Functions • Take the discussion further ahead by explaining how business data can be analyzed with the help of

Excel functions. Give examples of some commonly used mathematical functions. • Introduce the Problem Statement 1.1 and the corresponding Task to the students. • Ask the students to calculate the total sales for the previous month and compute the profit for each book

category. Provide the students with the data file of this task. • Conclude the exercise by demonstrating the correct solution. • Demonstrate the usage of the sub-total function. Refer to the file, Data Files for the

Faculty/OCR/OCR1/ D1.1.xls. • Ask the students how logical functions help in adding decision-making features to the data. • Introduce the Problem Statement 1.2 and the corresponding Task to the students. • Ask the students to perform the Task. Provide the students with the data file. • Conclude the exercise by demonstrating the correct solution. • Summarize the topic by stating the key learning. • Ask students to go through the additional mathematical functions given in the Appendix.

Additional Information Mathematical Functions CountA: This function returns the number of entries in the selected range of cells. It counts each cell that contains number data or text data.

• Blank entries are not counted. • Text entries are counted.

Syntax: =countA(A1:A10) Frequency: This function can analyze a series of values and summarize them into a number of specified ranges. For example the heights of some children can be summarized into four categories:

• Less than 150cm • 151 - 160cm • 161 - 170cm • More than 170cm

The frequency function has two arguments: • The range of cells containing values to be analyzed • The range of cells containing the upper values of each group banding

Syntax: =Frequency(A3:A120, B6:B10) SUBTOTAL This function returns a sub total from a list or a dataset. SUBTOTAL function automatically summarizes data by calculating the sub totals and the grand total. To use the function the column, for which the subtotal has to be calculated, should be sorted. The syntax for the function is: =SUBTOTAL(Function_Num, ref1, ref2…) ‘Function_Num’ refers to number 1 to 11 which specifies the function that would be used for calculating the sub total in a list.

Function_Num Function

1 AVERAGE 2 COUNT 3 COUNTA 4 MAX 5 MIN

Page 13: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 13

Function_Num Function

6 PRODUCT 7 STDEV 8 STDEVP 9 SUM 10 VAR 11 VARP

‘Ref1, ref2…’ refers to the ranges or columns for which the subtotal has to be calculated. In addition to using this function by manually writing the formula, you can also calculate subtotal from the Subtotal option in the Data menu option. Consider the example. John Barett, working in the sales department of Books Treasure, Inc. has to submit the sales report for the day. In addition to the total sales, he also has to calculate the total sales for each books category. John calculates the category-wise total sales by using the SUBTOTAL function. To calculate the category-wise sales using the SUBTOTAL function, perform the following steps:

1. To summarize the total sales for each book category, sort the data by the book category column. 2. To insert automatic subtotals for the book category column, click a cell in that cloumn and select Data

Subtotals from the menu option. The Subtotal dialog box is displayed. 3. To select the cloumn to be sub totaled, select the cloumn heading from the At Each Change In box and

click tke OK button. The sub totals are displayed for total sales per day for each book category along with the grand total. SUBTOTAL function automatically creates an outline, which can be expanded to show all the details, or contracted to show just the book category sub totals. Thus the SUBTOTAL function is useful for summarizing the data. The summary can be used for calculating the sum, average, stdev and many more functions.

Predicting Trends Using Statistical Functions • Introduce the Problem Statement 1.3 and the corresponding task to the students. • Ask the students to perform the task. Provide the students with the data file. • Conclude the exercise by demonstrating the correct solution. • Emphasize that data can be predicted in another method by using the FORECAST function. • Ask the students the following questions:

What is standard deviation? Why do you think standard deviation is an important statistic tool? How is standard deviation different from coefficient of variation?

• Demonstrate how the HR department of Books Treasure, Inc. uses the STDEV function of Excel to compute the deviation of the compensation packages of all employees in the same role. Refer to the topic “Calculating Standard Deviation” to give the demonstration.

• Provide additional information on STDEVPA and STDEVA. • Summarize the session by stating the key learning.

Additional Information Standard Deviation Standard deviation specifies how tightly a set of values is clustered around the average of the values. It is a measure of dispersal or variation in a group of numbers. The standard deviation is an absolute measure of dispersion. Absolute measure of dispersion is expressed in the same statistical unit as the original data. These values are used to compare the variation in two distributions provided the variables are expressed in the same units and are of the same average size. The standard deviation is always computed from the arithmetic mean. Standard Deviation may be computed in two ways:

1. By taking deviations of the items from the actual mean. 2. By taking deviations of the items from the assumed mean.

STDEV is used when the group of numbers being evaluated is only a partial sampling of the whole population. STDEVP This function is used for calculating standard deviation. It is used when the group of numbers being evaluated is the entire population of values. P in STDEVP stands for "population". Since the data set is constituted of all the actual values, this standard deviation function can return a more precise result.

Page 14: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

14 Building Analytic Applications Using Excel ©NIIT

STDEVA This function estimates standard deviation based on a sample. The standard deviation is a measure of how widely values are dispersed from the average value (the mean). Text and logical values such as TRUE and FALSE are included in the calculation. STDEVPA This function calculates standard deviation based on the entire population given as arguments, including text and logical values. Coefficient of Variation Coefficient of Variation = Standard Deviation / Mean The coefficient of variation is the ratio of a measure of absolute dispersion to an average. It is sometimes called a measure of relative dispersion or coefficient of dispersion because coefficient means a pure number that is independent of the unit of measurement. This measure is used in problems where the variability of two or more series has to be measured. The series for which the coefficient of variation is greater is less consistent or less uniform. If the coefficient of variation is less, then the series is more consistent or uniform. Forecast You can use this function to predict future sales, inventory requirements, or consumer trends. This function is similar to the Trend function, with the only difference being that in Forecast() there is no constant value used. The FORECAST() function of Excel also uses the best-fit line to forecast a predicted value y for a given value x. =FORECAST(x value, known y’s, known x’s) Here x is the data point for which you want a prediction, known y’s are the dependent variables and known x’s are the independent variables. Date and Time Functions There are various functions in Excel that allow you to manipulate date and time and perform calculations on them. The dates are stored as numeric values and therefore it is simple to perform calculations upon them. Addition and subtraction can be done where to add 1 is to add a day to a value. The year, month or day element of a date can be derived from applying functions to a date value. There are also similar time functions: HOUR, MINUTE, SECOND Some date functions are: =NOW() =MONTH() =DAY() =DATE() =YEAR() The DATEDIF() function allows you to calculate the exact age between two dates. This will enable you to display the precise age of a person and can be incorporated in a long formula to give a result such as: 'Your age is 23 years, 4 months and 6 days'. VLOOKUP The VLOOKUP formula returns a value from a cell in one of the table columns. The letter V at the beginning of the formula is an abbreviation for vertical. VLOOKUP searches for a value in the leftmost column of a table and then returns a value in the same row from a column you specify in the table. VLOOKUP works with a list where the table arguments are sorted, and you get the closest match to a table argument that does not exceed your lookup value. Syntax: =VLOOKUP (lookup_value, table_array, col_index_num, range_lookup) ‘lookup_value’ is the value present 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. You can put the values in ascending order by choosing the Sort command from the Data menu and selecting Ascending. The values in the first column of table_array can be text, numbers, or logical values. ‘Col_index_num’ is the column number in table_array from which the matching value must be returned. For example, a col_index_num of 1 returns the value in the first column in table_array and a col_index_num of 2 returns the value in the second column in table_array. 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

Page 15: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 15

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 range_lookup is TRUE, the values in the first column of table_array must be placed in ascending order. If range_lookup is FALSE, table_array does not need to be sorted.

Page 16: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

16 Building Analytic Applications Using Excel ©NIIT

Practice Questions 1. In a worksheet, all the commission values should be written as whole numbers. Which function should

you use? a. Power b. SQRT c. Round d. INT

Answer: c 2. How many levels of If conditions can you have in a Nested If function?

a. 30 b. 5 c. 7 d. Unlimited

Answer: c 3. Which function is used to measure the daily variation in the stocks and share prices?

a. Forecast b. Growth c. STDEV d. Trend

Answer: c

Page 17: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 17

Machine Room This session will cover Chapter 1 (Exercises 1-7)

Exercise 1 Input Data File: Data Files for Students/MR/MR1/L1_Ex1.xls Solution Data File: Data Files for Faculty/MR/MR1/L1_Ex1.xls Please refer to Topic Computing Data

Exercise 2 Input Data File: Data Files for Students/MR/MR1/L1_Ex2.xls Solution Data File: Data Files for Faculty/MR/MR1/L1_Ex2.xls Please refer to Topic Computing Data

Exercise 3 Input Data File: Data Files for Students/MR/MR1/L1_Ex3.xls Solution Data File: Data Files for Faculty/MR/MR1/L1_Ex3.xls Please refer to Topic Presenting Information data

Exercise 4 Input Data File: Data Files for Students/MR/MR1/L1_Ex4.xls Solution Data File: Data Files for Faculty/MR/MR1/L1_Ex4.xls Please refer to Topic Predicting Trends

Exercise 5 Input Data File: Data Files for Students/MR/MR1/L1_Ex5.xls Solution Data File: Data Files for Faculty/MR/MR1/L1_Ex5.xls Please refer to Topic Estimating Variance

Exercise 6 Input Data File: Data Files for Students/MR/MR1/L1_Ex6.xls Solution Data File: Data Files for Faculty/MR/MR1/L1_Ex6.xls Please refer to Topic Computing Data

Exercise 7 Input Data File: Data Files for Students/MR/MR1/L1_Ex7.xls Solution Data File: Data Files for Faculty/MR/MR1/L1_Ex7.xls Please refer to Topic Microsoft Help

Page 18: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

18 Building Analytic Applications Using Excel ©NIIT

Session Two

Session Aim This session will help the student to analyze data in business operations and represent data graphically.

Session Plan This session will cover Chapter 1 and Chapter 2.

Topic/Activity Name Time Input Data File Solution Data file

Chapter 1: Objectives 5

Chapter 1: Optimizing Financial Investment Decisions

25

Chapter 1: Problem Statement 1.4 (Practice)

10 Data Files for Student/ OCR/OCR2/ PS1.4.xls

Data Files for Faculty/ OCR/Solution/OCR2/ PS1.4.xls

Chapter 1: Problem Statement 1.5 (Practice)

10 Data Files for Student/ OCR/OCR1/ PS1.5.xls

Data Files for Faculty/ OCR/Solution/OCR1/ PS1.5.xls

Chapter 1: Problem Statement 1.6 (Practice)

15 Data Files for Student/ OCR/OCR1/ PS1.6.xls

Data Files for Faculty/ OCR/Solution/OCR1/ PS1.6.xls

Chapter 1: Problem Statement 1.7 (Practice)

10 Data Files for Student/ OCR/OCR1/ PS1.7.xls

Data Files for Faculty/ OCR/Solution/OCR1/ PS1.7.xls

Summary 5

Total Time 80

Topic/Activity Name Time Input Data File Solution Data file

Chapter 2: Objectives 5

Chapter 2: Analyzing Data with Charts

5

Chapter 2: Creating 2-D Charts (Demonstration)

5 Data Files for Faculty/ OCR/Input/OCR2/ D2.1.xls

Data Files for Faculty/ OCR/Solution/OCR2/ D2.1.xls

Chapter 2: Problem Statement 2.1 (Practice)

5 Data Files for Student/ OCR/OCR2/ PS2.1.xls

Data Files for Faculty/ OCR/Solution/OCR2/ PS2.1.xls

Page 19: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 19

Topic/Activity Name Time Input Data File Solution Data file

Chapter 2: Problem Statement 2.2 (Practice)

5 Data Files for Student/ OCR/OCR2/ PS2.2.xls

Data Files for Faculty/ OCR/Solution/OCR2/ PS2.2.xls

Summary 5

Total Time 30

Session Handling Inputs Initiate a classroom discussion by explaining the optimization of the financial investment decisions. Specify how data analysis can be done using charts.

Optimizing Financial Investment Decisions • Give an overview of the role of finance functions in making investment decisions in projects. • Move the discussion around the following questions:

What do you understand by NPV? What do you understand by IRR? What is the role of NPV and IRR functions in making investment decisions? Do you always calculate both NPV and IRR while making an investment decision? Are there cases where you calculate only NPV or only IRR?

• Introduce the Problem Statement 1.4 and the corresponding Task to the students. • Ask the students to perform the Task. Provide the students with the data file. • Ask two or three students to present the solution before the class. Ask them to give the rationale for the

investment decision. • Build upon the explanation of the students and summarize the activity. • Introduce the Problem Statement 1.5 and the corresponding Task to the students. • Ask the students to perform the Task. Provide the students with the data file. • Conclude the exercise by demonstrating the correct solution. • Introduce the Problem Statement 1.6 and the corresponding Task to the students. • Ask the students to perform the Task. Provide the students with the data file. • Conclude the exercise by demonstrating the correct solution. • Initiate a discussion. Move the discussion around the What If Analysis function to arrive at the optimal

loan decision. • Introduce the Problem Statement 1.7 and the corresponding Task to the students. • Ask the students to perform the Task. Provide the students with the data file. • Conclude the exercise by demonstrating the correct solution. • Build upon the students’ explanation and summarize the topic by stating the key learning. • Ask the students to write a whitepaper on bonds and securities. Ask them to go through newspapers for

bond prices table. Tell them to base their research on the following questions: What are bonds and securities? How are bonds investments beneficial?

• Inform the students about the parameters involved to calculate bonds and securities with the help of the following functions – PRICE and ACCRINTM. Ask the students to through additional functions like INTRATE and RECEIVED

• Ask the students to submit the white paper at the end of the third session.

Demonstration means the activity has to be done by the Faculty in the OCR. Practice means the activity has to be done by the student in the OCR.

Page 20: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

20 Building Analytic Applications Using Excel ©NIIT

Additional Information Bonds and Securities If you are interested in buying or selling bonds, it's a good idea to start out by comparing the prices of similar securities. Just as you would with any important purchase, such as a home or a car, checking out the current prices of comparable bonds gives you a strong indicator of what your bond will cost to buy, or what you can expect to receive if you are selling a security. An easy place to check bond prices is in your morning newspaper, or in the financial media. Those papers have extensive tables showing representative bond prices in recent trades. You should recognize that the prices listed in the papers are snapshots; bond prices do fluctuate during the day so the price you're actually quoted may vary based on more current trading activity. The Internet has also become a rich source of information with many sites providing investor information about bonds. In finance and economics, a bond or debenture is a debt instrument that obligates the issuer to pay to the bondholder the principal (the original amount of the loan) plus interest. Thus, a bond is essentially an I.O.U. (I owe you contract) issued by a private or governmental corporation. The corporation "borrows" the face amount of the bond from its buyer, pays interest on that debt while it is outstanding, and then "redeems" the bond by paying back the debt. Bonds are securities but differ from shares of stock in that stock is an ownership interest (termed "equity"), but bonds are merely "debt": Therefore a shareholder is an owner, but a bond-holder is merely a creditor. (Securities are tradable interests representing financial value. They are often represented by a certificate. They include shares of corporate stock or mutual funds, bonds issued by corporations or governmental agencies, stock options or other options, other derivative securities, limited partnership units, and various other formal "investment instruments.”) Using Excel to Solve the Price of a Bond Problem

• Explain the parameters involved to calculate bonds and securities with the help of the following functions - PRICE, ACCRINTM

PRICE Returns the price per $100 face value of a security that pays periodic interest. If this function is not available, run the Setup program to install the Analysis ToolPak. After you install the Analysis ToolPak, you must enable it by using the Add-Ins command on the Tools menu. Syntax : PRICE(settlement,maturity,rate,yld,redemption,frequency,basis)

• Settlement is the security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer. Dates may be entered as text strings within quotation marks (for example, "1/30/1998" or "1998/01/30"), as serial numbers (for example, 35825, which represents January 30, 1998, if you're using the 1900 date system), or as results of other formulas or functions (for example, DATEVALUE("1/30/1998")).

• Maturity is the security's maturity date. The maturity date is the date when the security expires. • Rate is the security's annual coupon rate. • Yld is the security's annual yield. • Redemption is the security's redemption value per $100 face value. • Frequency is the number of coupon payments per year. For annual payments, frequency = 1; for

semiannual, frequency = 2; for quarterly, frequency = 4. • Basis is the type of day count basis to use.

Example: A bond has the following terms: February 15, 1991 settlement date November 15, 1999 maturity date 5.75% semiannual coupon 6.50% yield $100 redemption value Frequency in semiannual 30/360 basis The bond price (in the 1900 Date System) is: ACCRINTM Returns the accrued interest for a security that pays interest at maturity. If this function is not available, run the Setup program to install the Analysis ToolPak. After you install the Analysis ToolPak, you must enable it by using the Add-Ins command on the Tools menu. Syntax: ACCRINTM(issue,maturity,rate,par,basis)

• Issue is the security's issue date. Dates may be entered as text strings within quotation marks (for example, "1/30/1998" or "1998/01/30"), as serial numbers (for example, 35825, which represents January 30, 1998, if you're using the 1900 date system), or as results of other formulas or functions (for example, DATEVALUE("1/30/1998").

• Maturity is the security's maturity date. • Rate is the security's annual coupon rate. • Par is the security's par value. If you omit par, ACCRINTM uses $1,000. • Basis is the type of day count basis to use.

Example:

Page 21: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 21

A note has the following terms: April 1, 1998, issue date June 15, 1998, maturity date 10.0 percent coupon $1,000 par value Actual/365 basis The accrued interest (in the 1900 date system) is: ACCRINTM("4/1/1998","6/15/1998",0.1,1000,3) equals 20.54795 YIELD Returns the yield on a security that pays periodic interest. Use YIELD to calculate bond yield. If this function is not available, run the Setup program to install the Analysis ToolPak. After you install the Analysis ToolPak, you must enable it by using the Add-Ins command on the Tools menu. Syntax: YIELD(settlement,maturity,rate,pr,redemption,frequency,basis)

• Settlement is the security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer. Dates may be entered as text strings within quotation marks (for example, "1/30/1998" or "1998/01/30"), as serial numbers (for example, 35825, which represents January 30, 1998, if you're using the 1900 date system), or as results of other formulas or functions (for example, DATEVALUE("1/30/1998")).

• Maturity is the security's maturity date. The maturity date is the date when the security expires. • Rate is the security's annual coupon rate. • Pr is the security's price per $100 face value. • Redemption is the security's redemption value per $100 face value. • Frequency is the number of coupon payments per year. For annual payments, frequency = 1; for

semiannual, frequency = 2; for quarterly, frequency = 4. • Basis is the type of day count basis to use.

Example: A bond has the following terms: February 15, 1991 settlement date November 15, 1999 maturity date 5.75% coupon 95.04287 price $100 redemption value Frequency is semiannual 30/360 basis The bond yield (in the 1900 Date System) is: YIELD(33284,36479,0.0575,95.04287,100,2,0) equals 0.065 or 6.5%.

Analyzing Data with Charts • Initiate a discussion on scenarios where data is graphically represented.

Give instances of NDTV.com, which uses bar graphs to compare pollution level of the metropolitan cities and pie charts to indicate the vote count of different political parties.

Also give instances of magazines like Business Today and Economic Times that use stock graphs to depict market shares.

• Explain to the students the importance of series range and data range while creating a chart. Emphasize on the changes in the look of the chart when the series range is not inserted properly.

• Ask the students to identify similar situations where they have come across graphical representation of data.

• Provide an example of a column chart where a pizza chain charts its sales for the four quarters of 2004. Elaborate the example further by saying that in the same year, 2004, the pizza chain introduced stuffed and crust pizza and wish to impact this new product made on total sales. Tell the students that the data can be represented with the help of stacked column chart. Refer to the file, Data Files for the Faculty/OCR/OCR2/ D2.1.xls.

• Introduce the Problem Statement 2.1 and the corresponding Task to the students. • Ask the students to perform the Task. Provide the students with the data file. • Conclude the exercise by demonstrating the correct solution. • Introduce the Problem Statement 2.2 and the corresponding Task to the students. • Ask the students to perform the Task. Provide the students with the data file. • Conclude the exercise by demonstrating the correct solution. • Ask one of the students to present the solution before the class. • Build upon the presentation and demonstrate the solution before the class. • Summarize the Chapter by stating the tips and the key learning.

Page 22: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

22 Building Analytic Applications Using Excel ©NIIT

Practice Questions This session will cover Chapter 1 (questions 1-7) and Chapter 2 (questions 8 –13).

1. Which of the options is correct for making an optimal investment decision using NPV function? a. The investment is worthwhile if NPV is greater than zero. b. The investment is worthwhile if NPV is less than zero. c. The investment is worthwhile if NPV is equal to zero. d. The investment is worthwhile if NPV is greater than IRR.

Answer: a 2. Which of the following options is correct for making an optimal investment decision using IRR

function? a. The investment is worthwhile if IRR is greater than the discount rate. b. The investment is worthwhile if IRR is less than the discount rate. c. The investment is worthwhile if IRR is equal to the discount rate. d. The investment is worthwhile if IRR is greater than the NPV.

Answer: a 3. Which of the following financial function is used to calculate the monthly loan payment?

a. PV b. FV c. IPMT d. PMT

Answer: d 4. Which of the following is true for the Goal Seek Method?

a. The To Value box must be a formula. b. The Set Cell box must be a formula. c. The By Changing Cell box must be a formula. d. There is no formula for the Goal Seek Method.

Answer: b 5. Which of the following options are correct to differentiate between a pie chart and a doughnut chart?

a. A pie chart is different from the doughnut chart because of their respective shapes. b. A pie chart is different from the doughnut chart because a doughnut chart cannot be sliced into

pieces. A pie chart is different from the doughnut chart because a pie chart has one data series while

the doughnut chart has multiple data series. c. A pie chart is different from the doughnut chart because pie chart is a 3-D chart.

Answer: c 6. Which of the following are three-dimensional charts?

a. Bar Charts b. Column Charts c. Line Charts d. Cone Charts

Answer: d 7. Which of the following is true for data series?

a. If you delete a data series from a chart, the data values are not removed from the worksheet. b. If you delete a data series from a chart, the data values are removed from the worksheet. c. Data Series do not refer to data values. d. A bar graph is plotted by a single row/column of data series.

Answer: a 8. Which of the following is true for a Column chart?

a. Column chart shows trends or changes in data over a period of time. b. Column chart compares data items over a period of time. c. Column chart finds the optimum combinations between the two sets of data. d. Column chart shows the degree of relationships between numeric values in several data series.

Answer: b 9. How many data points are effective for line charts?

a. Five b. Four c. Three d. Two

Answer: a

Page 23: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 23

10. Which of the following options allow you to change the 3-D View of the chart? a. Width b. Elevation c. Gap d. Axes

Answer: b

Page 24: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

24 Building Analytic Applications Using Excel ©NIIT

Machine Room This session will cover Chapter 1 (Exercise 8, 9, and 10) and Chapter 2.

Exercise 1 Input Data File: Data Files for Students/MR/MR2/ L1_Ex8.xls Solution Data File: Data Files for Faculty/MR/MR2/ L1_Ex8.xls Please refer to Topic Analyzing Optimal Investment Decisions

Exercise 2 Input Data File: Data Files for Students/MR/MR2/ L1_Ex9.xls Solution Data File: Data Files for Faculty/MR/MR2/ L1_Ex9.xls Please refer to Topic Amortizing Loans

Exercise 3 Input Data File: Data Files for Students/MR/MR2/ L1_Ex10.xls Solution Data File: Data Files for Faculty/MR/MR2/ L1_Ex10.xls Please refer to Topic Amortizing Loans

Exercise 4 Input Data File: Data Files for Students/MR/MR2/ L2_Ex1.xls Solution Data File: Data Files for Faculty/MR/MR2/ L2_Ex1.xls Please refer to Topic Creating 2-D Charts

Exercise 5 Input Data File: Data Files for Students/MR/MR2/ L2_Ex2.xls Solution Data File: Data Files for Faculty/MR/MR2/ L2_Ex2.xls Please refer to Topic Creating 2-D Charts

Exercise 6 Input Data File: Data Files for Students/MR/MR2/ L2_Ex3.xls Solution Data File: Data Files for Faculty/MR/MR2/ L2_Ex3.xls Please refer to Topic Creating 3-D Charts

Page 25: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 25

Session Three

Session Aim This session will help the student analyze data using pivot tables.

Session Plan This session will cover Chapter 3.

Topic/Activity Name Time Input Data File Solution Data file

Chapter 3: Objectives 5

Chapter 3: Managing Data Using PivotTables (Demonstration)

10 Data Files for Faculty/ OCR/Input/OCR3/ D3.1.xls

Data Files for Faculty/ OCR/Solution/OCR3/ D3.1.xls

Chapter 3: Problem Statement 3.1 (Practice)

20 Data Files for Student/ OCR/OCR3/ PS3.1.xls

Data Files for Faculty/ OCR/Solution/OCR3/ PS3.1.xls

Chapter 3: Graphically Analyzing a PivotTable

30

Chapter 3: Problem Statement 3.2 (Practice)

20 Data Files for Student/ OCR/Input/OCR3/ PS3.2.xls

Data Files for Faculty/ OCR/Solution/OCR3/ PS3.2.xls

Summary 5

Total Time 110

Session Handling Inputs Initiate a classroom discussion by revising what you taught in the previous class. Relate the topics in this session with the previous classroom discussions.

Managing Data Using PivotTables • Introduce a PivotTable as a unique mode of analyzing and summarizing data with the help of an

example given below: Create a worksheet that contains name, address, age, occupation, department, phone number,

and postcode of the employees in an organization. Ask the students what will they do if they are asked to present the following information as a report:

How many employees have the same names? How many postcodes are the same? What is the count of a particular occupation? How many people belong to the same occupation? How many people have addresses of the same postcode?

Demonstration means the activity has to be done by the Faculty in the OCR. Practice means the activity has to be done by the student in the OCR.

Page 26: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

26 Building Analytic Applications Using Excel ©NIIT

• Tell the students that the easiest way to do this is using the Pivot Table. Present the information in accordance with the questions with the help of a pivot table. Let the students infer from the example the need for a pivot table.

• Refer to the file, Data Files for the Faculty/OCR/OCR3/ D3.1.xls. • Introduce the Problem Statement 3.1 and the corresponding Task to the students. • Ask the students to perform the Task. Provide the students with the data file. • While creating the reports the students might drag and drop the field buttons randomly leading to the

generation of incorrect reports. Guide the students while they are creating the Pivot Table. • Conclude the exercise by demonstrating the correct solution. • Demonstrate the solution before the class.

Demonstration for PivotTables

PivotTable • For example, how many people have the same names?

• How many postcodes are the same?

Page 27: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 27

• A count of a particular occupation

• See only people that match the information

• Find out the addresses of people that match a postcode

Graphically Analyzing a PivotTable • Ask the students the following questions:

What is a Pivot Chart? Why do you create a Pivot Chart?

• Introduce the Problem Statement 3.2 and the corresponding Task to the students. • Ask the students to perform the Task. Provide the students with the data file. • Conclude the exercise by demonstrating the correct solution. Sensitize the students to the fact that the

column or row headings in the worksheet data are used as series names. Series names appear in the chart legend.

• Summarize the section by stating the key learning. • Divide the students into three groups. Assign each group one of the following topics:

Creating Procedures Creating Conditional Procedures Creating Event-Driven Programming

Page 28: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

28 Building Analytic Applications Using Excel ©NIIT

• Ask the students to research on the topic assigned to their group and later compile their individual research work.

• Inform the students that they will present their research work before the class in fifth OCR. • Tell them that they can refer to the student guide for their research work.

Page 29: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 29

Practice Questions 1. Which of the following is True about PivotTable?

a. You need not specify any field in the Row section. b. Only one field can be used as a page field. c. You need not specify any field in the Data section d. A PivotTable is updated after using the Refresh Data option.

Answer: d 2. Which of the following defines a row field?

a. Row field helps to modify information. b. Row field helps to delete information. c. Row field helps to filter information. d. Row field helps to categorize information.

Answer: d 3. Which of the following is true in case of a Page Field?

a. Page Field enhances the look of the PivotTable. b. Page field is the field on which data is grouped and summary values are displayed according to

the selected value in the Page section. c. Page Field calculates the grand totals for the rows. d. Page Field calculates the grand totals for the columns.

Answer: b 4. Which of the following is not true for a PivotTable?

a. A PivotTable is an interactive worksheet, which summarizes a lengthy list of data. b. A PivotTable cannot produce multiple versions of a report from the same source of data. c. PivotTable arranges data in a format that can be easily used to create a chart. d. PivotTables are powerful analysis tools.

Answer: b 5. Which of the following holds True for using functions in a PivotTable?

a. You can calculate summaries like averages, standard deviation, and so on in a PivotTable. b. You can only calculate the sum of a field in a PivotTable. c. You can only calculate the standard deviation of a field in a PivotTable. d. You can only calculate the average of a field in a PivotTable.

Answer: a 6. Which of the following is NOT True for a PivotChart?

a. A PivotChart is automatically updated when the layout of the PivotTable is changed. b. A PivotChart has an associated PivotTable. c. A PivotChart cannot be created without a PivotTable. d. PivotChart reports contain the same elements as regular charts but also contain fields and items

that can be added to, rotated, or removed to display different views of your data. Answer: c

Page 30: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

30 Building Analytic Applications Using Excel ©NIIT

Machine Room This session will cover Chapter 3.

Exercise 1 Input Data File: Data Files for Students/MR/MR3/L3_Ex1.xls Solution Data File: Data Files for Faculty/MR/MR3/L3_Ex1.xls Please refer to Topics:

• Rearranging Data Using a PivotTable • Using Functions in a PivotTable

Exercise 2 Input Data File: Data Files for Students/MR/MR3/L3_Ex2.xls Solution Data File: Data Files for Faculty/MR/MR3/L3_Ex2.xls Please refer to Topics:

• Rearranging Data Using a PivotTable • Using Functions in a PivotTable

Exercise 3 Input Data File: Data Files for Students/MR/MR3/L3_Ex3.xls Solution Data File: Data Files for Faculty/MR/MR3/L3_Ex3.xls Please refer to Topics:

• Rearranging Data Using a PivotTable • Using Functions in a PivotTable

Page 31: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 31

Session Four

Session Aim This session will help the student automate repetitive tasks and add a professional look to business applications.

Session Plan This session will cover Chapter 4.

Topic/Activity Name Time Input Data File Solution Data file

Chapter 4: Objectives 5

Chapter 4: Automating Tasks

20

Chapter 4: Problem Statement 4.1 (Practice)

15 Data Files for Student/ OCR/OCR4/ PS4.1.xls

Data Files for Faculty/ OCR/Solution/OCR4/ PS4.1.xls

Chapter 4: Problem Statement 4.2 (Practice)

15 Data Files for Student/ OCR/OCR4/ PS4.2.xls

Data Files for Faculty/ OCR/Solution/OCR4/ PS4.2.xls

Chapter 4: Standardizing Forms and Worksheets

20

Chapter 4: Problem Statement 4.3 (Practice)

15 Data Files for Student/ OCR/OCR4/ PS4.3.xls

Data Files for Faculty/ OCR/Solution/OCR4/ PS4.3.xls

Chapter 4: Problem Statement 4.4 (Practice)

15

Summary 5

Total Time 110

Demonstration means the activity has to be done by the Faculty in the OCR. Practice means the activity has to be done by the student in the OCR.

Page 32: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

32 Building Analytic Applications Using Excel ©NIIT

Session Handling Inputs Initiate a classroom discussion by driving the class towards the need for automating business operations by giving a situation where an organization performs various tasks that are repetitive in nature and require a lot of time and effort.

Automating Tasks • Explain them how a programming language such as VBA can help in automating the repetitive tasks of

a business using macros. Macros are recorded for formatting reports, performing calculations, and creating Charts and PivotTables.

• Introduce the Problem Statement 4.1 and the corresponding Task to the students. • Ask the students to create a macro for formatting a sales report. • Conclude the exercise by demonstrating the correct solution. • Explain to students how customizing a macro can improve its functionality. • Introduce the Problem Statement 4.2 and the corresponding Task to the students. • Ask the students to customize the macro for formatting a sales report. • Demonstrate the correct solution and summarize the topic by stating the key learning.

Standardizing Forms and Worksheets • Drive the class towards the need for standardizing forms and worksheets. • Explain the students how they can customize a worksheet. • Introduce the Problem Statement 4.3 and the corresponding Task to the students. • Ask the students to add a combo box to the worksheet. • Conclude the exercise by demonstrating the correct solution. • Explain the students how they can create user forms. • Introduce the Problem Statement 4.4 and the corresponding Task to the students. • Ask the students to create a home loan form. • Demonstrate the correct solution and summarize the topic by stating the key learning.

Additional Information Limitations of the Macro Recorder Various processes in Excel can be automated using Macros. But the Macros have limitations. Some tasks that you cannot perform using the Macros are:

• Prompting a user for information while the macro is running. • Performing different actions based on user input. • Using custom user forms. • Displaying dialog boxes of Excel.

These are just a few reasons why you would want to write your own VBA code.

Page 33: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 33

Machine Room This session will cover Chapter 4 (Exercise 1, 2, 3, 4, 5, and 6).

Exercise 1 Input Data File: Data Files for Students/MR/MR4/L4_Ex1.xls Solution Data File: Data Files for Faculty/MR/MR4/L4_Ex1.xls Please refer to Topic Recording Macros

Exercise 2 Input Data File: Data Files for Students/MR/MR4/L4_Ex2.xls Solution Data File: Data Files for Faculty/MR/MR4/L4_Ex2.xls Please refer to Topic Recording Macros

Exercise 3 Input Data File: Data Files for Students/MR/MR4/L4_Ex3.xls Solution Data File: Data Files for Faculty/MR/MR4/L4_Ex3.xls Please refer to Topic Customizing Macros

Exercise 4 Input Data File: Data Files for Students/MR/MR4/L4_Ex4.xls Solution Data File: Data Files for Faculty/MR/MR4/L4_Ex4.xls Please refer to Topic Customizing Excel Worksheets

Exercise 5 Input Data File: Data Files for Students/MR/MR4/L4_Ex5.xls Solution Data File: Data Files for Faculty/MR/MR4/L4_Ex5.xls Please refer to Topic Customizing Macros Solution: Tasks: To create a macro that will copy the formula in all rows of the table irrespective of the number of rows present, after typing the formula, select the cell in which the formula was typed. Perform the following steps:

1. To copy the formula on clipboard, press Ctrl + C. 2. To move to the left cell, press left arrow key. 3. To move to the last row, press Ctrl + down arrow key. 4. To move to the right cell, press the right arrow key. 5. To select the complete column, press Ctrl + Shift + up arrow key. 6. To copy the formula in all the selected cells, press Ctrl + V.

Exercise 6 Solution Data File: Data Files for Faculty/MR/MR4/L4_Ex6.xls Please refer to Topic Creating UserForms

Page 34: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

34 Building Analytic Applications Using Excel ©NIIT

Session Five

Session Aim This session will help the student to create a VBA procedure to perform tasks, use conditional logic to control program flow, and perform tasks based on events.

Session Plan This session will cover Chapter 4.

Topic/Activity Name Time Input Data File Solution Data file

Chapter 4: Objectives 5

Chapter 4: Performing Tasks

10

Chapter 4: Presentation by Group 1

25

Chapter 4: Presentation by Group 2

25

Chapter 4: Presentation by Group 3

25

Chapter 4: Problem Statement 4.5 (Practice)

15 Data Files for Faculty/ OCR/Solution/OCR5/ PS4.5.xls

Summary 5

Total Time 110

Demonstration means the activity has to be done by the Faculty in the OCR. Practice means the activity has to be done by the student in the OCR.

Page 35: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 35

Session Handling Inputs Initiate a classroom discussion by driving the class towards the need for creating VBA applications to automate business operations.

Performing Tasks • In OCR 3 you had divided the class into three groups and had assigned each group one of the following

topics: Creating Procedures Creating Conditional Procedures Creating Event-Driven Programming

• Ask the students to present their research work before the class. • Build upon the explanation of each group and conclude the presentation. Ensure that the other groups

understood the concepts presented by the group. • Introduce the Problem Statement 4.5 and the corresponding Task to the students. • Ask the students to customize the home loan form to calculate the amount of loan for which the

employee is eligible. • Demonstrate the correct solution and summarize the topic by stating the key learning.

Additional Information Debugging Debugging is the process of testing and correcting the program during the development process. This process helps to identify common mistakes that might occur during programming, such as misspelling statement or function names, inconsistent use of variable names, or logical errors in the program. There are basically three types of errors that can occur:

• Syntax errors: These errors occur when the code is not written as per the standards. These include incorrectly spelled keywords, mismatched parentheses, and a wide variety of other errors. Excel flags your syntax errors and you can't execute your code until they are correct.

• Run-time errors: These errors occur while your code is executing. There are various types of run-time errors. For example, if your code refers to an object that doesn't exist, you'll get a run-time error. Excel displays a message when there is a run-time error.

• Logical errors: These errors occur through faulty programming. Logical errors may or may not cause a run-time error. In many cases, they simply produce incorrect results.

Debugging your code is the process of finding and correcting run-time errors and logical errors. Various debugging tools are: Call Stack [Ctrl L] The call stack keeps track of the procedure calling chain so you can easily analyze the flow of control between various procedures. You can invoke it by using Call Stack under View, or press [Ctrl L]. From this dialog, you can click on any procedure and jump immediately to it. Before analyzing the details of the current procedure, it may be more important to understand how and why you got there since the problem may be there rather than in the current procedure. Immediate Window [Ctrl G] This is the most basic debugging area. You can use the Immediate Window whether your code is running or not. Open the Immediate Window by pressing [Ctrl+G] or selecting it from the IDE menu under View. The Immediate window lets you:

• Evaluate expressions unrelated to your code (e.g. math equations) • Evaluate variables or expressions in your code (e.g. a current variable value) • Run code

Locals Window You can view all the local variables by selecting Locals Window from the Views menu. This displays the entire list of local variables and their current values. Local variables are the variables defined in the current procedure and module declaration section. Watch Window The Watch Window is similar to the Locals Window, but you specify only those variables that you want to track. You can track variables across modules and procedures and keep them in your Watch Window to see their value no matter where the current line is.

Page 36: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

36 Building Analytic Applications Using Excel ©NIIT

The first step is to add a variable to the Watch Window. This can be done by placing the cursor on the variable that you want to track and selecting Debug Add Watch.

Page 37: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 37

Practice Questions 1. Which of the following is NOT true about the VBE?

a. The VBE can be used to write the VBA code attached to Excel workbooks. b. The VBE can be used to edit the VBA code attached to Excel workbooks. c. All the functions in Visual Basic are available in the VBE. d. The procedures developed in the VBE become part of the workbook in which they are

developed. Answer: c 2. Which of the following controls visually combines and categorizes information on a single form?

a. RefEdit b. MultiPage c. SpinButton d. TabStrip

Answer: b 3. Which of the following controls helps in creating a tabbed interface for user selection?

a. RefEdit b. MultiPage c. SpinButton d. TabStrip

Answer: d 4. Which of the following events occurs when a specified sheet is switched from another sheet?

a. OnSheetActivate b. OnKey c. OnWindow d. OnAction

Answer: a 5. The variable to store the name of the employee has to be accessed throughout the

application. What should be the scope of the variable? a. Local b. Private c. Procedure-level d. Module-level

Answer: d

Page 38: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

38 Building Analytic Applications Using Excel ©NIIT

Machine Room This session will cover Chapter 4 (Exercise 7, 8, 9, 10, 11, and 12).

Exercise 1 Solution Data File: Data Files for Faculty/MR/MR5/L4_Ex7.xls Please refer to Topic Using Control Statements

Exercise 2 Solution Data File: Data Files for Faculty/MR/MR5/L4_Ex8.xls Please refer to Topic Using Control Statements

Exercise 3 Solution Data File: Data Files for Faculty/MR/MR5/L4_Ex9.xls Please refer to topic Creating Event-Driven Procedures

Exercise 4 Solution Data File: Data Files for Faculty/MR/MR5/L4_Ex10.xls Please refer to Topic Using Control Statements

Exercise 5 Solution Data File: Data Files for Faculty/MR/MR5/L4_Ex11.xls Please refer to topic Creating Event-Driven Procedures

Exercise 6 Solution Data File: Data Files for Faculty/MR/MR5/L4_Ex12.xls Please refer to Topic Using Control Statements

Page 39: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 39

Session Six

Session Aim This session will help the student to create a VBA program using the various objects available in VBA.

Session Plan This session will cover Chapter 5.

Topic/Activity Name Time Input Data File Solution Data file

Chapter 5: Objectives 5

Chapter 5: Working with Excel VBA Objects

55

Chapter 5: Using the Range Object (Demonstration)

15 Data Files for Faculty/ OCR/Input/OCR6/ D5.1.xls

Data Files for Faculty/ OCR/Solution/OCR6/ D5.1.xls

Chapter 5: Problem Statement 5.1 (Practice)

15 Data Files for Faculty/ OCR/Solution/OCR6/ PS5.1.xls

Chapter 5: Problem Statement 5.2 (Practice)

15 Data Files for Student/ OCR/OCR6/ PS5.2.xls

Data Files for Faculty/ OCR/Solution/OCR6/ PS5.2.xls

Summary 5

Total Time 110

Session Handling Inputs Initiate a classroom discussion by driving the class towards the need for VBA objects for creating VBA applications for Excel.

Working with Excel VBA Objects • Explain to students the five main VBA objects. • Demonstrate to students how to use the range objects. • Refer to the file, Data Files for the Faculty/OCR/OCR6/D5.1.xls • Introduce the Problem Statement 5.1 and the corresponding Task to the students. • Ask the students to write a VBA program to create a template for Books Sales Report. • Conclude the exercise by demonstrating the correct solution. • Explain to students the need for user-defined functions. • Introduce the Problem Statement 5.2 and the corresponding Task to the students. • Ask the students to create user-defined functions to calculate taxable and net income. • Conclude the session by demonstrating the correct solution and stating the key learning.

Demonstration means the activity has to be done by the Faculty in the OCR. Practice means the activity has to be done by the student in the OCR.

Page 40: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

40 Building Analytic Applications Using Excel ©NIIT

Practice Questions 1. You want to check the containment of the VBA objects for Excel. In which of the following will you

look for the containment? a. Object model b. Workbooks object c. Worksheets object d. Range object

Answer: a 2. You have to calculate the total profit made by your sales team by selling the products of your company.

To do this, you want to use the mathematical functions provided by Excel in your VBA code. Which of the following VBA objects methods will you invoke?

a. Worksheet b. Workbook c. Application d. Range

Answer: c 3. You need to maintain separate workbooks for the sales reports you create each month. Which of the

following properties or methods of collections should you use for the task? a. Count b. Add c. Create d. Open

Answer: b 4. In the VBA code for creating a sales report, you have to assign specific formula to some cells. To do

this you use the formula property of which of the following VBA objects? a. Applications b. Workbooks c. Worksheets d. Range

Answer: d 5. Using the VBA code, you want to select a cell that is five rows down and two column to the right of the

cell in the upper-left corner of the current selection. Which of the following should you use to move to the respective cell?

a. ActiveCell b. Offset c. Activate d. Move

Answer: b

Page 41: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 41

Machine Room This session will cover Chapter 5.

Exercise 1 Solution Data File: Data Files for Faculty/MR/MR6/L5_Ex1.xls Please refer to Topic Working with Excel VBA Objects

Page 42: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

42 Building Analytic Applications Using Excel ©NIIT

Session Seven

Session Aim This session will help the student to customize charts and pivot tables for their own specific use. This session will also cover security in Excel VBA.

Session Plan This session will cover Chapter 6 and Chapter 7.

Topic/Activity Name Time Input Data File Solution Data file

Chapter 6: Objectives 5

Chapter 6: Customizing Charts Using VBA (Demonstration)

20 Data Files for Faculty/ OCR/Input/OCR7/ D6.1.xls

Data Files for Faculty/ OCR/Solution/OCR7/ D6.1.xls

Chapter 6: Problem Statement 6.1 (Practice)

10 Data Files for Student/ OCR/OCR7/ PS6.1.xls

Chapter 6: Customizing PivotTables Using VBA (Demonstration)

25 Data Files for Faculty/ OCR/Input/OCR7/ D6.2.xls

Data Files for Faculty/ OCR/Solution/OCR76/ D6.2.xls

Summary 5

Total Time 65

Topic/Activity Name Time Input Data File Solution Data file

Chapter 7: Objectives 5

Chapter 7: Protecting Workbooks and Worksheets (Demonstration)

15 Data Files for Faculty/ OCR/Input/OCR7/ D7.1.xls

Chapter 7: Protecting Workbooks and Worksheets (Demonstration)

20 Data Files for the Faculty/ OCR/Input/OCR7/ D7.2.xls

Summary 5

Total Time 45

Demonstration means the activity has to be done by the Faculty in the OCR. Practice means the activity has to be done by the student in the OCR.

Page 43: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 43

Session Handling Inputs Initiate a classroom discussion by revising what you taught in the previous class. Relate the topics in this session with the previous classroom discussions.

Customizing Charts Using VBA • Explain to students the need for customizing the charts. • Demonstrate to students the creation of charts through macros and modification of code to customize the

chart. • Refer to the file, Data Files for the Faculty/OCR/OCR7/ D6.1.xls • Conclude the session by stating the key learning.

Customizing PivotTables Using VBA • Explain to students the need for customizing the PivotTables. • Demonstrate to students the creation of PivotTables through macros and modification of code to

customize the PivotTables. • Refer to the file, Data Files for the Faculty/OCR/OCR7/ D6.2.xls • Conclude the session by stating the key learning.

Protecting Workbooks and Worksheets • Explain to students the need for protecting workbooks and worksheets. • Demonstrate to students the process of assigning passwords to protect workbooks and worksheets. • Refer to the file, Data Files for the Faculty/OCR/OCR7/ D7.1.xls • Explain to students the need for macro security. • As a home assignment, ask the students to do a research on Digital signatures. • Demonstrate to students the process of assigning password to a VBA project. • Discuss the need for packaging and deploying an application.

Explain to students that it would not be possible to demonstrate the process of packaging and deploying in the class. The Package and Deployment wizard add-in is available for download from the Windows 2000 Developers edition CD that requires a license.

• Conclude the session by stating the key learning.

Page 44: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

44 Building Analytic Applications Using Excel ©NIIT

Practice Questions This session will cover Chapter 6 (Questions1 - 5) and 7 (Questions 6 - 9).

1. Which of the following properties displays the name of currently active chart? a. ActiveChart b. ChartType c. ChartTitle d. SourceChart

Answer: a 2. What is the functionality provided by the following code?

ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1) ActiveSheet.Cells(3, 1).Select ActiveSheet.PivotTables("PivotTable2").SmallGrid = False

a. Creates a PivotTable b. Adds PivotTable to PivotCaches collection c. Sets the properties of the PivotTable d. Sets the fields of the PivotTable

Answer: c 3. Which of the following properties specifies the type of field in a PivotTable?

a. Position b. Orientation c. PivotCaches d. SourceDestination

Answer: b 4. Which of the following property displays the title of the chart?

a. Name b. ChartType c. DataLabel d. Text

Answer: d 5. What is the purpose of the following code?

With ActiveSheet.PivotTables("PivotTable2").PivotFields("Salesman") .Orientation = xlPageField .Position = 1 End With

a. It adds the PivotTable to the active sheet b. It sets the properties of the PivotTable c. It sets the properties of the fields of the PivotTable d. It creates a PivotTable

Answer: c 6. Which option is used to lock charts in the Protect Sheet dialog box?

a. Structure b. Content c. Objects d. Scenario

Answer: c 7. What are the different kinds of security levels of Macro Security?

a. High b. Low c. High and Medium d. High, Medium, and Low

Answer: d 8. Which of the following is not possible once the workbook has been protected?

a. Insert worksheet b. Delete cell values c. Enter data d. Insert pictures

Answer: a

Page 45: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

©NIIT Building Analytic Applications Using Excel 45

9. When Donna tries to open a workbook, she gets the prompt saying ‘Do you want to disable or enable macros?’ What is her macro security setting?

a. Low b. High c. Medium d. None

Answer: c

Page 46: Building Analytic Applications Using MS-Excelkc.niitstaff.com/NIITStaffUpgrade/CG/IEC Track 3... · ©NIIT Building Analytic Applications Using Excel 11 ... monthly sales report of

46 Building Analytic Applications Using Excel ©NIIT

Machine Room This session will cover Chapter 6 (Exercise 1 and 2) and 7 (Exercise 3).

Exercise 1 Solution Data File: Data Files for Faculty/MR/MR7/ L6_Ex1.xls Please refer to Topic Customizing Charts Using VBA

Exercise 2 Solution Data File: Data Files for Faculty/MR/MR7/ L6_Ex2.xls Please refer to Topic Customizing Charts Using VBA

Exercise 3 Input Data File: Data Files for Students/MR/MR7/ L1_Ex1.xls Solution Data File: Data Files for Faculty/MR/MR7/ L7_Ex1.xls Please refer to Topics:

• Customizing PivotTables Using VBA • Limiting Access to Workbooks