Professional Documents
Culture Documents
Ahmedabad
IIMA/CISG0104TEC
V. Venkata Rao
June 2012
Page 2 of 260
IIMA/CISG0104TEC
Table of Contents
I. Essential Features of Excel ........................................................................................................................ 5
I.1 Structure of an Excel File. ............................................................................................................... 5
I.2 Ranges and range names ................................................................................................................. 6
I.3 How to select a cell or range for data and formula entry ............................................................. 7
I.4 How to enter numbers, text, dates, and formulae .......................................................................... 7
I.5 Array formulae ................................................................................................................................. 8
I.6 How to copy a formula from one range to another ....................................................................... 8
I.7 Relative and absolute referencing .................................................................................................. 9
I.8 Attaching user comments to cells .................................................................................................... 9
II. EXAMPLES ............................................................................................................................................ 12
II.1
Example 1. Weekly wage computation ..................................................................................... 12
II.2.
Example 2. Comparison of two sales commission plans ........................................................ 19
II.3
Example 3. Extension to Example 2 ........................................................................................ 21
II.4
Example4. Investment Analysis ............................................................................................... 22
II.5
Example 5. Computation of shipping cost ............................................................................... 26
II.6
Example-6. Matrix Arithmetic: A Problem in Economic Planning. .................................... 29
II.7
Example 7. Regression Estimation: Literacy Rate and Per Capita Income ........................ 31
II.8
Example-8. Queries on a Personnel Data Base ....................................................................... 33
II.9
Example -9. Sales Revenue Query: Handling Complex Queries. ............................................. 38
II.10 Example-10. Bishops Move....................................................................................................... 40
II.11 Example-11. A Preventive Maintenance System....................................................................... 44
II.12 Example-12. Time-Study Data .................................................................................................. 47
II.13 Example-13. To Change the Date Display Format in a Cell or a Range. .................................. 50
II.14 Example-14. Modification of Part Codes .................................................................................. 52
II.15 Example-15. An Optimal Product Mix Problem .................................................................... 56
II.16 Example-16. How to solve Transportation Problems with Excel. .......................................... 60
II.17 Example-17. Determination of Sample Size ............................................................................. 67
III.
Exercises-I ....................................................................................................................................... 71
1. A Copying Problem ........................................................................................................................... 71
2. An NPV Question. ............................................................................................................................. 71
3. A Four-Year Investment ................................................................................................................... 72
4. Distances On a Square Grid ............................................................................................................. 73
5. A Simple Lookup ............................................................................................................................... 74
6. Data Table for Frequencies .............................................................................................................. 74
7. Length of Employment ...................................................................................................................... 75
8. Cash Flow Analysis............................................................................................................................ 75
9. Retirement Benefits ........................................................................................................................... 76
10. Households below Poverty Line. ...................................................................................................... 77
11. Evaluation of Job Applicants............................................................................................................ 77
12. Publishing Game ................................................................................................................................. 78
13. Centigrade to Farenheight.................................................................................................................. 78
14. Number of Passes. ............................................................................................................................... 79
15. Components of a Name ....................................................................................................................... 79
16. Integral Solutions. ............................................................................................................................... 80
17. City-based Sales Tax ........................................................................................................................... 80
18. Tuition Fees ......................................................................................................................................... 81
19. Top-30 of Management Times ............................................................................................................ 81
20. Weights for the Composite Score. .................................................................................................... 83
21. Queen on a Chess Board. .................................................................................................................. 84
22. Knight on a Chess Board. ................................................................................................................. 84
23. Coded Marks List. ............................................................................................................................. 85
24. Rating of Cars. ................................................................................................................................... 86
25. Gas Cylinder Booking ....................................................................................................................... 86
26. Cricket. ............................................................................................................................................... 87
27. Guess the Cell Address. ..................................................................................................................... 87
28. Missing first value in cash flow......................................................................................................... 88
Page 3 of 260
IIMA/CISG0104TEC
Page 4 of 260
IIMA/CISG0104TEC
Page 5 of 260
IIMA/CISG0104TEC
Page 6 of 260
IIMA/CISG0104TEC
Each worksheet is exhibited by default with horizontal and vertical borders. The horizontal
boarder exhibits a column label, formed with one or two alphabetic characters, and the vertical
boarder exhibits a row number for each row. A worksheet in Excel 2007 has totally 18,278
columns, denoted with labels A, B, C, , Z, AA, AB, ,ZZ, AAA, AAB , ZZZ; and,
10,48,576 rows, denoted with numbers 1,2, , 65536. A cell of a worksheet is referred to with its
cell address, which is formed by the string column label of the cell followed by its row number.
Thus the address of the cell at the intersection of column BC and row 104 is BC104. From a
worksheet, say sheet1, if you want to refer to a cell, say AC35, of another worksheet, say sheet3,
use the reference as sheet name followed by exclamation mark followed by the cell address; that
is in the example the reference should be sheet2!AC35. Similarly, from a worksheet you can also
refer to a cell in a worksheet of another workbook; for such a reference use the string book name
in square brackets followed by worksheet name followed by the exclamation mark followed by
the cell address. Thus the reference [BOOK3]sheet4!A4 denotes cell A4 of the worksheet named
sheet4 in the work book named BOOK3.
The interactive screen consists of the spreadsheet grid and on the top the menu ribbon. It is in the
menu ribbon that all the menu options are listed and presented in the form of groups. For
performing several tasks the appropriate menu option has to be clicked. The ribbon consists at its
top the menu tabs. When tab is clicked beneath it appear several rectangular tiles, each consisting
of a set of menu options for a group of tasks. The name of each group appears at the bottom of the
corresponding tile. In some cases, when a menu option is clicked a dialog box appears to get
further information from the user. In this note, while describing a menu option, we mention the
tab label followed by the group label followed by the menu option as follows:
Tab label
Group lable
Menu option
I.2
Ranges and range names. A rectangular set of contiguous cells is called a range. Ranges
are quite useful to deal with several items together. A range is referred to by its range address,
which consists of the address of the top left cell of the range followed by the colon mark followed
by the address of the bottom right cell of the range. Thus the range address A1:C3 refers to the
range composed of the cells A1, A2, A3, B1, B2, B3, C1, C2, C3.
To make referencing a cell or a range easy, Excel allows you to assign a name to a cell or range
and use its name or its address to refer to it. To assign a name to a cell or a range follow the two
steps:
1
Defined Names
Define Name.
Type the name to be assigned in the name box; enter the range address or formula to
which the name applies in refers to box; and click the buttons OK.
Alternatively, select the cell or range which you want to name, and right click the mouse. In the
box of command that appears, click the option Name a Range.
Instead of specifying a range name on-line, you can type them in the spread sheet itselfin the
immeadiate left, or immediate right column of the cells to be named, or on the row immediately
above or below the cells. In such case, choose, the set of cells along with the cells containing their
names and use the menu option: Formulas Defined Names Apply Name. In the resulting
dialog box, you can specify the location of the names.
Suppose you have assigned names to several ranges and have forgotten which name refers to
which range. You can see a table of range addresses and their corresponding names by clicking
the menu option: Formulas Defined Names Name Manager:
Page 7 of 260
I.3
IIMA/CISG0104TEC
Before you can enter data into a cell or range the corresponding cell or range has to be first
selected. We describe here two different ways of selecting a cell or range.
Position the mouse pointer on the cell of your choice and click the left mouse button to select the
cell. After selecting a cell, you can type in your data ended by the pressing of the Enter key, to
enter the data into the selected cell. For selecting a range, instead of a cell, select the first, i.e. the
top left, cell of the range by clicking on it, and then keeping the left mouse button pressed, drag
the pointer over the other cells of the range, and then release the mouse button.
Except in small problems, or when the cell you want to choose is close to your present cell, the
above method is not particularly convenient. An alternative way of selecting a cell or range is by
specifying its address or name. In this method, first select the menu options Home
Editing
Find and Select
GoTo. In the resulting dialog box, type in the name and address of the cell
or range in the corresponding boxes, and then click OK. The specified range will automatically be
highlighted.
I.4
While entering a number, text, or date into a cell make sure you end the entry by pressing the
Enter key. Numbers and text can be straight away entered without causing any confusion. Dates
can also be entered straight away using any of the standard formats such as mm/dd/yy, mm-ddyy, or dd-mmm-yy. In most cases, the system has enough intelligence not to confuse between a
date and text, and a date and number. At times, however, there could be some confusion between
the day number and month number in interpreting a date. To avoid such a confusion, enter dates
always in the date format chosen through the control panel of the windows system. In Windows
95 system, this format can be set or changed through the menu options StartSettingsControlPanelRegional SettingsDate.
For entering a formula, you need to prefix the formula by the equal to (=) symbol. Suppose the
entry in cell A1 is 4 and you want to get into A2 the value twice that of A1. The formula that you
need to enter into A2 for this purpose is 2*A1. To enter the formula, select cell A2, and type in
=2*A1, followed by enter key. On finishing the above entry, what you see in A2 is not the
formula but its result, that is the value 4. The formula itself is shown in the formula bar, which is
situated above the horizontal border.
It is important to note that what is displayed in a cell is not necessarily identical in looks to what
you might have entered into the cell. The display is obviously governed by the contents of the cell
but the same contents can be displayed in various different formats. For example, depending on
the format chosen, the cell entry 1234.343 can be displayed in any of the following formats:
1234.343
1234.34
1234
$1234.34
$1,234.34
Further examples are: the entry 0.25 can be displayed as 25%, and the entry 1 as 1/1/1900.
To choose or change the display format of a cell, the menu options to be chosen are:
Home
Number
Page 8 of 260
IIMA/CISG0104TEC
Note however that no matter what the format of display of a cell, its contents remain unchanged,
until you explicitly edit the contents. It is the contents that will be used in evaluating a formula
that refers to the cell.
It is also possible to change the colour of the characters in a cell, background colour of the cell,
and the orientation of display of the entry in a cell; for these, first select the desired cell or range,
and then choose Home
Font for colour changes for foreground and background, and Home
Alignment Orientaion, for changing the orientation of display of the characters.
I.5
Array formulae. There are some formulae, which give as output multiple values. These
formulae are called array formulae. An example is a formula that computes the inverse of a
matrix. In such a case, the method of entry of the corresponding formula is different. First
highlight the range that is to contain the output of the formula; then, type in the array formula in
the first cell of this range, and end it by pressing the three keys Control, Shift and Enter together.
I.6
At the end of the above steps, you will notice that the destination cells chosen above are filled
with formulae, which are the same as the source formulae in A3, with cell reference adjusted in a
corresponding way. For example, when the destination cell is in the same row as the source cell,
but one cell to its right, then all the column labels in the source formula will be replaced by the
next labels to get the destination formula, while the row numbers remain unchanged. When the
destination is in the same column and one cell above with respect to the source cell, all the row
labels in the source formula are decreased by one to get the destination formula while the column
labels remain unchanged. It is important to remember in the above process that you should not
attempt to cross the maximum possible values of row label, IV, and column number 65,536;
otherwise the error message #REF! would result.
Consider another example in which the unit cost of production of an item is given in cell A1, and
the quantities of production on three consecutive days of the product in cells A2, B2 and C2. You
are required to find in cells A3, B3, and C3 the total cost of production of the product on the three
days respectively.
Page 9 of 260
IIMA/CISG0104TEC
I.7
Relative and absolute referencing. Suppose, following the procedure of the previous
example, you enter in cell A3 the formula =A1*A2, and copy it into cells B3 and C3. As a result
of this copy operation you will notice that the formulae resulting in cells B3 and C3 would be
=B1*B2 and =C1*C2. These formulae are clearly wrong because the unit price should remain
constant during the three days. The correct formulae in cells B3 and C3 should be =A1*B2, and
=A1*C2 respectively. During the copy operation, the first cell reference in the source formula
should not change whereas the second reference should change. To accomplish this, type the
formula in cell A3 as
=$A$1*A2
or
$A1*A2
Now copy this formula into cells B3 and C3 to get into them the formulae:
=$A$1*B2 and =$A$1*C2
or
The use of $ sign in a cell reference is called absolute referencing of the cell, and the absence of it
is called relative referencing. $ in front of column component of the address makes column
absolute; in front of row component makes row absolute; and $s in front of both make both row
and column absolute.
Note that the value of a formula remains the same irrespective of whether you use relative or
absolute referencing for its cell addresses. For example, the formula =A1 will be evaluated to the
same value as the formula =$A$1 or $A1. Therefore, the mode of cell referencing in a formula
influences not the value of the formula, but the way the addresses get modified when the formula
is copied to other cells. Thus, a choice between the two modes of addressing becomes relevant
only when you intent to copy the formula to other cells; otherwise, you can simply use relative
referencing.
I.8
Attaching user comments to cells. You may find it useful to attach to a cell some notes,
explaining the formula behind the cell or simply explaining its contents. Such documentation
would be very essential in complex spreadsheets. A comment box can be attached to any desired
cell, a comment can be entered into it and edited. The comment box can be designed such that it
would appear only when the mouse pointer is placed on the cell. The steps to be followed for the
above purpose are:
Select the cell to which you want to attach a comment.
Right click the mouse.
From the menu options that appear select Insert a comment.
Enter the comment in the box that appears.
Click outside the box to close the comment and the box.
If you want to see the comments only when the mouse pointer is placed on the cell with a
comment and right click the mouse button; in the options that appear choose show/hide comment.,
select the
You can edit or delete the comment by once again right clicking on the cell and choosing the
appropriate menu item.
The above operations can also be performed through the menu ribbon; the corresponding options
are: Review Comments
Now, the note presents you with several examples through which you can learn some of the most
useful and interesting features of Excel. Each of the examples introduces you to a different set of
features. You are required to enter the suggested solutions into your own PC and make sure that
Page 10 of 260
IIMA/CISG0104TEC
they work. Note that none of the suggested solutions is unique; for each problem several
alternative solutions exist. You are encouraged to think of the alternative designs, and test them
out.
It is the authors firm belief that the best way of learning Excel is to attempt various problems on
Excel, rather than trying to read books on excel. The best reference on the features of Excel is the
Excel Help which can be accessed by pressing F1 key while operating the package. The help
describes not only various features, but, wherever needed, gives examples.
Page 11 of 260
IIMA/CISG0104TEC
II. EXAMPLES
Page 12 of 260
IIMA/CISG0104TEC
II. EXAMPLES
II.1
Example 1.
Suppose you are given the following data related to a week on each employee of a company:
i.
ii.
iii.
iv.
Employee code
Hours worked during the week
Basic wage in Rupees per hour
Number of pieces produced
Further, the following data that applies to all employees is also given:
i.
ii.
Design a spreadsheet to contain the above data, and to compute using this data the following:
i.
ii.
iii.
iv.
v.
Figure-1a shows an Excel spread sheet for a sample of five employees. This sheet consists of four
areas:
i.
ii.
iii.
iv.
Note that the data in columns titled EmpCode, Basic Wage, Hrs worked, and Pcs produced is to be
input by you. Similarly, the values of standard rate of production is to be input in cell D4, and that of
incentive wage rate in Rs per piece is to be input in cell D5. The other values are computed by the
software, through the formulae, shown in Figure-1b.
These formulae are devised based on the following rules:
i. Extra production
=
=
ii.Regular pay
iii.Incentive pay
iv.Total pay
The formulae shown in Figure-1b are self- explanatory. Consider the formula in cell E11, for
example. This formula is devised to compute the extra number of pieces produced by employee E1.
Page 13 of 260
IIMA/CISG0104TEC
From formula i shown above, we need to compute the maximum of two quantities; this is done by
the MAX function. Of the two quantities involved, the first one is the difference between actual
production, given in cell D11, and the standard production; the standard production in turn is
obtained by multiplying the standard rate of production, given in cell D4 with the number of hours
worked, given in cell c11. The formula for the first quantity is D11 - D4 * C11; however, note that
D4 is written in Figure-1b as $D$4, which is nothing but absolute referencing of that cell. The
absolute referencing is used so that when this formula is copied to corresponding cells of other
employees, the address of the parameter does not change. The second quantity inside MAX is the
constant 0. Thus, the entire formula in E11 is MAX((D11-$D$4*C11),0). This formula is copied to
cells in the range E12:E15 to obtain formulae for extra production for each of the other employees.
Figure-1a. A spread sheet for wage computation
A
2
3 Paramtrs:
4 1. Std Rt (Pcs/hr)
10
5 2. Incnt Rt (Rs/piece)
6
7
Emp
Code
Basic
Hrs
Pcs
Extra
Pay
Pay
productn
regular
incntv
totl
(Rs)
(Rs)
(Rs)
(Rs/hr)
Pay
10
11
20
40
440
40
800
200
1000
12
25
48
530
50
1200
250
1450
13
25
56
490
1400
1400
14
20
32
350
30
640
150
790
15
30
40
350
1200
1200
Totals:
5240
600
5840
16
17
18
Incntv/totl as %:
Formula
Comments
E11
F11
=B11*C11
Copied to F12:F15
G11
=e11*$D$5
Copied to G12:G15
H11
=F11+G11
Copied to H12:H15
F17
=SUM(F11:F15)
G17
=SUM(G11:G15)
H17
=SUM(H11:H15)
H18
=100*G17/H17
10.27
Page 14 of 260
IIMA/CISG0104TEC
Page 15 of 260
IIMA/CISG0104TEC
exact match is needed, and otherwise an error is to be reported), and TRUE implying that rangelookup is to be used (which means that if exact match is not found an approximate match, as per a
rule, is to be found). In the present context, an exact match is needed and hence FALSE is given
as the fourth argument.
Range look up is also needed when the range of lookup keys is very large, and divided into
intervals. Each key given in the first column of the vlookup table corresponds to an interval. and
as a part of the search, first the interval into which the lookup value is determined, and then from
the corresponding row, the result is taken.
As the VLOOKUP formula is copied vertically downwards in the range C11:C15, it is enough if $
symbols are put only in front of the row numbers, that is, even the following specification would
work correctly:
=VLOOKUP(B11, K$7:L$11,2,FALSE)
The logic for the formulae in other columns is the same as before and hence we do not explain
them here.
HLOOKUP function. The keys column can also be horizontal, instead of being vertical. In that
case, you need to use the function HLOOKUP. The keys in a HLOOKUP table are in the first
row, the search first determines the matching column of the HLOOKUP table, and the result is in
a row of the matching column( specified as the third argument). The match can be exact ( that is
the fourth argument of HLOOKUP is FALSE), or it can be interval-based ( that is the fourth
argument is TRUE). In the case of range lookup, the key values in the first row are to be in the
ascending order, and the search takes place from left to right.
Parameters:
1. Std. Rt
2.Incntv. Rt
(Pcs/hr)
(Rs/piece)
Emp
Code
Emp
Type
Basic
Wage
(Rs/Hr)
Hrs
Worked
E1
E2
E3
E4
E5
E
D
C
B
A
45
40
30
25
20
40
48
56
32
40
Pieces
Produced
Extra
Prodn
Pay
Regular
(Pcs)
Pay
Incntv
(Rs)
Pay
Total
(Rs)
440
530
490
350
350
40
50
0
30
0
1800
1920
1680
800
800
200
250
0
150
0
2000
2170
1680
950
800
10
5
Page 16 of 260
IIMA/CISG0104TEC
6
7
8
9
10
11
K
Emp Type
A
B
C
D
E
L
BasicWage
20
25
30
40
45
Formula
=VLOOKUP(B11,$K$7:$L$11,2,FALSE)
=IF(E11>$E$4*D11,E11-$E$4*D11,0)
=D11*C11
=F11*$E$5
=G11+H11
=SUM(G11:G15)
=100*H17/I17
Page 17 of 260
IIMA/CISG0104TEC
Page 18 of 260
IIMA/CISG0104TEC
The formulae in other columns (see Figure 1.2 c) are similar to those in the other two versions of
the problem and hence are not explained further.
Parameters:
1. Std. Rt
2.Incntv. Rt
(Pcs/hr)
(Rs/piece)
Emp
Code
PScore
E1
E2
E3
E4
E5
10
5
Basic
Wage
(Rs/Hr)
Hrs
Worked
Pieces
Produced
Extra
Prodn
Pay
Regular
(Pcs)
Pay
Incntv
(Rs)
Pay
Total
(Rs)
25
30
60
40
20
40
48
56
32
40
440
530
490
350
350
40
50
0
30
0
1000
1440
3360
1280
800
200
250
0
150
0
1200
1690
3360
1430
800
10.5
20.5
42
35
6
0
10.01
20.01
30.01
40.01
L
20
25
30
40
60
Formula
=VLOOKUP(B11,$K$7:$L$11,2,TRUE)
=IF(E11>$E$4*D11,E11-$E$4*D11,0)
=D11*C11
=F11*$E$5
=G11+H11
=SUM(G11:G15)
I18
=100*H17/I17
Page 19 of 260
II.2
Example 2.
IIMA/CISG0104TEC
Through this example we discuss the design of formulae in spread sheets, copying of formulae
from one range to another and simple what if analysis.
A company wants to compare two proposed plans for sales commission. In Plan-A, when the
number of units sold is less than or equal to 20,000 (call it Volume-1) no sales commission is to
be paid; otherwise, sales commission is to be paid at the rate of Re. 1 for each unit sold beyond
20,000. In Plan-B also, for sales upto 20,000 units there is no commission. For sales between
20,000 and 60,000 (call it Volume-2) the commission is at the rate of Rs. 0.6 for each unit above
20,000; for sales beyond 60,000, the commission is at the rate of Rs. 1.5 for each unit in excess of
Rs. 60,000.
The variable costs are estimated as follows:
Raw material cost per unit of final product = Rs. 15
Utilities cost per unit of final product = Rs. 5
The fixed costs per year are given as:
Rent = Rs. 60,000; Salaries = Rs. 2,00,000; Advertising Expenditure = Rs. 80,000
Other Miscellaneous fixed costs = Rs. 20,000.
The sales price per unit is Rs. 25.
In comparing the two policies, we are required to find the break even sales volume for each of the
two plans. We are also required to find the sales volume, if any, at which both the policies yield
the same profit; below this sales volume, one of the policies is the more profitable, and above it,
the other policy is the better.
1. A spread sheet design for this problem is presented below: (see Figure 2a).Parameters: As
some data is common for both policies, this data is entered in the range A3:C14. In this range,
Column A is reserved for the titles of the parameters, and C for their values. Column B is left
blank for the sake of legibility.
2. The data on sales commission, which is different for the two policies, is given in the range
E3:G7. Column E consists of the titles, F the data for Plan-A, and G the data for Plan-B.
Output
The output can be split into two parts: in one we show the total costs and total revenues for each
of the plans for a certain sales volume. In another, we show the sensitivity analysis: how the net
income varies with sales volume for each plan. The first part is shown in the range E9:G15, the
second in I5:K16.
Cell Widths. To choose the widths of columns D and H as 1, click the mouse on the desired
column, and use the menu options Format -- Column Width. In the dialogue box that appears
enter the desired width in the Column Width field. The other columns will remain at the default
column width.
Cell Formulae . The cell formulae in the range E9:G15 are shown in Figure 2b. Most of the
formulae are self explanatory, and can be easily derived by the reader; for example, total raw
material cost = raw material cost per unit of product (cell C5) * number of units sold (cell C14).
Hence the formula to be entered into F10 is either C5*C14 or $C$5*$C$14. Of these two, we
choose the latter, because while copying this formula to the corresponding cell in Plan-B we do
not want the cell addresses to change.
The formulae for total sales commission are more complex than the others. These can be derived
as below:
Page 20 of 260
IIMA/CISG0104TEC
The format of IF function is IF (Condition, expression-1, expression-2); this means that the
contents of the current cell should be obtained by evaluating expression1 if condition is true, and
by expression2 otherwise. The condition to be verified here is $C$14<=F4. If the condition is
satisfied, then the commission is 0; otherwise it should be equal to ($C$14-F4)*F5. Accordingly
the formula in cell F12 is
= IF($C$14 <= F4, 0, ($C$14-F4)*F5)
As the formulae in Plan-A and Plan-B are similar, enter the formulae only for Plan-A, that is in
column F, range F9:F15, and then copy these into column G, range G9:G15. The formula for sales
commission in cell G12 needs to be changed through editing, because sales commission is
computed differently in the two policies.
Figure-2a: Comparison of two sales commission plans
A
Plan-A
Plan-B
1
2
3
Common Data
Sales comm
Volume-1
Unit price
15
5
25
Comm-1/unit
20000
20000
0.6
Volume-2
Rent
60000
10 Salaries
200000
Tot rm cost
11 Advertising
80000
20000
13
14 No.of units sold
90000
15
c14
f15
g15
20000
21000
-3500
60000
83000
-8000
1.5
84000
-4000
85000
3500
360000
86000
4000
7000
1350000 1350000
87000
8000
10500
Comm-2/unit
8
9
Data Table-1
360000
450000
450000
88000
12000
14000
70000
69000
89000
16000
17500
Tot cost
2230000 2229000
90000
20000
21000
2250000 2250000
91000
24000
24500
92000
28000
28000
93000
32000
31500
Net income
16
20000
21000
E
Tot fix cost
Tot rm cost
Tot util cost
Tot sales comm
F
= SUM($C$9:$C$12)
= $C$14*$C$5
= $C$14*$C$6
= IF($C$14<=F4,0,
($C$14-F4)*F5)
13
14
15
Tot cost
Tot sales rev
Net income
= SUM(F9:F12)
= $C$14*$C$7
= F14-F13
G
= SUM($C$9:$C$12)
= $C$14*$C$5
= $C$14*$C$6
= IF($c$14<=G4,0,
(IF($C$14<=G6,
($C$14-G4)*G5,
($C$14-G6)*G7+(G6-G4)*G5))
= SUM(G9:G12)
= $C$14*$C$7
= G14-G13
Page 21 of 260
IIMA/CISG0104TEC
Sensitivity Analysis
The break-even volumes can be found by changing the entry in cell C14 till the net income
reaches a value zero in cell F15 or G15. However, this process involves considerable amount of
search and hence is tedious. This process can be simplified considerably by building a table with a
range of sales volumes in one column, and the corresponding net income figures in the other
columns. This is achieved by letting the spreadsheet fill what is known as a data table. First,
choose the range of the data table as I5:K16. Fill the first column of this range, starting from cell
I6, with the range of the sales volumes that we are interested in testing. In J5, the first cell of the
second column, enter the cell address of the first dependent variable, that is, =F15; and in K5, the
first cell of the third column, enter the address of the second dependent variable, that is, =G15.
Highlight the table region, that is, I5:K16 by positioning the mouse pointer on I5 and dragging it
to K16 with the left button pressed. Next choose the menu options Data -- Table. A dialogue box
with two fields, row input cell and column input cell appears. Keep the row input cell field blank,
and fill the column input cell field with the address C14. Then press the OK button. The software
fills the second and third columns of the table automatically.
Figure-2 shows the results of sensitivity analysis for sales volume varying from 83,000 to 93,000.
From this we get the answers for all the given questions:
1. The break-even sales volumes for Plan-A and Plan-B are 85,000 and 84,000respectively.
2. For the sales volume 92,000 both the policies give the same net income. For sales
volumes less than 92,000 policy B is better than A; and for those above 92,000, A is
better than B.
II.3
Example 3.
Extension to Example 2
Through this example we discuss the use of functions, particularly IF and VLOOKUP in Excel.
In the above example we have assumed that the advertising expenditure is fixed and is independent of the sales volume. Suppose this assumption is to be relaxed. Let the relation between
the sales volume and advertising expenditure be specified as below:
Sales volume
0 - 29,999
30,000 - 59,999
60,000 - 79,999
80,000 - 89,999
>= 90,000
Advertising Expenditure
5,000
10,000
30,000
60,000
90,000
The spread sheet for this is shown in Figure-3. Note that this spread sheet has a new partition, the
range A16:B22, to accommodate the data given above. The following changes are made to the
spread sheet in Figure-2 to incorporate the new feature:
The advertising expenditure is no more a fixed cost, but it is to be computed for any given sales
quantity. Hence it is removed from the parameters set, and is included as a separate item in the
range F8:G8. The values in these cells are to be obtained by matching the sales volume with the
values in the range A18:A22, and taking the corresponding value of advertising expenditure from
the next column, column B. Therefore the formula for cell F8 and G8 is
VLOOKUP($C$14,A18:B22,2). The results of the sensitivity analysis for this modification show
that, unlike in the previous case, the net income does not exhibit a monatomic behaviour; it
fluctuates, with increase in sales.
Page 22 of 260
IIMA/CISG0104TEC
1
Plan-A
2
3
Common Data
Volume-1
20000
20000
15
Comm-1/unit 1
0.6
Volume-2
60000
Unit price
25
Rent
10 Salaries
11 Other fixed csts
Comm-2/unit
60000
Example 4.
12000
16500
84000
16000
20000
85000
20000
23500
60000
280000
280000
86000
24000
27000
200000
Tot rm cost
1425000
1425000
87000
28000
30500
20000
475000
475000
88000
32000
34000
76500
89000
36000
37500
Tot cost
2345000
2346500
90000
10000
11000
2375000
2375000
91000
14000
14500
Net income
30000
28500
92000
18000
18000
93000
22000
21500
21 80000
22 90000
28500
83000
90000
95000
10000
g15
30000
1.5
13
19 30000
20 60000
f15
90000
12
15
c14
Adv cost
Data Table-1
Sales Volume vs Net income
II.4
Plan-B
Sales comm
30000
90000
Investment Analysis
Through this example we discuss two functions, NPV and IRR, very important for investment
analysis; additionally, we use the data table feature, already introduced partly in the previous
example.
First consider a simple investment proposal which involves making a certain investment at the
beginning and receiving cash at the end of each year of the period under consideration,. The
investment and the cash to be received at the end of the first year are known with certainty; they
are Rs 10,000 and Rs 4,000 respectively. The amount to be received at the end of the second and
third years is not known exactly; it is however known that from the first year onwards, the amount
received at the end of each year increases by a constant amount, say X. That is, at the end of the
second year the cash inflow would be Rs 4000 + X, and at the end of the third year Rs 4000 + 2X
.The life of the investment is only three years. All you know about X is that it lies in the range Rs
500 to 1300. Analyze the above data and find whether the investment proposal is financially
acceptable for various possible values of X. Use in your analysis the discount rate Rs 0.18 per
rupee per year.
As the cashflows mentioned above are spread in time, you need to convert each of the cashflows
to equivalent values at the beginning of the period, and compute their sum. Such a sum is called
the net present value (NPV) of the cashflow. A negative value of NPV implies that the proposal is
loss-making, and a positive value implies the opposite. Converting a cashflow occurring
sometime in future to its present value is called discounting. For discounting you need to use a
certain fraction called discount rate, which is 0.18 in the present problem. It is also customary in
investment analysis to find that value of discount rate(s) at which the net present value becomes
zero; this discount rate is called the internal rate of return(IRR).The IRR is compared with a
specified rate of return called minimum acceptable rate of return, and the proposal is considered
acceptable when IRR is greater than the acceptable rate, and is considered unacceptable
otherwise. It needs to be emphasised here that the above rules are somewhat gross simplifications
Page 23 of 260
IIMA/CISG0104TEC
of the process followed in practice , and that many assumptions are needed to justify these rules.
For example, the analysis becomes confusing when the cash flows under consideration yield
multiple IRRs. Therefore, the above two measures are to be used not blindly but with caution. We
are concerned here not so much with the philosophy behind using each measure, but with how to
use Excel to compute them.
Consider the spreadsheet of Figure-4a for the above problem. As we need to experiment with
different values of X, X is stored separately in cell B3. The discount rate is also stored separately
in cell D3. This is done to facilitate experiments with this parameter, to validate the results, even
though you are not explicitly asked to experiment with the discount rate. The cash flows at the
end of each year are given in cells B6 through E6. The beginning of the first year is considered
the same as the end of the zeroeth year; the beginning of the second year is considered to be the
same as the end of the first and so on. The time indexes shown in the range B5 through E5 are to
be interpreted as follows: the index i refers to the end of the ith year or the beginning of (i+1)th
year; thus the end of the investment project, which is the end of the third year, is denoted with
index 3. The cash flows at time 0 and 1 are given and these are entered in their corresponding
cells. As the cash inflow at 2 is more than that at 1 by X, and that at 3 is more than that at 2 by X,
the entries in cells D6 and E6 are the formulae =C6+$B$3 and =D6+$B$3 respectively.
The cells F6 and G6 are used for NPV and IRR respectively. The formula in F6 is
NPV(D3,C6:E6)+B6. This formula may appear somewhat awkward to you, especially if you are a
beginner; you may expect to see instead the formula NPV(D3,B6:E6), because the series of cash
flows are contained in the range B6:E6,and therefore the range C6:E6 specifies the cash flows
only incompletely. The necessity for the above awkwardness arises because of the way NPV
function operates. This function always assumes that the first cell of the range which is specified
as the second argument of the function consists of the cash flow at the end of the first year; that
the next cell consists of the cash flow at the end of the second year and so on. With this
assumption it finds the net discounted value of cash flows at the beginning of period 1. Therefore,
in using this function, include in its argument only the range for cash flows from time 1 onwards,
and if there is a cash flow at 0 add it separately to the NPV.
What happens if you give wrongly, using common sense, the formula NPV(D3,B6:E6) in cell F6?
Then, the flow at time zero would be interpreted by the system as the flow at time 1, the flow at 1
would be interpreted as that at 2 and so on; as a result the value of the function would be the net
discounted value at time 1 (that is, one period prior to the origin) and not the one at time 0. That
is, the answer given by the function would be the actual NPV divided by (1+d), where d is the
discount rate.
The formula in cell G6 is IRR(B6:E6,0.18); the first argument is the range of cash flows
beginning from time zero; the second argument is the users guess for the value of IRR. Note that
the range for IRR function is to be specified differently from that for NPV.
With the different entries in place, it is easy for you to conduct experiments with this spreadsheet.
Simply change the value in B3 from 500 to 1300 with a step size of your choice and for each
value read off the NPV and IRR values from cells F6 and G6 respectively.
As you experiment with various ranges of values, you will feel the need to record the values of
the independent variable (also called the input variable) and the corresponding values of dependent variable; making these entries yourself in some part of the spreadsheet will be very tedious
and inefficient. To overcome this difficulty, you can use the Data Table feature already introduced
in the last example. Choose an empty part of the spread sheet, which in the present case is
B10:D18, as the range for your data table; In the first column of this table, leave the first cell
blank, and enter in the other cells the values of the variable X that you want to experiment with;
the next two columns, the second and the third, are to be filled by the computer; enter at the top of
the second column, that is in cell C9, the formula for the first dependent variable , which in this
case is =F6; in the corresponding cell of the third column, that is in cell D9, enter the formula for
the second dependent variable, which in this case is =G6. Now, highlight the table range B9:D18;
Page 24 of 260
IIMA/CISG0104TEC
Page 25 of 260
IIMA/CISG0104TEC
NPV
IRR
1
2
1000
0.18
4
5
Time(Yrs)
Cashflow
-10000
4000
5000
6000
Rs.632.54 22%
7
8
Rs.632.54
22%
10
500
-335.185
0.159753
11
600
-141.641
0.171527
12
700
51.90404
0.183076
13
800
245.4487
0.19441
14
900
438.9933
0.205541
15
1000
632.5379
0.216478
16
1100
826.0825
0.227231
17
1200
1019.627
0.237807
18
1300
1213.172
0.248215
700
4500
0.18
Time(Yrs)
CF Proj_A
-10000
4000
4700
5400
Rs51.90
CF Proj_B
-15000
3000
7500
12000
Rs232.33
3 NPV
6
7
8
9
10
11
(Rs180.42)
4500
4550
4600
4650
4700
12
700
-180.423
-277.195
-373.967
-470.7394622
-567.512
13
800
13.12208
-83.6502
-180.423
-277.1948447
-373.967
14
900
206.6667
109.8944
13.12208
-83.65022714
-180.423
15
1000
400.2113
303.439
206.6667
109.8943904
13.12208
16
1100
593.7559
496.9836
400.2113
303.4390079
206.6667
17
1200
787.3006
690.5282
593.7559
496.9836254
400.2113
Page 26 of 260
II.5
IIMA/CISG0104TEC
A company supplies its product to four cities from five warehouses. The shipping plan is given in
range B3:D8 of the spread sheet of Figure-5a. For example, it is planned to ship 150 units from
ware house-1 to city-3, as indicated by the third row of this range. The per unit shipping cost per
unit distance is given as 5 monetary units. This is given in cell K2 of Figure-5a. The distances
between the five warehouses and the four cities are given in range C13:F17.For example, the
distance between warehouse-2 and city-3 is 17 distance units. With this data compute the cost of
shipping the various quantities given above between the warehouses and the cities.
1. Compute th
st of shipping one unit between each pair of warehouse and city. That is, you
need to obtain a five by four array by multiplying each element of the distance array by the per
unit cost given in K2. Let us allocate the range C22:F26 for this purpose. Highlight this range and
enter in it the following array formula (ctrl, shift, enter):
= $K$2*C13:F17
2.In the range E3:E8, compute the cost between each warehouse city pair for the given shipping
plan, by multiplying the shipping quantity with the per unit shipping cost between the
corresponding warehouse and city. Focus on the data in row-3 of the spreadsheet. Here the
quantity of shipment is 100, the ware house index is 2 and city index 3. The per unit cost of
shipment for this warehouse-city pair is obtained as 85, by looking up the cost matrix in its
second
row
and
third
column.
The
corresponding
lookup
formula
is
INDEX($C$22:$F$26,B3,C3). This value needs to be multiplied by the quantity of shipment
given in D3 to obtain the cost of shipment. Thus the formula to be entered in cell E3 is:
=D3*INDEX($C$22:$F$26,B3,C3)
As a similar computation needs to be done in other cells of the range E3:E8, copy the above
formula to E4:E8.
Extension to example 5. Suppose rows and columns of the distance matrix are labeled with
names of their respective warehouses and cities respectively as shown in Figure-5c; similarly, in
the shipping plan, instead of warehouse and city numbers, the corresponding names are given. In
this case, in each transaction, you need to convert the warehouse and city names to the row and
column numbers in which their costs occur in matrix H13:K17. This requires you to use a
function which can tell you the position of a given value within a vector of values. This capability
is provided by the function MATCH. The MATCH function is to be provided with two
parameters: the key and the range address of the lookup vector. The lookup vector can be vertical
or horizontal. The formulae to be used for this case are listed in Figure-5d.
Note that the two functions INDEX and MATCH are somewhat opposite in their tasks: INDEX
returns a value occurring at a specified location in a specified vector or a matrix, whereas
MATCH returns the location in a vector where a given value occurs.
General points about array formulae.
1. In the above example, one array formula was introduced, for multiplying each element of a
vector by a scalar. The output was obviously a vector. In general, when the output of a
computation is a vector or a matrix, and when the computation is done through an array formula,
the procedure for typing in the formula is special. First highlight the range that is to contain the
results of the computation. Then, type in the formula by beginning as usual with an equals sign;
after the whole formula is typed in, end it by pressing simultaneously the three keys, Control,
Shift and Enter.
There are array formulae for several matrix operations. Some of these are : MMULT for
multiplying two matrices, MINVERSE for inverting a matrix, TRANSPOSE for obtaining the
transpose of a matrix. For adding two matrices there is no special function; the formula consists of
Page 27 of 260
IIMA/CISG0104TEC
references of the two matrices separated by the plus (+) symbol. Similarly, the formula for
subtracting two matrices consists of the reference of the first matrix followed by a minus sign
followed by the reference for the second matrix.
2. Several other formulae use ranges (or arrays) as their arguments, but their results are not arrays.
As the result of such a formula is not an array, it should be entered simply by pressing the Enter
key. An example is the VLOOKUP function.
Another function of this category is the SUMPRODUCT function for which the arguments are
two arrays of identical dimensions; the result would be the sum of the products of the
corresponding elements of the two arrays. Consider for example the formula
=SUMPRODUCT(A1:C3,A3:C3). The formula multiplies the corresponding elements of the two
three-element vectors A1:C3 and A3:C3, and takes the sum of the three products, which is its
final result; that is, its result is (A1*A3) + (B1*B3) + (C1*C3). Consider as another example the
formula =SUMPRODUCT(A1:C3, F7:H9). In this formula each argument refers not to a vector
but a rectangular range, consisting of three rows and three columns, that is nine cells. Therefore
the result of the formula is the sum of nine products, each product involving a pair of
corresponding elements of the two ranges; thus, the result of the formula is (A1*F7) + (B1*G7) +
(C1*H7) + (A2*F8) + (B2*G8) + (C2*H8) + (A3*F9) + (B3*G9) + (C3*H9).
In statistical computations you need to evaluate
(x y)
corresponding elements of two vectors of the same length; this can be computed by the function
SUMXMY2 with appropriate arguments. Similar functions are available for computing sum of
squares of corresponding elements of two vectors of the same length; and for difference of two
squares of two vectors of the same length.
Figure-5a: Spreadsheet for Computation of Shipping Cost
A
1
2
Warehouses
Warehouses
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
W.No.
2
2
1
1
4
5
1
2
3
4
5
1
2
3
4
5
C
D
E
F
Shipping Cost Computation
City
No
Quantity
Cost
3
100
8500
4
200
25000
3
150
11250
2
75
3750
2
35
3850
1
40
5400
1
12
10
5
18
27
Distances
Cities
2
10
16
30
22
17
3
15
17
22
17
16
4
20
25
28
16
20
1
60
50
25
90
135
4
100
125
140
80
100
Page 28 of 260
IIMA/CISG0104TEC
S.No. Range
1
C22:F26
Formula
=$k$2*C13:F17
=D3*INDEX($C$22:$F$26,B3,C3)
E3
Comments
An array formula. Computes the
shipping cost per unit between
each warehouse and city
Total cost of shipping the
quantity indicated in D3, between
ware house indicated in B3 and
city indicated in C3.
This formula is copied to E4:E8.
2
2
1
1
4
5
MUM
NAG
MUM
BHV
BHV
ALB
City
Quantity
No
3
100
4
200
3
150
2
75
2
35
1
40
Warehouse
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
L M
Cost
8500
25000
11250
3750
3850
5400
AHD
BLR
CAL
DEL
HYD
ALB
12
10
5
18
27
Distances
Cities
BHV MUM NAG
10
15
20
16
17
25
30
22
28
22
17
16
17
16
20
E3
G3
Formula
Match(B3,$G$3:$G$17,0)
Comments
Returns the position of BLR
in vector G3:G17.
Copy this to range C4:C8
Match(D3,$H$12:$K$12,0)
Returns the position of MUM
in the vector H12:K12.
Copy this to range E4:E8
$M$3*$F$3*Index($H$13:$K$17,C3,E3) Copy this to range G4:G8
Page 29 of 260
II.6
IIMA/CISG0104TEC
The planning commission of a country has divided its economy into two sectors, agriculture and
manufacturing, during its preliminary analysis. All input quantities, output quantities and
consumption quantities are expressed in standard monetary units (MUs).
The two sectors are mutually dependent: each sector uses in its production, its own outputs and
those of the other sector.
Specifically, the output of the agriculture sector is used in the following three ways:
1.
2.
3.
by the agriculture sector itself at the rate of 0.1 units of input per one unit of agricultural
output
by the manufacturing sector at the rate of 0.6 units of input per one unit of manufacturing
output
all the remaining, for direct internal consumption or for exports
by agriculture sector at the rate of 0.5 units of input per one unit of agricultural output
by the manufacturing sector itself at the rate of 0.1 units of input per one unit of
manufacturing output
all the remaining, by direct internal consumption or by exports
The planning commission wants to plan the sectoral outputs such that the quantities available for
direct internal consumption and exports are 20 units of agricultural output and 50 units of
manufacturing output. What should be the total outputs of each of the two sectors to achieve the
above target?
In the following discussion we assume that the reader is familiar with the idea of a matrix and
with matrix operations such as matrix multiplication, and matrix inversion.
The above is a standard problem in economics and is studied under the subject of input-output
analysis. Refer to a standard book on economics or applications of matrices (see Hadley, G,
Linear Algebra, Narosa Publishing House, New Delhi, 1987) for further details related to this
problem. The solution of this problem consists of the following steps:
1. Represent the interdependencies between the sectors in the form of a square matrix A, with the
number of rows and columns each equal to the number of sectors; in this case, A is a 2 by 2
matrix. The element in the ith row and jth column of this matrix denotes the number of units of
sector I needed as input to produce one unit of output of sector j. Therefore, the A matrix of the
above example is:
A =
0 .1 0 .6
0 .5 0 .1
Enter the elements of the above matrix in the range B4:C5 of your spreadsheet, as shown in
figure-6a below.
2. Represent the quantities of direct consumption and export of the outputs of each sector as a
column vector b. In our example the b vector has two rows, as shown below:
20
50
b =
Page 30 of 260
IIMA/CISG0104TEC
1 0
I =
0 1
in the range G4:H5.
4. Compute the difference between the two matrices I and A. As I-A is a two by two matrix, you
need a two by two range in your spreadsheet to contain this matrix. In the figure below, the range
J4:K5 serves the above purpose. The matrix difference is obtained by an array formula. To enter
the array formula, first highlight the range J4:K5 which is to contain the result of this array
formula. With the highlight on, enter the formula = (G4:H5 B4:C5) in the formula box and at
the end of your entry press the three keys control, shift and enter together; this would tell the
computer that what you have entered is an array formula ( and not an ordinary formula, which
would have been ended by the pressing of the enter key), and the output of the array formula is
spans the array indicated by the highlight. After the array formula is entered, you will notice that
the entire formula is automatically enclosed within curly brackets, and hence would appear as
{= (G4:H5 B4:C5) }.
5. Compute the inverse of (I-A). The inverse of (I-A) is also a 2 by 2 matrix and in the
spreadsheet of figure it is contained by the range B8:C9. As you need to compute a matrix, you
need to enter an array formula with the range B8:C9 highlighted; the formula is =
MINVERSE(J4:K9). As before, after typing in the formula press Control, Shift and Enter keys
together.
6. You are now ready to obtain the two row vector, X, of the aggregate output of each sector.
Allot the range E8:E9 to contain the X vector. The formula for X is X = (I-A) 1 * b. Thus X is
obtained by the multiplication of two matrices, and the spread sheet formula to perform this task
is MMULT. Therefore, highlight the range E8:E9 and enter the array formula = MMULT(B8:C9,
E4:E5) in it to obtain the X vector.
Figure-6a: Spreadsheet to perform Input-Output Analysis
A
1
2
3
4
5
6
7
8
9
(I-A) 1
1.76471
0.98039
F G
Input-Output Analysis
Vector-b
Matrix-A
0.1
0.5
0.6
0.1
20
50
1.18
1.76
X= (I-A) 1 * b
94.117647
107.84314
Matrix-I
1
0
Matrix (I-A)
0
1
0.9
-0.5
-0.6
0.9
Range
J4:K5
B8:C9
E8:E9
Array Formula
=(G4:H5-B4:C5)
=MINVERSE(J4:K5)
=MMULT(B8:C9,E4:E5)
Explanation
To compute (I-A)
To compute the inverse of (I-A)
To multiply the matrix (I-A) -1 with the vector b
Page 31 of 260
II.7
IIMA/CISG0104TEC
The chief minister of a certain state in India wants to know the influence of literacy rate on the per
capita income. Specifically, he would like to estimate a linear relationship between per capita
income and literacy rate, which would help him answer questions such as : what would be the per
capita income if the literacy rate is ninety percent?
To answer the above question data on per-capita in come (in Rs 00) and literacy rate (percentage)
of twenty one states was collected (source: Statistical Outline of India, 1996-97, Tata Services
Limited, Deparment of Economics and Statistics) as shown in Figure-7a.
Figure-7a. State-wise Per Capita Income and Literacy Rate
State
Andhra
Assam
Bihar
Delhi
Goa
Gujarat
Haryana
Himachal
Karnataka
Kerala
MP
Maharashtra
Manipur
Meghalaya
Nagaland
Orissa
Punjab
Rajasthan
Tamil Nadu
UP
WB
PerCapita
(Rs'00)
R
66.51
59.16
36.5
147.14
116.58
76
103.59
65.19
70.29
62.42
54.85
109.64
53.62
55.19
58.7
47.26
123.19
52.2
73.52
47.44
60.55
Literacy
(%)
L
44.1
52.9
38.5
75.3
75.5
61.3
55.8
63.9
56
89.8
44.2
64.9
59.9
49.1
61.6
49.1
58.5
38.6
62.7
41.6
57.7
Using the above data we need to estimate a linear relationship ( or linear regression equation)
between per capita in come( R ) and literacy rate ( C ). This will be of the form:
R = m* L + C
The above equation consists of dependent variable R, one independent variable L, and two
parameters m and C. The parameters m and C are to be estimated from the data, such that the sum
of squares of differences between estimated and given values of R at the twenty one given values
of C will be a minimum. Once m and C are known, the equation can be used for purposes such as
estimation, and hypothesis testing.
For estimating the above equation, use the array function linest of the excel package. For this,
follow the steps given below (see figure-7b):
1. Enter the known values of dependent variable R in the range C21:C41, and those of
independent variable in the range D21:D41.
Page 32 of 260
IIMA/CISG0104TEC
2. Choose the range G22:H26 with five rows and two columns ( which is equal to the number of
independent variables plus one) to contain the results of the linest formula.
3. Highlight the output range G22:H26, and enter the formula
= LINEST( C21:C41,D21:D41,TRUE,TRUE)
and end it by pressing simultaneously the three keys Control, Shift and Enter. In this formula the
first argument indicates the range which contains the known values of the dependent variable, the
second indicates the range containing the known values of the independent variable, the third
parameter indicates that the regression equation should not assume that constant is zero, and the
fourth parameter indicates that in addition to the coefficients and constant value, the output should
contain other statistics.
4. As soon as the formula is entered, the results appear in the output range.
5. For estimating the per-capita income for a given literacy rate, enter the literacy rate in the cell
G29. In cell G30 enter the formula
=G22*G29+H22
to get the desired estimate.
The numbers in the output range are to be interpreted as follows:
Values in the first row(G22:H22): m= 1.24 and C = 2.29; therefore the regression equation is
R = 1.24 * L + 2.29
Values in the second row (G23:H23): The standard error of m is 0.43 and the standard error of
constant is 25.4
Values in the third row (G24:H24): r 2 = 0.30, and standard error of the dependent variable=25.06
Values in the fourth row (G25:H25): Value of F statistic = 8.2 and degrees of freedom = 19
Values in the fifth row (G26:H26): SS reg = 5147.8 and SS residuals = 11929.1
An explanation of the meaning of the above statistics is beyond the scope of this note.
The reader is cautioned at this point not to take the above way of formulating the causal relation
as a correct one. The example is concerned merely with illustrating the mechanics of estimating a
linear equation connecting a dependent variable with one or more independent variables. It is not
concerned with discussing modeling or statistical nuances of regression analysis. In fact, it is not
at all advisable to estimate a regression equation unless the analyst is clear on the concepts
behind regression analysis. Decisions based on such immature attempts can lead to disastrous
consequences.
General points regarding regression equation estimation:
1. Note that the general syntax for the LINEST function is:
LINEST(range of known y, range of known x1, range of known x2,range of known xm, want to
estimate constant, want to get regression statistics)
The above syntax allows multiple independent variables X1,X2,,Xm, where m is the number of
independent variables. When there are multiple independent variables, you can enter them in
adjacent columns of your spreadsheet or in non-adjacent columns. When the variable values are in
adjacent columns, you can specify a single range for all variables together. When multiple
Page 33 of 260
IIMA/CISG0104TEC
independent variables are given the regression coefficients are printed in the order: coefficient of
mth variable first, then that of (m-1)th variable,, and in the last that of the first variable.
Note that the last two parameters in the above syntax are boolean that is you can give TRUE or
ALSE in the corresponding position. If you say 'FALSE' for 'want to estimate constant', then the
constant in the regression is assumed to be zero; otherwise, it is estimated. If you say 'FALSE' for
'want to get regression statistics', then the system outputs only the regression coefficients and
constant; otherwise, several other statistics associated with the regression line are output.
Figure-7b: Spreadsheet for regression calculation in Example-7
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
II.8
Andhra
Assam
Bihar
Delhi
Goa
Gujarat
Haryana
Himachal
Karnataka
Kerala
MP
Maharashtra
Manipur
Meghalaya
Nagaland
Orissa
Punjab
Rajasthan
Tamil Nadu
UP
WB
PerCapita
(Rs'00)
R
66.51
59.16
36.5
147.14
116.58
76
103.59
65.19
70.29
62.42
54.85
109.64
53.62
55.19
58.7
47.26
123.19
52.2
73.52
47.44
60.55
State
D
E
F
G
H
I
Regression Equation for Literacy rate and per capita income
Literacy
(%)
Results (G22:H26)
L
L
C
44.1
52.9
Coeffs 1.2418793 2.287759
38.5
Se 0.4337055 25.39935
75.3
R2,Se(y) 0.3014489 25.05684
75.5
F,df 8.1991536
19
61.3
Ssreg, SSresid 5147.7976 11929.05
55.8
63.9
56
90
89.8
114.0569
44.2
64.9
59.9
49.1
61.6
49.1
58.5
38.6
62.7
41.6
57.7
This example deals with the facilities of Excel for selectively retrieving a part of the information
from a specified range and processing it further in various different ways.
Figure-8a contains, in the range A1:F11, data on the staff of a company. The first row of this
range, that is row 1, contains the labels of the data items, and the other ten rows contain the data
values, one row for each employee. For the sake of convenience, let us refer to the rows as
records, and columns as fields. Call the above range (including the labels row) as input range or
data base or list range.
Question: Extract from the above data base the details of all the female employees with experience of 8 years.
Through a simple visual inspection, you can easily answer the above question. The employee
with S.No. 4 is the only one who is female and has eight years of experience. Hence the
corresponding record (that is row 5) is the record to be extracted. But visual inspection becomes
Page 34 of 260
IIMA/CISG0104TEC
difficult when the input range is large and the queries are complex. For such cases, Excel provides
some useful menu options under the group Data and functions called data base statistical
functions.
For answering the above question, choose the menu options Data
Sort & Filter
Filter. As a
result of this, each of the field titles in row 1 will have a button similar to the drop down box
button appears at its right edge. Since we are interested in filtering the records based on values in
the fields Sex and Exp, first press the button on the Sex field title. A box showing the different
values available in this field appears. Click on the value F, indicating that you would like to see
those records with value F in Sex field. Immediately, all records of the data range, except the
three corresponding to the female employees, will disappear. Next, click on the button in the Exp
field. Again from the box that appears click on the value 8 indicating that from among the records
that are currently being shown, you would like to see only those with 8 in the Exp field. Now only
one record, that corresponding to serial number 4, remains in view. If you want to get back on
display all the records simply choose the menu options Data
Sort & Filter
Filter. Note that
filter option is like a toggle switch. In the earlier versions of excel, this option was called autofilter.
Figure-8a : A Personnel Data Base
A
1
S.No.
2
1
3
2
4
3
5
4
6
5
7
6
8
7
9
8
10
9
11
10
B
Name
Agarwal B
Jain A
Rao D
Sharma V
Desai N
Patel M
Narayan V
Rao K
Srinivas J
Nayar Y
C
D
E
F
G
Age Exp Sex Salary Cadre
28
3F
1500 A
30
4M
1600 A
26
2M
1400 B
32
8F
2000 B
29
4M
1400 A
33
9M
2200 C
44 20 F
1000 C
34
8M
2000 C
44 21 M
6000 A
27
2M
1100 D
14
15
A
B
S.No. Name
C
Age
D
Exp
>5
E
F
Sex Salary
F
The filter option works only when the criteria for choice are simple ones, and the filtering is to be
done based on only one field at a time. How to deal with questions such as the following: Give
the details of the female employees whose experience is more than five years. Here, the criterion
involves an inequality, namely, Exp >5.
For this we need to use the feature called advanced filtering. Advanced filtering requires you to
prepare a range called a criterion range. The criterion range specifies for each field the kind of
values that are to be possessed by a record for it to be selected. The first row of the criterion range
should contain the names of the fields, with the same spellings as in the original data range, which
are to be used in the selection process. They need not however be in the same order as in the
original data range (also called list range). In the second row specify underneath each field
heading the corresponding selection criterion. For answering the present question, select the range
A14:F15 as the criterion range (Figure-8b). Fill in A14:F14 with the field headings. In D15 type
>5 and in E15 type F. This means we are interested in selecting records with the following
feature: The value in the Exp field should be greater than 5, and the value in Sex field F. Because
the other fields are left blank, those fields do not play any role in the selection process; in fact, a
blank value is supposed to match with every value. Suppose our intention is to copy the selected
Page 35 of 260
IIMA/CISG0104TEC
records into a certain range, say from row 27 onwards. Fill A27:F27 with field headings so that
the output can appear as per these headings. Now select the menu options Data Sort & Filter
Filter Advanced.
In the dialogue box that appears, fill the required addresses as follows, after choosing the option
copy to another location:
List range
A1:F11
Criteria range
A14:F15
Copy to
A27:F27
When you press the OK button of this box, two records will be chosen and will be written in rows
28 and 29.
If you want to filter records with a specified name, you should be a little cautious in making
entries in your criterion range. Note first of all that while comparing names, small letters and
capitals are not distinguished. Secondly, if you give the desired name directly in the
corresponding cell of the criteria range, you will be surprised to find that all the records with
names whose first few letters are the given name, no matter what the other part consists of, will be
filtered. For example if you give Ram in the criterion range, even records with Rama, Ramraju,
Ramanna etc will be selected, because all the above names begin with Ram. To obtain an exact
match, specify the entry in the criteria range as ==text, where text is the desired string; for
example, in the case of Ram the entry in the criterion range would be ==Ram; in this case only
records with Ram in their name field will be selected. An alternative way of accomplishing exact
string match during filtering would be to specify EXACT function in the criteria range. The
EXACT function would be explained later in the example on text processing.
It is possible to handle still more complex queries, queries having several ANDs and ORs (ex:
Exp <10 yrs AND Exp >5 years); the rules for specifying the corresponding criteria will be
discussed later.
Question: Find from the above data base the average salary of all female employees.
There are two ways of answering this question. The first is to extract the records of all female
employees using the advanced filter option mentioned above and then to find the average value of
the entries in the Salary field of the output range. This, however, involves the use of an output
range; then in `what if analysis, the advanced filter option has to be repeated every time an input
value is changed. Furthermore, the size of the output range itself keeps changing, with changes in
input values. These problems can be avoided by using an alternative approach.
In the alternative approach, we achieve the desired result without explicitly writing the selected
records in an output range, (in fact we do not need an output range) but by directly doing the
required computation through a function, which uses the input range, criterion range, and the
desired field position as its arguments. The function to be used in this example is
DAVERAGE(A1:F11,6,A14:F15). Enter this function in an empty cell, and as soon as it is calculated you will see the result 1500, which is the average salary of the three female employees in the
data base. As this entry is a function, it will be recomputed whenever any change is made in the
input (unless the automatic recalc facility is switched off). The DAVERAGE function belongs to
a family of functions known as data base statistical functions, each of which computes a certain
statistic of a specified field in the records selected when a criterion is applied to an input range.
The different statistics that can be computed are: maximum value, minimum value, sum, standard
deviation, average, variance, and number of values. All these functions have the same format: the
function name begins with D, and each function has three arguments. The first argument is the
address or name of the input range; the second is the position of the field to be used in the compu-
Page 36 of 260
IIMA/CISG0104TEC
tation, the offset of the left most field being counted as one; the third argument is the address or
name of the criterion range.
Use of data base statistical functions requires good insight, but a mastery of these enables the user
to perform many tricky, intricate and complex tasks in spread sheets.
Question. In Figure-8a, how do we re-arrange the given data in ascending order of salary? For
this we have to use the Data Sort option. First highlight the list range along with the field titles,
like in the data filter operation. Choose the menu options Data
Sort & Filter
Sort. A table
appears with three columns with the respective titles Column, Sort on, and Order. Each of the
above titles has below it a drop down box. In the column titled as Column, choose the field on
which the sorting needs to be done, which in your case is Salary. In the Sort on column, specify
whether the sorting needs to be based on values or colour of the cell, background or fore goround
colour; choose the option values. In the last column, specify the order of sorting, ascending or
descending; in your case, the order is ascending, ie A to Z. Then press the OK button, to see the
records rearranged in the desired order (Figure-8C). In case the sorting has more than one level,
that is if you want to use a secondary sort key in case there is a tie in the first, you need to give the
corresponding information by adding to the above table as many levels as you need.
Figure -8c. Personnel data base: Sorted in ascending order of Salary
A
1
2
3
4
5
6
7
8
9
10
11
S.No. Name
7
10
3
5
1
2
4
8
6
9
Narayan V
Nayar Y
Rao D
Desai N
Agarwal B
Jain A
Sharma V
Rao K
Patel M
Srinivas J
20 F
2M
2M
4M
3F
4M
8F
8M
9M
21 M
1000 C
1100 D
1400 B
1400 A
1500 A
1600 A
2000 B
2000 C
2200 C
6000 A
It is not necessary that the key field is numeric; it can also have alphabetic values. In the case of
alphabets the order A-Z is considered ascending, and Z-A as descending (strictly speaking, the
order is decided by the ANSI codes of the different characters). In the coding system used by the
EXCEL system (Appendix-V) the order of occurrence of the different characters is the digits (09), then the capital letters (A-Z), and then the small letters (a-z).
Question. In Figure-8a you are also given information on the cadre to which an employee
belongs. Find for each cadre the minimum salary in each sex, and represent the information in the
form of a table, called pivot table, showing the cadres on rows and sexes on columns.
Steps to be followed:
Select the data table
Select the menu options: Insert Tables
Pivot Table Wizard with 4 steps appears.
Pivot Table
Page 37 of 260
IIMA/CISG0104TEC
In step1, it wants to know where is the data you want to analyze; select the answer option:
Microsoft Excel List or Database
In step2, give the range of the database
In step 3, the pivot table template appears, with blank rows and columns. Into the column, drag
and drop the field, sex; into the row, drag and drop the field cadre; and into data area, drag and
drop the field salary. The data will be summarized by sum of salary by default. The summary
statistic will appear as a button. Click on it and you will see a list of possible statistics, from
which choose min.
Then say finish. It wants to know the location of the pivot table; you can say existing worksheet.
The pivot table that is obtained as a result of executing the above steps is shown in Figure-8d.
When you change the source data, the result may not be automatically reflected in Pivot table. In
that case choose the menu options: Data Refresh All Refresh
Even after generating a pivot table, it is possible to modify it; for example, you can change the
field being exhibited in the columns, rows or the field being summarized in the data area. For this
purpose, you need to first highlight the pivot table that needs to be modified and then choose the
menu options Insert Tables
Pivot Table; then a dialog box containing a picture of the pivot
table along with one button for each field appears. By dragging and dropping the field buttons or
by double clicking on the data area the desired modifications can be brought about.
Figure-8d. A Pivot Table
Min of Salary
Cadre
A
B
C
D
Grand Total
Sex
F
1000
1500
2000
1000
Grand
Total
1100 1000
1600 1500
2000 2000
6000 6000
1100 1000
A pivot table is an interesting and useful feature for two-way summarization of data. The default
summary statistic for summarizing the data is sum. The other options are: count (how many data
items are there?), average of the data items, maximum value, minimum value, product of the data
items, standard deviation and variance of the items.
Page 38 of 260
II.9
IIMA/CISG0104TEC
The following table (Figure-9) shows the maximum and minimum daily sales revenue earned by a
company in 10 cities, considering the sales in the month of June.
1. How many cities are there whose maximum sales revenue was greater than Rs 50000 OR the
average sales revenue (take the average as equal to half of the sum of maximum and minimum
revenues) was greater than Rs 35000?
2. How many cities are there whose maximum sales revenue was greater than Rs 80000 AND
minimum was less than Rs10000 ?
Figure-9. Spreadsheet for Example-9.
A
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
City
A
B
C
D
E
F
G
H
J
K
Max
>50
B
C
D
Sales Revenue per day during June
(Rs 000)
Max
Min
90
30
40
40
60
50
85
20
40
20
35
30
85
5
75
48
55
45
64
60
X
TRUE
Max
>80
Answers
8
1
Q1
Q2
Min
<10
In order to answer the questions first of all give the following names to the various ranges as below:
Range
A3:C13
Range Name
Datalist
A15:B17
A19:B20
CRTR1
CRTR2
Then create the criteria ranges for the two questions respectively in the ranges CRTR1 and CRTR2,
and obtain the answers in cells C16 and C17. The text entries in these cells are already shown in the
figure. Some cells have formulae behind them, and these are shown below:
Cell
B17
C16
C17
Formula
=(0.5*(B4+C4)>35)
=DCOUNT(Datalist,,CRTR1)
=DCOUNT(Datalist,,CRTR2)
Page 39 of 260
IIMA/CISG0104TEC
Let us now discuss the criterion range for question 1. This question asks us to count the number of
rows satisfying a condition which consists of two simpler conditions connected by OR. In such a
case, the criteria range should consist of multiple rows, in addition to the field names row, one row
for each condition. Thus we have a total of three rows in CRTR1, one for the field headings, and the
remaining two showing the two conditions respectively. The first condition is straight forward: the
value in the Max column should be greater than 80. Hence give in cell B16 the entry >50. Obviously,
the field name is specified in cell B15 as Max. For the second condition, a formula is to be specified,
to the effect that 0.5*( value in Max + value in Min) should be greater than 35. This calls for using
cell addresses in the formula, and these vary for each of the rows of the Datalist. In such case, the rule
is to specify the formula that applies to the first data row (the one following the headings row).
Accordingly, the formula to be given in the third row of the criterion range in its second column is :
(.5*(B4+C4) > 35 ). As this condition refers to cells of multiple columns, the column heading to be
given in B15 is not clear. In such a case, you are allowed to give any heading, as long as the given
heading is not one of the field headings occurring in the Datalist; hence, we have chosen the heading
X. In the DCOUNT function of cell C16, the second parameter is left blank, implying that all the
records of Datalist that satisfy the criterion of CRTR1 need to be counted.
The second question also contains a compound condition; however, this time the two conditions to be
satisfied are joined by an AND. In this case, we need to allocate one column for each of the
conditions in the criterion range, and all conditions should be given in the same row under their
respective columns. Accordingly, the criterion range CRTR2 consists of two columns and just one
row, in addition to the headings row. As the both cells of row 20 have entries, these are interpreted to
jointly indicate a composite condition whose component conditions are joined by AND. Therefore
the condition applied is (Max>80 AND Min<10). The use of DCOUNT for the answer in cell C17 is
obvious.
The main points related to composite conditions in data filter are:
1. If a criterion range has multiple rows (in addition to the headings) each row is interpreted to
refer to one condition; when this criteria range is used as a part of data filter or in a Dformula (like DCOUNT, DAVERAGE ), a row of the data list is selected, if it satisfies at
least one of the conditions (ie OR is used for selection).
2. If a row has multiple columns then the conditions under each column are combined using
AND; that is, for a row of the data list to pass such a criterion, it should pass all conditions
contained in the criterion row.
3. If a criterion range has multiple rows and columns, then the rules stated above are applied
together.
4. If an expression in the cell of a criterion range consists of a formula with cell addresses, then
the corresponding field heading should be different from the field headings in the data list.
The heading could be an arbitrary one, or can even be blank.
5. If a formula has to be used as a part of a condition, the cell addresses in the formula should
be those referring to those of the cells of the first row of the data list. In applying the formula
for selection of different rows in the data list, the system internally adjusts the formula by
changing the relative cell references, if any, as per the rules applicable to copying of
formulae.
For further details related to criteria ranges, you are referred to the on-line help feature of the Excel
package. Specifically, invoke the Help menu item, and within that go to the Index tab, and seek help
on the item criteria.
Page 40 of 260
II.10
IIMA/CISG0104TEC
Treat the range c3:J10 of a spreadsheet (see Figure-10a or Figure-10b) as depicting the squares of
a chess board; that is, c3:j3 as the first row of the board, c4:j4 as the second row, and so on , and
finally, c8:j8 the eighth row. Similarly, the range c3:c10 depicts the first column, d3:d10, the
second column and so on, and finally the range j3:j10 the eighth column. The row numbers of the
chess board are entered in the column to the left of the board ( that is, in column B, in the range
b3:b10), and the column numbers in the row above the board, that is in the range c2:j2. Initially,
the board is empty. A bishop is to be placed in a certain square of the above board; the row
number and column number of the Bishops position are given in cells A1 and B1 respectively.
Indicate the position to be occupied by the Bishop in colour grey, and the squares to which the
Bishop can move, from the given position, in colour red . Of course, an empty chess board with a
lone Bishop is an absurdity in a real game of Chess; the problem is meant merely to illustrate, for
a learner, the permissible moves of a Bishop.
As per the rules of chess, a Bishop can move to any square in the same diagonal(s) as its current
square, without jumping any square, already occupied by a piece, if any.
For example, suppose the current position of the Bishop is row-3, and column-3 ( as in figure).
Let us refer to each square of the board with its row number and column number, mentioned in
that order. As can be seen from the figure, the Bishop is at the intersection of two diagonals: 1. the
climbing diagonal starting at the square (5,1), and ending at the square (1,5), and 2. the downward
diagonal starting at square(1,1) and ending at square (8,8). The Bishop currently occupies the
square (3,3). Thus, the Bishop can move into a square of any of the above two diagonals, that is
Page 41 of 260
IIMA/CISG0104TEC
into any of the squares (5,1), (4,2),(2,4),(1,5), (1,1), (2,2), (4,4),(5,5),6,6),(7,7), and (8,8). These
squares, according to the problem, are to be filled with red. The square (3,3) which is currently
occupied by Bishop is to be filled with grey.
Although the diagonal squares mentioned in the above discussion can be seen easily, identifying
them for spread sheet formulae requires some effort. Referring to the same example as above, can
we derive a rule that tells whether a given square, say (r,c), is on one of the diagonals passing
through the square (br,bc) in which the Bishop is located? A little reflection reveals that, to move
into a diagonal square, you need to travel horizontally by a certain number of squares from the
Bishops current position, and by the same number of squares vertically. Here, by a horizontal
move, we mean a move rightwards or leftwards, and by a vertical move, a move upwards or
downwards. Therefore, to figure out whether the given square is on a diagonal with respect to the
Bishop, all we need to find is whether the horizontal distance, in squares, between the Bishop and
the given square is the same as the vertical distance between the Bishop and the given square; that
is, whether | br r | equals | bc c |. Thus, the rule to be checked is: is it true that | br r | = | bc
c |? If the answer is yes, then we conclude that the given square is on one of the diagonals and
hence is eligible to receive the Bishop, and no implies the opposite.
To make the example even more concrete, suppose bc = 3, and br = 3; that is the position of the
Bishop is (3,3). We want to find whether the very first square of the chess board, that is square
(1,1) is eligible to receive the Bishop. That is, in formulating the rule we need to use r = 1 and c =
1.
From the above paragraph, the rule turns out to be:
is it true that | 3-1 | = | 3-1 |?
It is easy to see that the answer is yes, leading us to conclude that the Bishop can move into
(1,1) from (3,3).
Proceeding further with the same example, let us express the above rule in terms of spreadsheet
notation; that is using the spreadsheet function for the absolute difference, and cell addresses for
(br,bc), and for (r,c). Therefore we need to use, in the rule, A1 for br, B1 for bc, B3 for r (
remember that the row numbers of the chess board are in the range b3:b10) , and C2 for c
respectively. The function that gives the absolute difference between two numbers is ABS. Thus
the required rule is:
=(ABS(A1- B3) = ABS(B1-C2))
The above rule can also be used to find whether the cell in question , that is the cell C3, is to be
filled with colour red.
Using the same logic as above, we can derive rules that tell us , for any given cell on the chess
board, whether it is to be coloured red. For example, the rule for cell H7 which tells us the
condition to be satisfied for the above formatting is:
=(ABS(A1- B7) = ABS(B1-H2))
Suppose that the rule that tells us whether to format a cell let us call such a rule as a conditional
formatting rulecan be stated with relative and absolute referencing conventions that apply to
cell formulae, and further suppose that the conditional formatting rules also can be copied
between cells. Then, the conditional formatting rules need not be devised separately for each cell;
it is enough to devise the rule for the first cell of the chess board , that is for cell C3, and copy it to
other cells. Such a formula for cell C3 would be:
=(ABS($A$1- $B3) = ABS($B$1-C$2)).
It can be easily verified that the above conditional formatting formula when copied (assuming that
such copying is possible) into cell H7 becomes:
=(ABS($A$1- $B7) = ABS($B$1-H$2)), which is the same one derived above .
The above capability for stating conditional formatting rule for the first cell of a range and making
it applicable ( in a relative sense ) to other cells of the range is indeed provided in EXCEL by the
Page 42 of 260
IIMA/CISG0104TEC
conditional formatting menu option. This option enables us not only to specify the conditional
formatting rule, but lso the format to be applied when the formula is true for a cell. The steps to be
followed in formatting the chess board using the conditional formatting feature are as below:
1. Highlight the range C3:J10, which is the chess-board range
2. In the Home tab of the ribbon, the conditional formatting option is contained in the Styles
group. Click on it.
Home
Styles
Conditional formatting
A box drops down with several options. The option Clear rules for the selection removes existing
formatting rules, if any. Choose it , and then repeat the above step (ie step-2), and choose this time
the option New rule. A box with several rule types appears; for the options, choose Use a formula
to determine which cells to format. Then a dialog box appears for you to type in the conditional
formatting formula, and the desired format. In the text box with the label Format values where
this formula is true, enter the formula that you have already designed for the first cell of the range.
Make sure that the formula has been designed with absolute and relative referencing notation
mentioned above. Then the formula is copied internally ( without the users intervention) to other
cells of the range. There is another button underneath the text box, with the label Format. Click
the button and choose from the resulting format cells dialog box, the desired format, which in the
current problem is to fill the cell with red colour. The above series of choices is summarized
below:
Clear rules clear rules for the selection
Home Styles Conditional formatting New rule
Rule type
Use a formula to determine which cells to format
give the formula for the first
cell, and choose the desired format
click OK.
There is still one more problem to be resolved. Soon after the completion of the above steps, not
only are the cells into which the Bishop can move are coloured red, but also the current position
of the Bishop receives the same colour. The problem however requires that the Bishops current
position should be coloured grey, and not red.
The grey colour for the current position can be obtained by entering an additional rule for the
whole range of the chess board by the same new rule route as above; the conditional formatting
rule now should be:
=AND($A$1 = $B3, $B$1 = C$2),
which , expressed in words means,
Are both the following conditions true?:
the row number of the first cell is equal to the row number of Bishops current position
the column number of the first cell is equal to the column number of Bishops current position
In the conditional formatting rules input box, grey colour is chosen by pressing the Format
key.
Now every cell of the chess board has two rules for conditional formatting. There is no guarantee
that for each cell one and only one of them will be true. Indeed for the cell currently occupied by
the Bishop, both the rules will be true. In that case, how is the cell formatted? with red, grey, or a
mixture of both?
The answer is that the rules are organized into a priority order, with the first entered rule getting
the lowest priority, and the last getting the highest priority. The cells format would be the one
corresponding to the first rule in the priority order that becomes true. In the current example, the
second rule gets the higher priority, and hence, the cell containing the Bishop would be coloured
with grey. For each of the other cells only the first-entered rule would be true, and hence they
would be coloured red.
Page 43 of 260
IIMA/CISG0104TEC
The cells coloured as a result of putting the Bishop in position (1,3) or in position (3,3) are shown
in Figures 10a, and 10b respectively.
Conditional formatting: General remarks
The option of formatting cells for which a given formula would be TRUE is quite flexible,
general, and can handle the requirements in a variety of situations. For simpler, more specialized,
and frequently required conditions, the conditional formatting feature provides other options that
would make the users task simple. The reader is encouraged to explore each of the several options
provided by excel under the new rule option. These are:
Format all cells based on values. Here the user can specify for example a colour for the minimum
vale of the chosen range, another colour for the maximum. The system will develop a colour
range beginning with the colour for minimum and ending with the colour for maximum, and
applies the appropriate colour for each value depending on where it occurs between the maximum
and minimum.
Format only cells that contain : Here the user can format a cell based on whether the cell has a
value that is 1. equal to a specific value, 2. greater than a specific value, 3. less than a specific
value, 4. not equal to a specific value, 5. not greater than a specific value, 6. not less than a
specific value, 7. in between two specific values, or 8. not in between two specific values. The
specific values can be given constants, or cell addresses that contain constants.
This option is not confined to cells with numerical values. It can also be used to conditionally
format cells with text values, with date values, with blanks, non-blanks, error messages and no
error messages.
Format only top or bottom ranked values. This option allows the user to specify that the top n or
bottom n values for a specified n should be formatted according to a chosen format. n can also be
specified as a percentage.
Format only values above or below average. This option allows the user not only to specify that
the cells above or below the average value of the chosen range be formatted, but also those which
are one, two or three standard deviations away from the average.
Format only unique or duplicate values.
Conditional Formatting versus Advanced Filter. The option of advanced data filter also serves
somewhat the same purpose as conditional formatting, namely to draw attention to records that
meet specified criteria. However, there are two important differences between the two.
Firstly, conditional formatting rules are reevaluated automatically whenever the contents of any
of the cells change; in the case of advanced filter, the filter needs to be applied again.
The conditional formatting rules can be specified at cell level, whereas the data filter selects a
whole record or rejects a whole recordnot individual cells in a record.
Page 44 of 260
IIMA/CISG0104TEC
Page 45 of 260
IIMA/CISG0104TEC
Next let us consider the formulae in column E. These formulae output a "*" if the date for next
maintenance is exceeded by today's date; otherwise the output would be a blank. What can be
actually compared are not dates themselves, but the serial numbers of the dates. As mentioned before,
when cells are referred in a formula, the internal values are used while evaluating the formula; what is
being displayed is of no consequence. We know that the values in column D are internally available
as numbers. Therefore we should ensure that todays date also is available in one of the cells, say E2
as a serial number. For this, enter the formula =TODAY() in E2. This function takes the date
directly from the system and converts it to the corresponding serial number; hence, whenever the
system date changes, TODAY() automatically re-evaluates today's date. As in the case of column D,
the serial number contained by cell D2 can also be displayed as a date by using the Format -- Cell
menu option. After obtaining today's date in this fashion, the design of formula in cell E8 (and in
other cells below it) is quite simple: it should be =IF(D8<$E$2," *",""). This means that the output
should be "*" in case the serial number of the next maintenance date, which is contained in cell D8, is
less than the serial number of toadies date, which is contained in cell E2(why the dollar signs?);
otherwise no output is needed. This formula is copied from E8 to E9:E13.
In using this spread sheet, whenever preventive maintenance is done for a machine, the corresponding date has to be entered in column B in the cell of the corresponding machine, so that the
spread sheet always reflects the latest status of the machines.
Date Formats You might have already noticed in the above discussion that the above spread sheet
can produce different results depending on how its data is interpreted. For example, the pattern
03/01/90 can stand for the first of March 1990, or for the third of January 1990 depending on whether
the format being followed is mm/dd/yy or dd/mm/yy. This format is to be declared by the user
through the settings in the Regional and Language options under the control panel of your Windows
system. If you are using Windows 2000 XP, choose the menu, icon, and tab options : Start
Settings
Regional and Language Options
Regional Options
Customize
Date. This will
present you with an interactive screen from which you can choose the setting you want; in particular,
you can choose the format in which the date (dd) and the month (MM) numbers are in the relative
positions you want. Furthermore, you can also choose the separator between the three components in
a date; the normal preferences are / or -. If the suggested options do not contain the pattern you want,
you can type in your own pattern using the following notation:
S.No.
1
2
3
4
5
6
7
8
9
String
d
dd
dddd
m
mm
mmm
mmmm
yy
yyyy
Meaning
Day number in the month, with one or two digits depending on the need
Day number in the month, with two digits, the first digit being zero if necessary
Weekday in words
Month number in the year, with one or two digits depending on the need
Month number in the year, with two digits, the first digit being zero whenever needed
Month name in three letters
Full name of the month
Year number in two digit format
Year number in four digit format
To clarify the notation described in the above table, we present below the different ways in which the
date 17 July 2004 is to be input as per the different settings:
S.No.
1
2
3
4
5
6
7
Page 46 of 260
IIMA/CISG0104TEC
Before using a worksheet with dates the user should ensure that the desired format is chosen through
the above command. Furthermore, the date strings that are entered in the spread sheet should conform
to the default format chosen as above; if not, an explicit error message will not occur, but wrong
results are produced because of incorrect interpretation when date data is processed.
Five other options are available for displaying in the form of a date the numerical values (standing for
the serial number of a date) stored in a range. These options are displayed when the user chooses the
menu options Cells Format Format Cells, and, within that, clicks on the tab for numbers.
Format Type
1
2
3
4
5
Format
dd/mm/yy
dd-mmm-yy
dd-mmm
mmm-yy
Dd/mm/yy h:mm
It should be noted that the format desired by the user need not necessarily be one among the above
five. In such a case, the desired format (for example, mm/dd/yy) can be typed in the code box.
Other Date Functions
We have discussed above a date function whose output is a serial number. Excel provides four other
date functions, DAY, WEEKDAY, MONTH, and YEAR, which can be used to convert
such a serial number to its day number within its month, day number within its week, month number
within its year, and year number respectively. For example, suppose the International Date Format
chosen through control panel of Windows is dd/mm/yy. Suppose the date 3/1/97 is entered into cell
A1. Then the function =DAY(A1) in any other cell displays the result 3 indicating that within the
month to which the date corresponds, the date falls on the third day. The function =weekday(A1)
displays the result 6 indicating that the given date falls on the sixth day of its week ( counting the
days as Sunday = 1, Monday = 2, ), that is Friday. The function =month(A1) yields the result 1,
and =year(A1), the result 1998.
Figure-11: Spread Sheet of Example 4 (Values are shown)
A
1
2
3
4
5
6
7
8
9
10
11
12
Today
22/6/98
(dd/mm/yy):
MCODE DateLPM
PMCycle DateNLPM
(dd/mm/yy) (Days)
(dd/mm/yy)
M0001
M0002
M0003
M0004
M0005
10/1/98
25/2/98
15/1/98
31/12/97
30/11/97
180
360
360
120
180
Warning
9/7/98
20/2/99
10/1/99
30/4/98 *
29/5/98 *
Page 47 of 260
IIMA/CISG0104TEC
Number
Custom
In the list of formats exhibited under the custom formats box, if the desired format is available, it
can be chosen. Otherwise in the box with the caption Type: type in the desired format as below:
dd/mm/yyyy hh:mm:ss AM/PM
According to the above format, you need to type in the data in three parts, each separated from the
previous by a space: date, time, and AM or PM. Date is to be given as day, month, and year with
separating slashes; time is to be given in the twelve hour notation with hour,s, minutes, and
seconds, with separating double colons.
The data input as above is represented internally as the serial number corresponding to the date
and a fraction corresponding to the time.
For example, the start time of the very first observation is input as :
01/01/2005 08:15:00 AM.
This is represented internally (which can be verified by changing the format of the above cell to
General) as:
38353.34375
In the above internal representation, 38353 is the serial number of the date first January of 2005,
and 0.34375 is the fraction of the day at which the time 08:15:00 AM occurs.
If the finish time of a task is subtracted from its start time in the spreadsheet, the corresponding
internal are subtracted, yielding a number which is in days, or a fraction of a day. As we want the
duration of the task shown in minutes, the above result is to be converted to minutes by
multiplying it with 24*60 (which is the number of minutes in a day).
Accordingly, the formula in cell K6 for the duration in minutes for the first observation is:
=24*60*(J6-I6)
The above formula can be copied to the range K7:K55.
To count the number of times a certain value of the duration occurs, enter the given duration
values, ie the values 16,17,,24, in the range M14:M22. In the right neighboring cell of each of
the above cells, enter a corresponding COUNTIF formula; that is, in N14 enter the formula
Page 48 of 260
IIMA/CISG0104TEC
=COUNTIF(K$6:K$55,M14)
and copy it to N15:N24.
In the above problem specification, the frequencies were required for discrete values of the
durations, specifically for durations of 18, 19, 20, 21, 22, 23, and 24 minutes. If istead you were
asked to find the frequencies for duration values falling in given intervals, then instead of
COUNTIF, you need to use the array function FREQUENCY. As an illustration, suppose the
given intervals are:
0 < duration 15
15 < duration 18
18 < duration 20
20 < duration 22
22 < duration 24
Note that the intervals need not be equal in width.
For obtaining the desired frequency distribution using the FREQUENCY function, follow steps
given below:
1.
Set apart two column ranges. It is desirable that the two ranges be adjacent, although not
necessary. The length of the first range, called the bin range, is equal to the number of
intervals being dealt with, that is five in this case. The second range, called the
frequencies range, should have a length equal to one plus the length of bin range.
2.
Fill the bin range with upper bounds of each of the cell intervals. In this example, the cell
values of the bin range would be 15,18,20,22,and 24.
3.
Highlight the frequencies range, and enter the formula =FREQUENCY(data range, bin
range) and end the formula with control+shift+enter. The frequencies range would be
filled with the frequencies of the respective intervals denoted by the bin range. The last
cell of the frequencies range contains the number of values greater than the upper bound
of the last interval denoted by the bin range.
The third spreadsheet shown below contains the bins in the range N6:N10. The frequencies are
obtained in the range O6:O11, using the array function
=FREQUENCY(K6:K55,N6:N10)
In the above function, the first range K6:K55 denotes the range that contains different data points,
and the second range N6:N10 the bins range.
Interpretation of Intervals: How FREQUENCY differs with VLOOKUP and MATCH
VLOOKUP when used with range lookup feature interprets the first vector as denoting intervals;
MATCH function also treats the lookup vector as denoting intervals if the match type is 1 or -1.
However, both VLOOKUP and MATCH differ from FREQUENCY, in the way the intervals are
formed using the given data. In VLOOKUP, in the first column of the lookup table, the lower
bounds of the respective intervals are given; In the lookup vector of the MATCH also, the values
of the cells are interpreted to denote the lower bounds of corresponding intervals, if the MATCH
type is 1. In contrast, in the FREQUENCY function, the values in the bins range of a are
interpreted to denote the upper bounds of the respective intervals , and not the lower bounds.
.
Page 49 of 260
IIMA/CISG0104TEC
I
Start
01/01/2005 08:15:00 AM
01/01/2005 08:25:00 AM
01/01/2005 08:45:00 AM
01/01/2005 09:15:00 AM
01/01/2005 09:30:00 AM
01/01/2005 09:45:00 AM
01/01/2005 10:00:00 AM
01/01/2005 10:15:00 AM
01/01/2005 10:30:00 AM
01/01/2005 10:45:00 AM
01/01/2005 11:00:00 AM
01/01/2005 11:15:00 AM
01/01/2005 11:30:00 AM
01/01/2005 11:45:00 AM
01/01/2005 12:00:00 PM
01/01/2005 12:15:00 PM
01/01/2005 12:30:00 PM
02/01/2005 08:25:00 AM
02/01/2005 08:40:00 AM
02/01/2005 08:55:00 AM
02/01/2005 09:10:00 AM
02/01/2005 09:25:00 AM
02/01/2005 09:40:00 AM
02/01/2005 09:55:00 AM
02/01/2005 10:10:00 AM
02/01/2005 10:25:00 AM
02/01/2005 10:40:00 AM
02/01/2005 10:55:00 AM
02/01/2005 11:10:00 AM
02/01/2005 11:25:00 AM
02/01/2005 11:40:00 AM
03/01/2005 08:12:00 AM
03/01/2005 08:24:00 AM
03/01/2005 08:36:00 AM
03/01/2005 08:48:00 AM
03/01/2005 09:00:00 AM
03/01/2005 09:12:00 AM
03/01/2005 09:24:00 AM
03/01/2005 09:36:00 AM
03/01/2005 09:48:00 AM
03/01/2005 10:00:00 AM
03/01/2005 10:12:00 AM
03/01/2005 10:24:00 AM
03/01/2005 10:36:00 AM
03/01/2005 10:48:00 AM
03/01/2005 11:00:00 AM
03/01/2005 11:12:00 AM
03/01/2005 11:24:00 AM
03/01/2005 11:36:00 AM
03/01/2005 11:48:00 AM
J
Finish
01/01/2005 08:35:00 AM
01/01/2005 08:44:00 AM
01/01/2005 09:05:00 AM
01/01/2005 09:37:00 AM
01/01/2005 09:46:00 AM
01/01/2005 10:05:00 AM
01/01/2005 10:20:00 AM
01/01/2005 10:33:00 AM
01/01/2005 10:49:00 AM
01/01/2005 11:02:00 AM
01/01/2005 11:20:00 AM
01/01/2005 11:37:00 AM
01/01/2005 11:49:00 AM
01/01/2005 12:06:00 PM
01/01/2005 12:20:00 PM
01/01/2005 12:33:00 PM
01/01/2005 12:49:00 PM
02/01/2005 08:44:00 AM
02/01/2005 08:58:00 AM
02/01/2005 09:14:00 AM
02/01/2005 09:29:00 AM
02/01/2005 09:46:00 AM
02/01/2005 10:00:00 AM
02/01/2005 10:16:00 AM
02/01/2005 10:32:00 AM
02/01/2005 10:45:00 AM
02/01/2005 11:01:00 AM
02/01/2005 11:15:00 AM
02/01/2005 11:29:00 AM
02/01/2005 11:43:00 AM
02/01/2005 11:58:00 AM
03/01/2005 08:29:00 AM
03/01/2005 08:43:00 AM
03/01/2005 08:57:00 AM
03/01/2005 09:09:00 AM
03/01/2005 09:20:00 AM
03/01/2005 09:33:00 AM
03/01/2005 09:43:00 AM
03/01/2005 09:54:00 AM
03/01/2005 10:07:00 AM
03/01/2005 10:20:00 AM
03/01/2005 10:33:00 AM
03/01/2005 10:44:00 AM
03/01/2005 10:55:00 AM
03/01/2005 11:10:00 AM
03/01/2005 11:21:00 AM
03/01/2005 11:31:00 AM
03/01/2005 11:45:00 AM
03/01/2005 11:54:00 AM
03/01/2005 12:08:00 PM
K
Durn
20
19
20
22
16
20
20
18
19
17
20
22
19
21
20
18
19
19
18
19
19
21
20
21
22
20
21
20
19
18
18
17
19
21
21
20
21
19
18
19
20
21
20
19
22
21
19
21
18
20
Page 50 of 260
IIMA/CISG0104TEC
13
14
15
16
17
18
19
20
21
22
M
Duration
16
17
18
19
20
21
22
23
24
N
Frequency
1
2
7
13
13
10
4
0
0
II.13
M
Interval
<=15
16--18
19--20
21--22
23--24
>=25
N
Bins
15
18
20
22
24
O
Freq
0
10
26
14
0
0
Suppose you are required to change the display format of the current date in cell E2 of the spread
sheet of Figure-10 to mm/dd/yy. How do you bring about this change? However as mentioned before
this change in display format does not in any way alter the internal representation of the
corresponding date; the internal representation remains to be a number, standing for the serial number
of the date. Hence a change in the display format does not affect the results of computations in which
the contents of E2 are participating. How to change the display format of a cell is important because,
dates are represented in a variety of ways by different users.
In the previous section we have briefly discussed the steps involved in changing the date display
format of a cell or group of cells. The required steps are listed in Figure-12a. Essentially, you are
required to block the cells concerned and choose the menu commands Cells Format Format
Cells. In the resulting dialog box, choose one of the date formats available, or type in a custom format
(which in this case is mm/dd/yy).
The above procedure becomes rather tedious and time-consuming, if it has to be repeated frequently.
Fortunately, it possible to automate this procedure; not only this, but any set of keystrokes. For this
we need to create what is known as a macro, which is a named code, written in Visual Basic; a
macro can be stored in the same work book as the original worksheet, or in a separate workbook.
When invoked a macro performs the keystrokes and the programming tasks, specified in its code.
Thus, to solve the above problem through a macro, you must learn to perform two tasks: 1. To create
the macro, and, 2. To run the macro. Of course, it is assumed that you already know how to manually
perform the basic task, namely changing the date display format.
Page 51 of 260
IIMA/CISG0104TEC
A macro can be explicitly entered by you in the Visual Basic language, provided you are familiar
with Visual Basic. However, for a beginner, and in most cases, even for an advanced user, it is not
advisable to go through this difficult route. Excel system itself can be made to automatically generate
a macro; for this, before the beginning of the key stroke sequence, instruct your spreadsheet to record
a new macro, while you yourself manually perform the task under consideration. At the end of the
key stroke sequence, instruct the system to stop recording the macro. Between the starting and
stopping of the recording, whatever task was performed by you is translated in to the macro code and
stored in the workbook chosen by you. Once the macro recording is over, you can execute the macro
in one of the following 3 ways:
(1)
(2)
(3)
The name to appear in the list of macros when you choose View Macros Macros Record
Macro, and the single letter-key that should be pressed along with the control key are specified just
before starting the recording itself. The command button for the macro can be created any time after
its recording. For this you need to invoke the Forms tool bar, and from it the button icon.
Application of the above procedure to our example is simple. Suppose you choose the name of your
macro as American Format. Suppose you want to store the macro in the same book as the original
spreadsheet. Suppose you want this macro reference to appear as American Date in Tools menu, and
also want to execute it ,some times, using the short cut, control+ A.
Accordingly, execute all the steps of Figure-12b, with the following entries and choices:
Step-2a: Enter the name of the macro as AmericanFormat.
Step 2b: name of the short cut key: Shift+A
Step 2c: choose the option same work book
Step3: perform all the steps listed in Figure-12a.
For executing the macro, click on the cell E2. Then choose the menu option View
Macros Macros Record Macro. In the resulting Macro dialog box, enter the name
AmericanFormat explicitly in the Macroname input box, or click on the above name in the list
exhibited below. Then click on the command button Run. Immediately, the above macro gets
executed, and you will notice that the display in E2 changes from 22/6/98 to 6/22/98. You could also
execute the macro directly, without going through the Tools menu option by pressing the key
combination Control+Shift+A, which will give the same result as above.
For assigning a command button to the above macro, the steps are as below:
Developer
Controls
Insert
Form Controls.
From Controls click on the icon for button. Then move the mouse pointer to the location at which
you want the button to appear. Holding the left button of the mouse pressed, and drag the mouse over
the rectangular area defining the size of the button. Once you release the mouse button, the Assign
Macro dialog box showing the names of all stored macros appears. Choose the name of the macro to
be assigned to the button, and click OK. Place the mouse pointer on the button and click the right
button of the mouse. In the dialog box that appears, click on the button Edit Text. This would allow
you to change the text on the face of the button.
Note that the macro features power extends far beyond mere automation of keystrokes. Macros can
be written to perform many tasks which are beyond the reach of menu based operations. For
example, through a macro you can create your own dialog boxes, your own user-defined functions.
Page 52 of 260
IIMA/CISG0104TEC
Record Macro
Page 53 of 260
IIMA/CISG0104TEC
The above method has been designed several years back. The systems department, during a recent
study, suggested the following modifications to this coding system.
1. The first character of a pipe code should explicitly indicate whether the pipe is imported or
indigenous. The existing practice of using F as the first character for the imported ones should be
continued, whereas for the indigenous ones the character I should form the first field. This
makes the number of fields in each part code uniformly equal to four.
2. The material code which forms the last field of a part code should be more self explanatory: it
should be the first character of the spelling for the concerned material. Accordingly, in the last
(or fourth) field of their part codes, steel pipes are denoted by S, aluminium pipes by A, plastic
pipes by P, and finally the brass ones by B.
3. To be consistent with some engineering specifications, the diameter of a pipe is to be denoted in
millimeters instead of in centimeters.
Consider for example the existing code 8-5-B. This indicates an indigenous pipe. Hence its first
field in the modified code should be I. The diameter of this pipe is 5 centimeters, which when
expressed in millimeters becomes 50. Hence the third field in the modified code should be 50. The
material is aluminium. Hence the fourth field of the modified code should consist of the character A.
Thus the modified code for the above pipe is I-8-50-A.
All the existing part codes are available in a spread sheet. We are required to produce the modified
code for each of the existing codes using the spread sheet facilities.
Figure-13a shows a spread sheet with a sample of 7 codes in column A, in the range A3:A9. The
other columns consist of various formulae to solve our problem. The new codes obtained by these
formulae are shown in column E. Columns B, C and D show the results of the intermediate steps in
converting the old codes to the new codes. The range G3:H6 consists of the table that shows the old
material codes and their corresponding new ones. Let us now explain in detail how the conversion of
the part codes is achieved. The formulae in the cells of each column are such that it is enough for us
to explicitly enter the formulae in row 3; others are obtained by copying these formulae to the cells in
the remaining rows. Hence, in the following discussion we focus on only the formulae in row 3 of
each column.
Let us first introduce some preliminary notions about strings in Excel. These are the notion of a sub
string, the length of a string, the position of a character within a string, and the concatenation of two
or more strings. A part of a given string is called a sub string of the given string. For example,
consider the string INSTITUTE. The strings INS, TI, STIT are some of the sub strings within the
above string. The length of the above string is nine, which means that the string is made of nine
characters. The character S occurs in the third position of the above string. By concatenating one
string to another we get a larger string, with the second string at the tail end of the first string. For
example, if we concatenate the string ABC with the string DEF we get the string ABCDEF. The
ampersand character,&, is used in Excel as the concatenation operator. In the following discussion
we use string functions that can do the following tasks: 1. To extract the sub string of a given length
from the left end of a given string, 2. To extract the sub string of a given length from the right end of
a given string, 3. In a given string, to replace a specified sub string with another string.
The spread sheet of Figure-13a uses the following steps in converting a given part code to its corresponding new one:
For each part code under consideration, find the new material code to be used, and write it in
column B
Page 54 of 260
IIMA/CISG0104TEC
In each part code, replace the old material code with the new code found in the above step. Write
the resulting intermediate code in column C
If a code obtained in column C does not start with F, then put I as the first field of the corresponding code. Write the resulting codes in column D.
For the diameter value which ends at the last but second position, append the character zero, to
convert the diameter value from centi meters to millimeters, and write the resulting code in
column E. This completes the conversion process.
Page 55 of 260
IIMA/CISG0104TEC
string in C3 itself without any modification; else, the output should be the string obtained by the
concatenation of the strings "I-" and the string of C3. Thus the IF can be stated informally as IF
(the given condition, C3, "I-" & A3). Note that in the third argument we specify two strings, the
literal "I-" and the string in A3 with the ampersand character in between. The ampersand
character is the concatenation operator, the result of which is to produce the string obtained by
joining the given strings in the given order, (i.e. the second string is attached at the right end of
the first). The IF function is complete except for the first argument. This condition is to be given
as left most character of C3="F". How do we get the left most character of C3? by the string
function LEFT(C3,1). Just as the RIGHT function is used to extract any sub string of given
length from the right end of a string, LEFT is used to extract a sub string of a given length from
its left end. Now, the full IF function in D3 is
IF(LEFT(C3,1)="F",C3,"I-"&C3).
4. We are now left with only one more modification, that is converting the diameter expressed in
centimeters to millimeters. All we have to do for this is append the character zero to what is
already there in the third field of each code in column D. Let us concentrate as before on the first
code of the sample, the one in cell D3. The character in the third field of this string is 5; therefore
after the appending of the zero character, it becomes 50, thus making the complete new code F10-50-A. One way of accomplishing the above task would be to consider the old code as
consisting of the two components, F-10-5,-A. To obtain the new code, we must simply
replace the second component with 0-A, i.e. with 0 appended to the front of the already
existing second component. This is accomplished by the formula given in cell E3.
Figure-14a: Spreadsheet for part code change
1
3
4
5
6
7
8
9
A
OLDCODE
F-10-5-A
10-10-B
8-15-C
F-10-5-B
F-8-5-C
5-5-D
F-4-4-A
B
S
A
P
A
P
B
S
C
F-10-5-S
10-10-A
8-15-P
F-10-5-A
F-8-5-P
5-5-B
F-4-4-S
D
F-10-5-S
I-10-10-A
I-8-15-P
F-10-5-A
F-8-5-P
I-5-5-B
F-4-4-S
E
NEWCODE
F-10-50-S
I-10-100-A
I-8-150-P
F-10-50-A
F-8-50-P
I-5-50-B
F-4-40-S
G H
A
B
C
D
S
A
P
B
Formula
=VLOOKUP(RIGHT(A3,1),$G$3:$H6,2)
=REPLACE(A3,LEN(A3),1,B3)
=IF(LEFT(C3)="F",C3,"I-"&C3
=REPLACE(D3,LEN(D3)-1,2,"0"&RIGHT(D3,2))
Page 56 of 260
IIMA/CISG0104TEC
Profit (Rs/unit)
3
5
Page 57 of 260
IIMA/CISG0104TEC
plant, the total time required by the given product mix is obtained by multiplying the
corresponding values of quantities range with those in per unit time required range, and taking the
summation of the products. Therefore, we can use once again the SUMPRODUCT function for
computing the time consumed in each plant. These formulae are entered in cells D5, D6 and D7 as
shown. For the sake of comparing the time required with time available, the values of time
available in plant-1, plant-2 and plant-3 are entered in E5, E6, and E7 respectively.
Figure-14a shows that the total profit that would be obtained if the given plan were implemented
would be 26 monetary units (value in cell F4). The capacity required in Plants 1,2,and 3 would be
4,8, and 12 time units respectively ( values in range D5:D7). Comparing these values with the
corresponding values in the range E5:E7, it is clear that the given plan consumes the capacity
available in Plant-1 completely, whereas Plants 2 and 3 would be left with surpluses of 4 time
units and 6 time units respectively.
To find an optimal product mix plan.
How do you find a product mix plan that yields the maximum profit while not requiring more
than the given plant capacities?
A product mix plan such as the one you are asked to find is called an optimal product mix plan.
An obvious way of answering the above question is to substitute various different product mix
plans in the range B8:C8. For each such plan note whether the plan is feasible (that is, whether the
quantities are non-negative, and whether the time required is less than or equal to time available in
each plant), and if so its profit. The plan (or plans) which is feasible and has the maximum profit
is the optimal product mix plan. The problem with this approach is that the number of feasible
plans tends to be too large to permit you to do an exhaustive search. Fortunately, through its
solver feature Excel allows you to find an optimal solution directly.
The solver program should be supplied with input so as to ensure the following: it treats the
values in the range (B8:C8) as adjustable; and adjusts them with non-negative values such that
the resulting total profit (that is the value in Cell F4) is a maximum, and the resulting capacities
required (i.e. the values in range D5:D7) are less than or equal to the corresponding capacities
available (that is, the values in range E5:E7).
Follow the steps given below to get the above tasks performed through Solver:
1.
Invoke the Solver feature by clicking on the menu items Data Analysis and
within it by clicking on Solver; alternatively, you can choose the menu path: Data Data
tools Analysis Solver
2.
In the solver parameters window, enter the following data against the boxes
indicated as below.
Item
Set Target Cell
Equal to:
By changing cells:
Subject to the constraints:
In filling the subject to the constraints box, the following ritual is to be followed:
To add a new constraint, click the Add button.
Page 58 of 260
IIMA/CISG0104TEC
Then a box titled Add Constraint appears. This box has three slots: the first is for entering the
cell reference for the left hand side of the constraint, the second is to choose the type of
constraint ( , , = ), and the third is to give the cell reference (or constant ) for the RHS of
the constraint.
After filling in the add constraint box, press the OK button, to finish with the entry of
constraints, or the Add button to add one more constraint.
1.
After filling in the dialog box as above, click on the button Options. Choose
the following two options by clicking the corresponding radio buttons:
After finishing the solution procedure, the system prompts you to know whether the solution
needs to be saved. Reply in the affirmative to see the answer as shown in Figure-14C. According
to this, the maximum possible profit is 36 monetary units, and an optimal production plan is to
produce 2 units of P1 and 6 units of P2. With this plan, the available capacities in Plants 1 and 2
would be completely consumed and Plant-3 would have 2 units of un-used capacity.
The type of optimization problem described above is called a linear program (LP).
Mathematically, the linear program of the above problem can be formulated as:
Find x1 and x2 to
(1) Maximize 3x1+5x2
Subject to:
(2) 2x1 4
(3) 2x2 12
(4) 2x1 + 2x2 18
(5) x1 0
(6) x2 0
The expression in (1) is called the objective function of the problem and the inequalities in
(2)(6) are called constraints; for each inequality the value to the right of less than or equal to is
called the right hand side (RHS). In a general LP, you can have inequalities of greater than or
equal to () , or equal to (=) types also. When you are solving an LP with more thane one type of
inequality, it is a good practice in Excel to group the different types of constraints together while
entering their coefficients and RHS values. Accordingly, while specifying the constraints in the
solver dialog box, you have to specify not just one set (unlike in the present case) but different
sets depending on the different groups you have.
To find a product mix to attain a given total profit
Suppose you are asked to find a feasible product mix that yields a profit of 33 monetary units. A
solution can be found using the same steps as above, except that while setting the target sell equal
to Max (which means compute the maximum value of the specified target cell), click on the radio
button equal to; in the slot titled value of , enter the goal to be attained, that is the value 33. When
you click the button solve, the system finds the desired product mix as quantity of P1=1, and
quantity of P2 = 6; these values are stored in the range B8:C8 as before. This process is called
Page 59 of 260
IIMA/CISG0104TEC
goal seeking. Remember that goal seeking does not always succeed, and sometimes the process is
prone to numerical inaccuracies.
Figure-14a. Evaluation of a given product mix plan
A
3
4
5
6
7
8
Proft/unit
Plant-1
Plant-2
Plant-3
Quantity
B
C
D
Product-1 Product-2 LHS
3
5
2
0
4
0
2
8
2
2
12
2
4
E
RHS
F
Tot.Profit
26
4
12
18
Formula
=SUMPRODUCT(B4:C4,$B$8:$C$8)
=SUMPRODUCT(B5:C5,$B$8:$C$8)
=SUMPRODUCT(B6:C6,$B$8:$C$8)
=SUMPRODUCT(B7:C7,$B$8:$C$8)
Explanation
Profit = (quantity* profit per unit)
Time taken = (quantity* time per unit)
3
4
5
6
7
8
B
C
D
E
F
Product-1 Product-2 LHS RHS Tot.Proft
Proft/unit
3
5
36
Plant-1
2
0
4
4
Plant-2
0
2
12
12
Plant-3
2
2
16
18
Quantity
2
6
Page 60 of 260
IIMA/CISG0104TEC
S1
S2
Demand
D1
2
D3
D2
1
2
3
D1
1
1
2
D2
2
1
3
D3
4
4
Supply
3
6
Solution-2:
S1
S2
Demand
4
4
Supply
3
6
The per unit transportation cost ( monetary units/ unit transported) between each origindestination pair is different and is given by the following matrix:
Cost matrix:
S1
S2
D1
2.9
2.3
D2
4.2
8
D3
0.8
7.1
As per the above cost matrix, the cost of solution-1 is 2*2.1 + 1*4.2 + 2*8 + 4*7.1 = 54.4
monetary units (mu), and that of Solution-2 is 1* 2.9 + 2*4.2 + 1*2.3 + 1*8 + 4*7.1 = 52.0 mu. It
is quite possible that there are some more feasible solutions. The important question is: among all
the feasible solutions to the above transportation problem, which is a least cost solution?
Page 61 of 260
IIMA/CISG0104TEC
The above problem can be formulated as a linear program, by using the following symbols:
x(i,j) to denote the quantity to be supplied by origin i to destination j,
c(i,j) to denote the per unit cost of transportation from origin i to destination j,
d(j) to denote the demand at destination j,
and s(i) to denote the supply at origin i, i = 1,2 and j = 1,2,3.
Of course, in the problem we are given c(i,j), d(j), and s(i) for all i and j, and we are required find
values for x(i,j) for I = 1,2 and j =1,2,3.
With the above symbols, the linear program can be written as:
Find x(i,j), i =1,2 and j = 1,2,3 to
Minimize
c(1,1)*x(1,1)+c(1,2)*x(1,2)+c(1,3)*x(1,3)+c(2,1)*x(2,1)+c(2,2)*x(2,2)+c(2,3)*x(2,3)
Subject to:
x(1,1)+x(1,2)+x(1,3)
x(2,1)+x(2,2)+x(2,3)
x(1,1)
+x(2,1)
x(1,2)
+x(2,2)
x(1,3)
+x(3,3)
=
=
=
=
=
3
6
2
3
4
We need not worry about specifying the requirement that the variables need to assume only
integral values; the problem structure automatically guarantees that requirement.
Page 62 of 260
IIMA/CISG0104TEC
some are chosen or not chosen through check boxes, and in others the algorithm to be used can be
chosen from a few choices available. These can be accessed by the solver options dialog box.
4. The two main solution procedures are simplex method, meant for linear programs, and
generalized reduced gradient algorithm (GRG2), meant for non-linear programs. Integer programs
are solved by branch and bound, which fixes the values of only a subset of integer variables at
each node, while not imposing the integer restriction on other integer variables, and solves the
relaxed problem as LP. If the objective function and constraints are linear, then the relaxed
problem is a linear program.Appendix-12 explains the various options provided to the user in
dealing with the above algorithms.
5. The user should keep in mind the fact that SOLVER is a part of a spreadsheet and is not a
dedicated optimizing package. Hence, it may not be as rugged as some of the major dedicated
optimization packages like CPLEX. Furthermore, SOLVER itself imposes limits on the
maximum size of the optimization problem that can be fed to it. For a linear program ( for which
the option assume linear model is chosen), the maximum number of variables is 200, while there
is no explicit limit on the number of constraints. For a non-linear program, the maximum number
of decision variables is 200; maximum number of constraints on variables which are not decision
variables is 100; in addition, a lower bound and upper bound can be specified on each decision
variable, and any of the decision variables can be restricted to be an integer.
6. Several third party products are available that can be added on top of EXCELs built-in
SOLVER, to enhance its performance and the size of problems that can be handled.
7. Getting Solver Executed through a Macro
While executing Solver for the first time store your key strokes in a macro, say Macro1
Assign the macro to a command button
o
Developer
Controls
Insert
Click on the icon corresponding to a command button in the form controls group.
Place the mouse pointer at a desired location on the spreadsheet , press the right
button of the mouse, and drag the mouse to expand the command button to the
size you want.
In the assign macro dialog that automatically appears, choose the macro
(Macro1 in this case) from the list of existing macro names and click OK
In the ensuing dialog box, choose assign macro and click Edit.
Page 63 of 260
IIMA/CISG0104TEC
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+Shift+M
'
SolverOk SetCell:="$F$4", MaxMinVal:=1, ValueOf:="0", ByChange:="$B$8:$C$8"
SolverAdd CellRef:="$D$5:$D$7", Relation:=1, FormulaText:="$E$5:$E$7"
SolverOk SetCell:="$F$4", MaxMinVal:=1, ValueOf:="0", ByChange:="$B$8:$C$8"
SolverOptions MaxTime:=100, Iterations:=100, Precision:=0.000001, AssumeLinear :=True,_
StepThru:=False, Estimates:=1, Derivatives:=1, SearchOption:=1, _
IntTolerance:=5, Scaling:=False, Convergence:=0.0001, AssumeNonNeg:=True
SolverOk SetCell:="$F$4", MaxMinVal:=1, ValueOf:="0", ByChange:="$B$8:$C$8"
SolverSolve
End Sub
You will notice that in the above dialog box SolverOK statement appears twice; delete one of the duplicate
lines.
Edit the statement SolverSolve as
Solver Solve True. You will get the following edited VBA code which can be saved and executed by
pressing on the command button created above:
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+Shift+M
'
SolverReset
SolverAdd CellRef:="$D$5:$D$7", Relation:=1, FormulaText:="$E$5:$E$7"
SolverOptions MaxTime:=100, Iterations:=100, Precision:=0.000001, AssumeLinear _
:=True, StepThru:=False, Estimates:=1, Derivatives:=1, SearchOption:=1, _
IntTolerance:=5, Scaling:=False, Convergence:=0.0001, AssumeNonNeg:=True
SolverOk SetCell:="$F$4", MaxMinVal:=1, ValueOf:="0", ByChange:="$B$8:$C$8"
SolverSolve True
End Sub
The meanings of the calls SolverReset, SolverAdd, SolverOK, and SolverSolve, along with a few other
solver functions are described in Appendix-12.
At times, the execution would not be successful, with an error such as the following appearing on the
screen:
Compile error: Sub or Function not defined
might result if a link to the the file solver.xlam is not properly given in VBA.
Check that Solver reference exists in VBA by clicking on Tools References in VBA. A list of references
with check boxes against them appears . If you do not find in the list the item SOLVER with its check box
ticked, then you need to choose solver.xlam from an appropriate library and incorporate it in VBA. In the
authors desktop,for Office-2007 and excel-2007, the path in which the above file is found is:
c:\program files\Microsoft Office 2007\Office12\library.
Page 64 of 260
IIMA/CISG0104TEC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
ObjFn
38.1
ObjInitial
54.4
VarNames
CostCoefs
VarValues
VarInitial
X(1,1)
2.9
0
2
X(1,2)
4.2
0
1
X(1,3)
0.8
3
0
X(2,1)
2.3
2
0
X(2,2)
8
3
2
X(2,3)
7.1
1
4
LHS
RHS
Constraints
S1
S2
D1
D2
D3
1
0
1
0
0
1
0
0
1
0
1
0
0
0
1
0
1
1
0
0
0
1
0
1
0
0
1
0
0
1
3
6
2
3
4
3
6
2
3
4
Formula
Sumproduct(C8:H8,C9:H9)
Sumproduct(C8:H8,C10:H10)
Sumproduct(C13:H13,C$9:H$9)
Explanation
Value of objective function, to be minimized
Value of objective function with initial solution
LHS of S1 constraint; copied to 14:I17
Value
B5
Min
C9:H9
I13:I7 = J13:J17
Assume linear model
Assume non-negative
Page 65 of 260
IIMA/CISG0104TEC
4. There are five constraints in the problem. The coefficients for each are given in corresponding
rows of the range C13:H17, the coefficients of the constraint of S1 in C13:C17, those of S2 in the
next row, and so on. These coefficients are 1s and zeros.
5. For each constraint the LHS is evaluated in a corresponding cell of range I13:I17 and the RHS
values are given in the range J13:J17. For example, the LHS formula of the first constraint is
given in cell I13; this formula is SUMPRODUCT(C13:H13, C$9:H$9).The formula from I13 is
copied to cells I14:I17, to get the formulae for LHS of the other constraints.
6. For the sake of comparison, and for repeated use, the vector of initial solution (this could be
arbitrarily chosen by the user) is stored in the range C10:H10, and the corresponding objective
function value in E5.
With the above layout, it is clear what we need to tell the solver:
The values in rage C9:H9 need to be adjusted to minimize the value in the target cell B5, subject
to the constraint that LHS values in range I3:I7 should be equal to the RHS values in the
corresponding cells of the range J13:J17, that is I3:I17 = J13:J17.
The solver parameters are shown in Figure -15 c.
Figure -15 a shows in C9:H9 the solution found by solver and in B5 the corresponding objective
value. It should be noted that the optimal solution is different from the two solutions, solution-1
and solution-2, mentioned in the beginning.
Spread sheet Layout -2.
In the above layout, the cost coefficients and solution values are given as row vectors; similarly,
each constraint is explicitly represented as one row. Instead, we could store the cost coefficients in
a two dimensional array of cells (or a two dimensional range), one row corresponding to each
origin, and one column for each destination; and the solution values also in another two
dimensional range. The resulting layout would be more elegant than the earlier one. See Figure-15
d for the alternative layout.
The cost coefficient matrix is given the range name CMat, the solution matrix the name XMat.
The supplies available at each origin are given as a column vector with range name Sups, the
demands at each destination as a row vector with range name Demnds. The cell that contains the
formula for computing the value of the objective function is given the name ObjFn. The LHS
values of origin constraints are obtained by summing all outflows from the corresponding
origins, are obtained through formulae in range XSups; similarly, the LHS values of destination
constraints are given in the range XDemnds.
With the above layout and range names, we would like to give the following instruction to solver:
Minimize the value of target cell ObjFn, by adjusting the values of variables in XMat, subject to
the constraints:
XSups = Sups
XDemnds = Demnds
And all variables should be non-negative.
The various formulae, range names and solver parameters are given in Figure-15f and Figure-15g.
The second layout is compact because it eliminates the need for showing the constraint
coefficients explicitly.
Page 66 of 260
IIMA/CISG0104TEC
ObjFn
Cost Matrix
(C7:E8)
S1
S2
Demands
D1
2.9
2.3
2
D2
4.2
8
3
D3
0.8
7.1
4
Supplies
3
6
54.4
X Matrix
(C15:E16)
S1
S2
Demands
D1
2
0
2
D2
1
2
3
D3
0
4
4
Supplies
3
6
ObjFn
Cost Matrix
(C7:E8)
S1
S2
Demands
D1
2.9
2.3
2
D2
4.2
8
3
D3
0.8
7.1
4
Supplies
3
6
38.1
X Matrix
(C15:E16)
S1
S2
Demands
D1
0
2
2
D2
0
3
3
D3
3
1
4
Supplies
3
6
Range name
CMat
XMat
XDemnds
XSups
Sups
Demnds
ObjFn
Expanation
Cost matrix
Solution matrix
Vector of total inflows for destinations
Vector of total outflows for origins
Vector of supplies at origins
Vector of demands at destinations
Value of objective function
Value
ObjFn
Min
XMat
XDemnds >= Demnds
XSups <=Sups
Page 67 of 260
II.17.
IIMA/CISG0104TEC
A machine M in a workshop is used for cutting steel tubes to a specified length. To ensure quality,
the quality control department wants to introduce a periodical inspection scheme. Every week, a
sample of steel tubes is taken and the length of each item of the sample is measured and the
average length of the sample computed. The average is used as an estimate of the mean length of
the population of tubes produced by the machine. Based on experience with the earlier behavior
of the machine, it can be assumed that the population of lengths follows a normal distribution
with standard deviation ( Sigmax) 0.1 cm. The mean has a tendency to shift slightly from time to
time. While in a meeting of the various managers to discuss the above estimation scheme, every
body agreed that it would be impossible to estimate the exact population mean, no matter how
large the sample size. Given a sample size, n, and a given tolerance ( that is, the allowed
maximum absolute difference between the population mean and sample average), the probability,
alpha, of the absolute difference between the actual sample average and the population mean
exceeding the tolerance can be estimated. Conversely, given alpha, and the tolerance, what should
be the sample size such that the probability of the absolute difference between sample average and
population mean is less than or equal to (1-alpha)?
A standard equation available in statistics books for the minimum sample size (n) to satisfy the
above criterion is (see for example pages 152-154 of the book Hadley, G., Introduction to
Business Statistics, Holden-Day, 1966, for a derivation of the formula):
n = ( F -1 ( 1- (alpha/2)) * sigmax/tolerance))2
where F-1 () indicates the inverse cumulative distribution function for standard normal
distribution.
But how do you choose alpha? The lesser the alpha the more the confidence we have in the
sample result, but the greater the sample size. The same is the case with the tolerance. Therefore
the management of the above company requires that the value of n be found for different
combinations of alpha and tolerance.
The following spreadsheet achieves the above task by finding the value of n in cell G4 for
Sigmax = 0.1 cm, alpha = 0.2, tolerance = 0.05 cm. For these values the above formula yields n =
21.64758. As this value is not an integer, the required sample size is obtained by using the
CEILING function to obtain a sample size of 22 in cell G4.
Sample sizes for different combinations of alpha and tolerance are obtained through the data table
feature as below:
In D7:H7 enter the range of alpha values in your combinations; in C7:C12 enter the different
values of tolerance in your combinations. In C7 enter the formula =G4, that is the value to be
tabulated. Highlight the table range C7:H12, and choose the menu options Data What if analysis
Data Table. In the resulting dialog box identify D4 as your row input cell and E4 as your
column input cell.
The results of the above data table can be visualized well by presenting them in the form of a
chart (or graph) as shown in the figure below. Excel presents you with a wide variety of chart
types; the type we want is the scatter, which deals with a series of data values ( each presented as
a column or row); the first series is taken as values on the x-axis and each of the other providing
values on Y-axis, each series corresponding to a separate line on the chart. Before inserting the
chart, highlight the range of the data series, including the series for x-axis values. In the current
example the range to be highlighted is C8:H12.
Page 68 of 260
IIMA/CISG0104TEC
1
2
3
4
5
6
7
8
9
10
11
12
Chart
Scatter
C
D
E
F
G
H
I
J
K
Determination of Sample Size
(Reference: Hadley, G., Introduction to Business Statistics, Holden-Day, 1966, Pages 152-154)
n
Nrounded
Sigmax Alpha Tolerance
0.1
0.02
0.05
21.64758
22
Data Table for n; each column for a value of Alpha, and each row for one value of tolerance
22
0.025
0.02
0.015
0.01
0.005
0.05
21
22
24
27
32
0.04
32
34
37
42
50
0.03
56
61
66
74
88
0.02
126
136
148
166
197
0.01
503
542
592
664
788
S.No.
1
2
Cell Address
F4
G4
Formula
=((C4/E4)*NORMSINV(1-D4/2))^2
=CEILING(E4)
The resulting chart would display a series of curves that you do not want; by default, excel uses
the first row of the highlighted range as values for x-axis, and each of the other rows for one of
the Y-axis series. We want exactly the opposite: the first column to represent the x-axis values
and each of the other columns to represent a Y-axis series. The get excel modify the default
interpretation in the above way, use the menu options, after clicking the chart boarder
Chart tools
Design
Data
switch row/column
Now you would see the chart with five curves; the curves representing the way sample size
changes with tolerance. For each curve the x-axis is the tolerance; each curve corresponds to a
value of alpha, the bottom most to alpha = 0.025, the next to alpha=0.02, the next to 0.015, and so
on , and the finally the top most to alpha = 0.005.
The formatting of each of the above curves, particularly, their thickness, line colour, and the
pattern of dashes, can be changed according to your convenience. To accomplish such changes,
first click the curve in the chart to which you desire to make the changes, and then select the
following menu options:
Chart tools
Format
Format selection
Page 69 of 260
IIMA/CISG0104TEC
Page 70 of 260
IIMA/CISG0104TEC
III. Exercises-I
Page 71 of 260
IIMA/CISG0104TEC
III. Exercises-I
1.
A Copying Problem
1
2
3
4
5
6
7
8
1
5
9
2
6
10
3
7
11
4
8
12
-2
-3
-4
-1
Consider the cells D1:J8 in a spreadsheet as shown above. What is shown on the screen in cells
J6 and G8 is concealed from you. The formula behind cell H7 is: =F2-D3+$d$1. This
formula is copied to cells J6 and G8. With the entries in other cells as shown above, what will be
the formulae behind J8 and G6, and which values are displayed in these cells as a result of
evaluation of these formulae? Assume the format of display is the same for all cells, and is
Numeric General; and that all the columns not shown above have zero values.
Answer:
Formula in J8:
Value in J8:
Formula in G6:
Value in G6:
2.
An NPV Question.
B
10
11
12
13
14
15
0.18
NPV:
YearNo.
Inflow
Outflow
0
1000
1
500
100
2
500
100
3
500
200
Consider the above spread sheet in which the formula behind cell C11 is:
=NPV(B10,D12:F12)+C12. This formula is supposed to find the NPV of a three year
project with cash in-flows and out-flows shown in rows 14 and 15 above. What is visible on the
screen in the cells in row 12, and in cell C11 is concealed from you. What are the
formulae behind cells C12,D12,E12, and F12?
Answer:
Page 72 of 260
IIMA/CISG0104TEC
3. A Four-Year Investment
A four-year project consists of making an investment at time zero, and receiving revenues at times
1,2,3,and 4. A spreadsheet is to be setup to analyse the above cash flows. With respect to the
above context, answer the following two questions, which are independent of each other.
Question-1.
Suppose, as in the following figure, the following are given as inputs (ie the corresponding cells
are filled with numerical values as mentioned):
Revenues at times 1,2,3, and 4 in cells B4,C4,D4 and E4 respectively;
Discount rate in cell B1; and
Value of NPVin cell G4.
1
2
3
4
5
A
DiscRate
Investment at 0
Revenue at 1
1000
Revenue at 2
2000
Revenue at 3
3000
Revenue at 4
4000
0.18
NPV
2000
Write a formula in A4, which should work for any valid inputs, to compute the corresponding
investment, which is to be shown as a positive value:
Formula in A4:___________________________________________________
Question-2.
Suppose, as in the following figure, the following are given as inputs (ie the corresponding cells
are filled with numerical values as mentioned).
Discount rate in cell B1
Investment, a positive value, in cell A4,
Revenues at times 1,2, and 3 in cells B4,C4, and D4 respectively, and
Value of NPV in cell G4.
1
2
3
4
5
A
DiscRate
0.18
Investment at 0
4172.87
Revenue at 1
1000
Revenue at 2
2000
Revenue at 3
3000
Revenue at 4
NPV
2000
Write a formula in E4,which should work for any valid inputs, to compute the revenue at time 4.
Formula in E4: ________________________________________________________
Page 73 of 260
4.
IIMA/CISG0104TEC
A square grid consists of six horizontal lines and six vertical lines, evenly spaced at 10-meter
intervals. The x-coordinates for the six vertical lines , expressed as their distance from the y-axis
in centi-meters, are 0, 1000, 2000, 3000, 4000, and 5000; similarly, the y-coordinates for the
horizontal lines, expressed as their distance in meters from x-axis, are 0, 10, 20, 30, 40,and 50
respectively. Consider, the 36-points formed by the intersection of the above lines . A spreadsheet
is to be designed to compute the distance in meters of each of the above points from the origin.
The x-coordinates of the points are given, as shown in the following figure, in the range B9:B14,
and the y-coordinates in the range C8:H8. Each cell in the range C9:H14 corresponds to a point in
the above grid, with its x-coordinate in the corresponding cell in column-B, and y-coordinate in
the corresponding cell in row-8.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
100
200
40001
10
20
30
40
50
0
1000
2000
3000
4000
5000
The distances from origin of each of the above points are to be obtained in C9:H14 using the
Data Table feature.
Cell C5 consists of the formula = (A5/100)^2 + (B5)^2
Question 1.
What is the formula in cell B8? The formula can have any constants and arithmetical operators,
but cannot use any cell address other than C5.
Formula in B8:____________________________________________________
Question 2.
Give below the row input cell and column input cell that are to be specified in the window that
appears when Data Table menu option is invoked to compute the distances mentioned above.
Row input cell:____________________________________________________
Column input cell:_________________________________________________
Page 74 of 260
5.
IIMA/CISG0104TEC
A Simple Lookup
B
QTY AMOUNT
10
10
10
20
20
20
H
PCODE
P1
P2
P3
D1
10
20
5
D2
8
15
3
The above spreadsheet shows the customer code (CCODE), Customer type (CTYPE), product
purchased (PCODE), quantity purchased (QTY), and the total monetary value (AMOUNT) of
the sale for six sales transactions (The values in AMOUNT field are concealed from you). The
AMOUNT is computed as quantity multiplied by unit price after applying an appropriate
discount; unit price is Rs 10 for all products; however, the percentage discount, D1 or D2,
depends on whether CTYPE is 1 or 2 respectively. The values of D1 and D2 for each of the
products are given in the range H20:J22. The AMOUNT is computed through a formula in cell
F20 for the first transaction; the formula is copied to cells F21:F25. What is the formula in cell
F20?Do not use any cells other than the ones shown above.
Answer:
6.
Marks
10
20
30
15
90
60
70
55
Grade
F
F
D
F
A
C
B
C
Marks
15
Grade
B
G
A
B
C
D
F
1
1
1
2
1
3
The range C30:D38 in the above sheet shows the marks and letter grades obtained by eight
students in a course. Range F31:G35 shows the frequencies of each of these letter grades. These
frequencies were obtained through the menu option Data Table. What is the formula behind the
cell G30? Do not use any cells other than the ones shown above.
Answer:
Page 75 of 260
7.
IIMA/CISG0104TEC
Length of Employment
Cells A2:A101 contain the date of joining and B2:B101 contain the date of completing the
service related to 100 employees of a company. In C2:C101, you should get an asterisk (*)
displayed if the corresponding employee has put in greater than or equal to 1000 days of total
service in the organization; Otherwise display the number of days spent in service. This has to
done by a formula entered in cell C2, which is to be copied to C3:C101. What is the formula to be
entered in cell C2?
Answer: _________________________________________________________
8.
1
2
3
4
5
6
7
8
9
10
11
Disc.Rate
YearNo.
QuantyPrdctn
SalesRevenue
Total Cash Outflow
Net Cash Flow
NPV
5
5.5
7.8
8
The spreadsheet designed for computing NPV of the cash flows in an 8-year project is shown
above. The quantity of production, all of which can be sold, in each year is given in B7:J7, sales
ravenue is obtained through formulae in B8:J8, Total cash out flow is given as input in B9:J9, Net
cash flow obtained by subtracting total cash outflow from sales revenue, in B10:J10, and NPV
obtained through a formula in B11. Discount rate is given in B4.
The unit slaes price varies from year to year and is known to be Rs 5 in year 0, Rs 5.5 in years
1,2,and 3, Rs 7.8 in years 4,5 and Rs 8 in Years 6,7,8. Answer the following questions without
using any cells or referring to any cells other than those given or referred to in the formulae.
A. The formula in B8 is : =B7* VLOOKUP(B6,$N$6:$O$9,2,TRUE). What are the values in
N6,N7,N8,and N9 respectively?
Your Answer:__________________________________________________
B. The formula in B11 is : = NPV(B4,B10:J10) * ( ----- + ------). Fill in the two blanks indicated
by ----- in the above formula. Use only a constant or a cell reference for filling each blank.
Page 76 of 260
9.
IIMA/CISG0104TEC
Retirement Benefits.
2
3
4
5
6
7
8
9
10
11
A
ECode
B
JDate
C
RDate
D
LastBasic
E
PFEmp
F
PF
G
SevcMnths
H
SrvcPay
The above spreadsheet computes some of the retirement benefits for nine of the employees who
retired in the past few months. The employee-code (ECode), the joining date (Jdate), Retirement
date (Rdate), Last basic salary in Rupees per month (LastBasic) are given as input in the
respective rows of the columns A,B,C and D of range A3: D11. The Provident fund amount
contributed by each of the employees is given in the range E3:E11.
1. If an employee has put in a service, including the joining date and the retirement date, of more
than or equal to 5 years (counting an year as equal to 360 days for this purpose), the company
contributes an amount equal to the Provident fund contributed by the employee himself or herself,
and pays him on retirement twice the amount contributed by himself. If the service of the
employee is less than 5 years, the company does not contribute any amount to the employees PF.
This amount, employees PF contribution + companys PF contribution, is computed and shown
in the range F3:F11. What is the formula behind cell F3? This formula is to be copied in to the
other cells of the same column of the range of our interest.
Your answer: ____________________________________________
2. If the employee has put in a service of greater than 60 months (counting a month as equal to 30
days for this purpose, and rounding up if there is any fractional month that results in the above
calculation; for example 35.23 months is to be rounded to 36), he or she becomes eligible for the
amount known as service pay. For an eligible employee, the service pay is equal to number of
months of service, as computed above, multiplied by 1/10 of the last basic (given in column D).
The number of service months is computed as an intermediate value and shown in column G
whereas the service pay in column H. What are the formulae behind the cells G3 & H3 which are
to be copied to the other cells in their respective columns.
Your answer:
2.1
2.2
Page 77 of 260
IIMA/CISG0104TEC
Household
Code
1
2
3
4
5
6
7
8
9
10
No. of
adults
2
2
2
3
3
3
4
4
4
4
No. of
children
4
4
6
6
6
6
2
2
2
2
No. of old
people
3
3
3
2
2
2
2
3
3
3
Total Kcal
per day
10000
15000
20000
20000
20000
8000
25000
9000
12000
14000
F
Total No of
equivalent
adults
G
Kcal/
adult
H
Below poverty
line?
(1 or 0)
25
A
Candidate
Code
1
2
3
4
5
6
7
8
9
10
B
Score in
academics
90
60
60
70
50
90
95
50
60
75
C
Score in
written test
75
90
80
70
40
80
50
70
60
75
D
Score in
interview
95
80
60
40
45
85
55
95
60
75
E
Weighted Score
Total Selected:
F
Selected or not?
(1 or 0)
Page 78 of 260
IIMA/CISG0104TEC
Name of the
Candidate
ABC
XYZ
BBV
ABF
FFK
GGF
MOP
CCR
RCC
BBB
Number of
National
papers
10
15
8
15
30
10
5
30
25
12
Number of
A-grade
international
papers
1
0
2
3
4
1
3
4
1
2
Number of
B-grade
international
papers
5
0
1
10
2
1
15
0
10
3
G
Total
number
of papers
Number of candidates
eligible for promotion:
Number of candidates
eligible for cash reward:
A reader in a university is eligible for promotion to professor only if she/he has published at least
five papers in A grade international journals. Publications in national journals, and publications in
B grade international journals are also counted for this purpose, but only after converting them to
equivalent number of Grade A international publications. In the counting process, twenty national
publications are treated equal to one A-grade international publication; and five B-grade
international publications as equivalent to one A-grade international publication. If the total
number of papers published (counting all categories as equal) by a candidate is more than 20,
she/he becomes eligible for a cash reward.
For the sample data on ten candidates presented in the above spreadsheet, the total number of
candidates eligible for promotion is to be obtained in cell F36, and total number eligible for cash
award in cell F37.
Fill cells F24 and G24 with suitable formulae and copy them down wherever necessary.
Fill also cells F36 and F 37 with suitable formulae.
In case you need, you can use cells H23,H24,I23, and I24 for any other purpose. No other cells
should be used.
Page 79 of 260
IIMA/CISG0104TEC
D
50
51
52
53
54
55
56
57
F
12
14
34
56
43
34
27
28
29
30
31
32
33
34
35
36
37
38
39
A
S.No.
1
2
3
4
5
6
7
8
9
10
B
Marks
50
40
67
83
68
93
45
32
22
85
No. of Passes
Marks
B
Location of
Space-1
T Rama Rao
2
V Venkata Rao
2
Rekha R Jain
6
B H Jajoo
2
Sanjay K Verma
7
K V Ramani
2
Subhash C Bhatnagar
8
1 Name
2
3
4
5
6
7
8
C
Location of
Space-2
7
10
8
4
9
4
10
D
FirstName
E
F
MiddleName LastName
T
V
Rekha
B
Sanjay
K
Subhash
Rama
Venkata
R
H
K
V
C
Rao
Rao
Jain
Jajoo
Verma
Ramani
Bhatnagar
Page 80 of 260
IIMA/CISG0104TEC
41 x + 31 y = 1060
37 x + 27 y = 1142
17 x + 11y = 262
53 x + 61 y = 3057
Product
C
City
Tax(%)
Revenue
Sales
UnitPrice Revenue
after Tax
Quantity
Before Tax
1000
10
10000
10
9000
21 P1
22 P1
2000
10
20000
10
23 P1
1000
10
10000
15
8500
24 P2
2000
20
40000
10
36000
25 P2
1000
20
20000
12
17600
26 P2
2000
20
40000
15
34000
27 P3
1000
5000
10
4500
28 P3
3000
15000
12
13200
29 P3
1000
5000
10
4500
30 P4
4000
15
60000
15
51000
31 P4
5000
15
75000
10
67500
32 P4
2500
15
37500
10
33750
18000
33
34
State
S1
SalesTax
(%)
10
Product
UnitPrice
S1
%Sales
Tax
10
P1
10
S1
10
S2
15
P2
20
S2
15
S3
12
P3
S3
12
P4
15
35 City
State
36 A
37 B
38 C
39 D
Page 81 of 260
IIMA/CISG0104TEC
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
B
C
D
Tuition fee (Rs) of various Institutes for different subjects
Physics
4000
6500
7000
5000
5500
3500
YogiSir
MeritIndia
Scholar
ScoreWell
CentPercent
TopRanker
Nameof Student
AAA
AAA
BBB
BBB
BBB
CCC
CCC
DDD
Institute
YogiSir
YogiSir
MeritIndia
CentPercent
MeritIndia
ScoreWell
TopRanker
Scholar
Chemistry
5000
6500
10000
5500
5500
3500
Subject
Maths
Chemistry
Maths
Physics
Chemistry
Biology
Maths
Biology
Total
Maths
8000
6500
8000
7000
7000
4000
Biology
5000
6500
5000
7500
7000
4000
Fee (Rs)
8000
5000
6500
5500
6500
7500
4000
5000
48000
Page 82 of 260
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
IIMA/CISG0104TEC
C
Weights
Company
Name
ABC
DEF
GHJ
IJK
LMN
PQR
STU
VWX
ZZZ
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
JJJ
KKK
LLL
MMM
NNN
QQQ
RRR
SSS
TTT
UUU
VVV
WWW
XXX
Category
PetroChem
PetroChem
HeavyEngg
Banking
Banking
HeavyEngg
ITC
ITC
ITC
ITC
FMCG
Banking
FMCG
FMCG
Banking
ITC
SHIPPING
Insurance
Entertainmnt
Insurance
Garments
Entertainmnt
Insurance
Garments
Infrastructure
SHIPPING
Insurance
Infrastructure
Entertainmnt
PetroChem
0.4
0.2
0.4
Revenue
2000
1800
1700
1500
1400
1300
1200
1100
1000
950
800
750
725
710
700
695
690
687
685
680
670
665
650
649
648
647
642
640
600
550
Profit
200
180
100
100
110
115
120
110
50
10
60
70
50
30
5
10
12
20
25
25
30
35
50
45
30
25
45
60
10
40
Market
Caitalization
40000
20000
35000
32000
25000
25000
14000
20000
11000
10000
90000
15000
15000
14000
12000
12000
11000
10000
9000
8500
9000
10000
9000
8000
9000
10000
9000
8500
7500
6500
L
33
34
35
36
37
38
39
40
41
42
43
Banking
Entertainmnt
FMCG
Garments
HeavyEngg
Infrastructure
Insurance
ITC
PetroChem
SHIPPING
Composite
Score
16840
8756
14700
13420
10582
10543
6104
8462
4810
4382
36332
6314
6300
5890
5081
5080
4678.4
4278.8
3879
3677
3874
4273
3870
3468.6
3865.2
4263.8
3865.8
3668
3242
2828
Page 83 of 260
IIMA/CISG0104TEC
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
C
Weights
Company
Name
ABC
DEF
GHJ
IJK
LMN
PQR
STU
VWX
ZZZ
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
JJJ
KKK
LLL
MMM
NNN
QQQ
RRR
SSS
TTT
UUU
VVV
WWW
XXX
Category
PetroChem
PetroChem
HeavyEngg
Banking
Banking
HeavyEngg
ITC
ITC
ITC
ITC
FMCG
Banking
FMCG
FMCG
Banking
ITC
SHIPPING
Insurance
Entertainmnt
Insurance
Garments
Entertainmnt
Insurance
Garments
Infrastructure
SHIPPING
Insurance
Infrastructure
Entertainmnt
PetroChem
0.4
0.2
0.4
Revenue
2000
1800
1700
1500
1400
1300
1200
1100
1000
950
800
750
725
710
700
695
690
687
685
680
670
665
650
649
648
647
642
640
600
550
Profit
200
180
100
100
110
115
120
110
50
10
60
70
50
30
5
10
12
20
25
25
30
35
50
45
30
25
45
60
10
40
Market
Caitalization
40000
20000
35000
32000
25000
25000
14000
20000
11000
10000
90000
15000
15000
14000
12000
12000
11000
10000
9000
8500
9000
10000
9000
8000
9000
10000
9000
8500
7500
6500
Composite
Score
16840
8756
14700
13420
10582
10543
6104
8462
4810
4382
36332
6314
6300
5890
5081
5080
4678.4
4278.8
3879
3677
3874
4273
3870
3468.6
3865.2
4263.8
3865.8
3668
3242
2828
Page 84 of 260
IIMA/CISG0104TEC
1
2
3
4
5
6
7
8
9
10
11
12
1
2
3
4
5
6
7
8
1
-1
-1
1
-1
-1
1
-1
-1
2
1
-1
1
-1
1
-1
-1
-1
3
-1
1
1
1
-1
-1
-1
-1
4
1
1
0
1
1
1
1
1
5
-1
1
1
1
-1
-1
-1
-1
6
1
-1
1
-1
1
-1
-1
-1
7
-1
-1
1
-1
-1
1
-1
-1
8
-1
-1
1
-1
-1
-1
1
-1
The range C5:J12 represents the squares of an 8 by 8 chess board, with the clumn numbers of the
squares given in C4:J4, and row numbers in B5:B12. Suppose a queen is to be placed in the
square, whose row number is input in cell B2, and column number in C2. A formula is entered in
cell C5 and copied to all the other cells of C5:J12, such that the output would be: a zero in the
cell to be occupied by the queen, a 1 in each of the cells that can be attacked by the queen from
the given position, and a -1 in all other cells. A queen can move along a straight line any number
of squares, horizontally, vertically, or diagonally.
What is the formula behind cell C5? _______________________________________________
1
2
3
4
5
6
7
8
1
1
-1
-1
-1
1
-1
-1
-1
2
-1
-1
0
-1
-1
-1
-1
-1
3
1
-1
-1
-1
1
-1
-1
-1
4
-1
1
-1
1
-1
-1
-1
-1
5
-1
-1
-1
-1
-1
-1
-1
-1
6
-1
-1
-1
-1
-1
-1
-1
-1
7
-1
-1
-1
-1
-1
-1
-1
-1
8
-1
-1
-1
-1
-1
-1
-1
-1
Page 85 of 260
IIMA/CISG0104TEC
CodedRNo
123
234
345
456
789
Marks1
55
65
80
60
70
Marks2
65
70
60
60
50
BothGT50
TRUE
TRUE
TRUE
TRUE
TRUE
TotGT130
FALSE
TRUE
TRUE
FALSE
FALSE
Pass?
FALSE
TRUE
TRUE
FALSE
FALSE
Rno
125
236
347
458
791
Name
ABC
DEF
HGH
MNP
QRS
Pass?
FALSE
TRUE
TRUE
FALSE
FALSE
Rno
236
791
347
125
458
CodedRNo
234
789
345
123
456
In the spreadsheet above, the marks obtained by students in two papers of an exam are listed,
along with their coded roll numbers in B3:D8. For passing th exam, a student obtain greater than
50 marks in each paper, and greater than 130 in total. Whether a student has obtained greater than
fifty (TRUE or FALSE) in both papers is obtained in E4:E8, and whether the total is greater than
130 (TRUE or FALSE) in F4:F8 through formulae. Similarly, whether each student has passed in
the exam as a whole (TRUE or FALSE) is obtained in G4:G8, through formulae which use the
output of previous two columns. In the range B12:B16 the list of real roll numbers is given, and
against each the result of the exam is obtained in D12:D16, through formulae which use the
output in G4:G8.
Question-1. What is the formula behind cell G4 (This formula is copied to G5:G8)
Answer:_______________________________________________________________
Question-2. What is the formula behind cell D12 (This formula is copied to D13:D16)
Answer: _______________________________________________________________
Page 86 of 260
IIMA/CISG0104TEC
Looks
Power
Price
P1
8
6
4
P2
7
7
8
P3
9
8
4
P4
5
5
5
P5
8
8
8
Wscore
WScore
6.4
6.4
7.3
7.3
7.3
7.3
5
5
8
8
Weights
0.5
0.2
0.3
Each of a given set of five car models is given a rating between 0 and 10 on each of the three
dimensions: looks, Power, and Price. The ratings are entered in B5:F7. Weighted scores are to be
obtained by aggregating the three scores after multiplying them with their respective weights,
which are given in G5:G7.
Question-1. The range B9:F9 is highlighted and an array formula is entered to obtain the
weighted scores. What is that formula? ______________________________________________
Question-2: To obtain the weighted scores in an alternative way, a formula is entered in cell B10,
and then it is copied to the cells in C10:F10. What is the formula behind B10?
____________________________________________________________________________________
C
21
D
11/23/2007
CustNo
C001
C002
C003
C005
C006
LastDelivery
10/23/2007
11/15/2007
11/10/2007
11/8/2007
10/15/2007
CustNo
C001
Canbebooked?
1
alreaybooked?
0
0
0
0
1
In the above spreadsheet, a gas cylinder keeps a list of its customer codes in B5:B9, and against
each code, the date on which the last cylinder was delibered (C5:C9), and whether a cylinder is
already booked and still to be delivered ( 1 for yes and 0 for no) in D5:D9. When a new cylinder
is requested by a customer the customer code is entered in B13. Each customer is entitlrf to have
only one cylinder. The booking can be made only if a cylinder is not already booked and its
delivery is pending, and unless a certain gap ( given in B2) in days has elapsed between the date
of the last delivery and today( given in D2). There is a formula in cell C13, which gives 1 if a
cylinder can be booked for the customer code given in B13, and zero if not.
Question: What is the formula behind cell C13? ______________________________________
Page 87 of 260
IIMA/CISG0104TEC
26. Cricket.
A
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Name
A
B
C
D
E
F
G
H
J
K
L
Runs
Wkts
Catches
10
75
30
55
20
5
60
27
15
20
100
Runs
>=50
0
0
2
0
0
0
3
3
2
0
1
Wkts
>=3
0
3
0
2
0
1
2
1
0
0
3
Catches
No.ofAllrounders
2
The performance of each player in a cricket team is given in B3:B14, in terms of the number of
runs scored (Runs), number of wickets taken (Wkts),and number of catches taken (Catches). An
all rounder is defined to be a player who has scored at least 50 runs and satisfies additionally
satisfies at least one of the following three conditions: 1. the player should have taken at least 3
wickets, 2. the plaer have taken at least two wickets and at least one catch, 3. the player should
have taken at least one wicket and at least three catches. In B23 is computed the number of allrounders according to the above definition, through the formula: =DCOUNT(B3:E14,,C17:E20).
It is given that cell E18 is empty.
What is the entry in C19?_______________________________________________________
What is the entry in D19? _______________________________________________________
What is the entry in E19? _______________________________________________________
What is the entry in C20? _______________________________________________________
What is the entry in D20? _______________________________________________________
What is the entry in E20? _______________________________________________________
27. Guess the Cell Address. .A cell named source is known to be in row-104 of a spreadsheet,
and another cell named destination is known to be in column-CD of the same sheet. The
formula = $F6 +G$5 is entered in source. When this formula is copied from source to
destination, the destination gets the formula = $F3 + I$5.
What is the cell address of source?
____________________________
Page 88 of 260
IIMA/CISG0104TEC
28. Missing first value in cash flow. . In the range A1:D1, four cash flow values are entered.
The formula
=NPV(0.1,B1:D1) yields the result 900, and the formula =NPV(0.1,A1:D1)
yields the result 1000. What is the value in A1? _______________________
(Hint: recall that the NPV function is concerned with finding net present value of a series of cash flows;
For the range specified within the NPV function, excel computes the sum of the first value in the range
divided by (1 + discount rate), second value divided by (1+discount rate)2, third value divided by
(1+discount rate)3, and so on)
29. VLOOKUP Exercise. . A four-row, three-column range named as Vtab has positive
integers in all its cells. Its first column is named as VtabC1. In six cells not belonging to
Vtab, different formulae are entered; the formulae and their results are shown
below:
Formula
Vlookup (10, Vtab, 2, False)
Vlookup (15, Vtab, 3, False)
Vlookup (36.1, Vtab, 2, True)
Vlookup (34.9, Vtab, 3, True)
Vlookup (35.25, Vtab, 3, True)
Match (21, VtabC1, 0)
Value
26
49
100
481
105
3
The values in the 2nd and 3rd columns of Vtab are as shown below. Infer the values of the first
column of Vtab and fill the blank spaces in Vtab:
26
51
48
100
32
49
481
105
Page 89 of 260
IIMA/CISG0104TEC
StFstActvty
01/08/2008 08:00:00 AM
1
2
3
4
5
6
7
PrjCompln
PrjDurn
10/08/2008 03:09:00 PM
9.297916667
9
10
Label
Pred
Durn(Hrs)
Gap(hrs)
Start
Finish
11
C1
E1
10
1.25
02/08/2008 10:24:00 AM
02/08/2008 08:24:00 PM
12
C2
P3
25
09/08/2008 02:09:00 PM
10/08/2008 03:09:00 PM
13
C3
E3
30
4.2
05/08/2008 04:57:00 PM
06/08/2008 10:57:00 PM
14
E1
20
6.4
01/08/2008 08:00:00 AM
02/08/2008 04:00:00 AM
15
E2
C1
18
4.2
02/08/2008 09:39:00 PM
03/08/2008 03:39:00 PM
16
E3
E2
35
10.1
03/08/2008 07:51:00 PM
05/08/2008 06:51:00 AM
17
P1
C3
22
5.25
07/08/2008 03:09:00 AM
08/08/2008 01:09:00 AM
18
P2
P1
10
4.25
08/08/2008 06:24:00 AM
08/08/2008 04:24:00 PM
19
P3
P2
12
5.5
08/08/2008 08:39:00 PM
09/08/2008 08:39:00 AM
Shown in the above spread sheet is a nine-activity project, in which the activities are to be
processed sequentially without interruption, except that each activity has to be followed by a
specified time gap before the next activity can start. The final activity does not have to be
followed by a gap .When two activities are scheduled one after the other, the one that occurs
earlier in the schedule is called the predecessor of the one that occurs latter; conversely, the latter
is called the successor of the former. In the range E11:H19, for each activity, you have the activity
label (Label), the label of its predecessor (Pred), the duration of the activity in hours (Durn), and
the time gap (Gap) in hours that has to be necessarily observed before its successor begins. The
initial activitys predecessor is given as *. The date and time at which the first activity is
scheduled to begin is given in cell F5. The activity data is organized in the spreadsheet according
to alphabetical order of activity labels. Thus, in the sample data given above, the activity sequence
for scheduling would be:
The project is said to be complete when all the activities are complete. The project completion
date and time is obtained in cell J7. What is the formula in J7?
Page 90 of 260
IIMA/CISG0104TEC
Answer: ______________________________________________________________
The total duration of the project in days is found in cellJ8. What is the formula in J8?
Answer: ____________________________________________________________
B
Penalty perday
(%)
D
0.1
8
9
Penalty
per day(
Rs mill)
Actual
Payment
(Rs mill)
Max
Penalty to:
4
5
6
7
E
Name of the
Contractor
Agreed
Completiondate Payment
(mill)
15/02/2010
10
25/03/2010
2
28/03/2010
3
Item
Contractor
Duedate
Indira Pool
Patel Track
Gandhi Garden
AmbhedkarTennis
Court
Sanjay Flyover
Rajiv Football
Ground
A
B
C
01/02/2010
01/03/2010
01/04/2010
01/12/2009
02/02/2010
01/05/2010
01/07/2010
15
01/11/2009
03/03/2010
Page 91 of 260
IIMA/CISG0104TEC
Assume that the total number of seats in the parliament, obtained as the total of the seats won by
each party, is ensured to be an even number.
The field headings are self explanatory.
To form the government, a party, or a coalition formed of at most three parties,
should have a total greater than half of the total number of seats.
1. Write a formula in cell F22 to compute the percentage of seats won by
the first party. Copy the formula to F23:F31 to obtain the percentages for the other parties.
2. In G22:G31, compute for each party the number of seats by which it is short
for forming government; if a party is not short of seats for forming government, the result in the
corresponding cell should be zero.
3. The range D35:D38 is named as CRTRN, and the first cell contains the entry
PARTYCODE. In the other three cells you can enter the party codes of a possible coalition. All
the three cells reserved for party names are filled; if you have less than three parties, the cells
without a party name are filled with NA ( assume NA is not the name of a party)
Write a formula in F36 such that it gives the total number of seats won by all the parties in the
coalition specified in CRTRN.
4. In H36, write a formula that gives "YES" if the coalition given in CRTRN can form the
government
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
C
PartyName
Bribe High
Promote Cast
Eighteenth Century
No Morals
Highly Illiterate
Be Autocratic
Status Quo
All Criminals
Rowdies N Goondas
Remain Poor
D
E
F
G
PartyCod Seats Percentage Shortage
e
BH
200
PC
100
EC
40
NM
25
HI
20
BA
25
SQ
15
AC
5
RG
50
RP
20
Total
PartyCode
BH
EC
HI
500
TotalSeats
CanFormGovt?
Page 92 of 260
IIMA/CISG0104TEC
A student can submit an assignment late; however she/he has to pay penalty at the rate given in
cell E23; if she/he has submitted both assignments late, there is an additional fixed amount
(independent of the lateness)to be paid whose value is given in E24. Thus, for the given values,
suppose a student has submitted each assignment one day late. Then, the total fine to be paid by
her/him is Rs. 10+10+50.
The data on the submission dates of the Assignments for nine students is given in D29:E37.
In F29:F37 you need to compute the penalty due to late submission of A1, if any;in G29:G37,
penalty due to late submission of A2, if any; in H29:H37 the additional penalty due to late
submission of both, if any; and finally in I29:I37 the total penalty for the student.
For each of the above ranges enter a formula in the corresponding top most cell and copy it to the
other cells of the range to obtain the desired results.
In cell G24, enter a formula to obtain the grand total of the fine that all the nine students owe to
the professor.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
C
Date format is dd/mm/yyyy
DueDate for A1
Due Date for A2
Penalty(Rs/day of lateness)
AddnlPenalty (Rs)
StdntCode
S1
S2
S3
S4
S5
S6
S7
S8
S9
Submission
A1
01/06/2009
05/06/2009
04/06/2009
01/06/2009
02/06/2009
01/06/2009
02/06/2009
01/06/2009
01/06/2009
01/06/2009
01/07/2009
10
50
Date
A2
02/07/2009
01/07/2009
03/07/2009
01/07/2009
01/07/2009
01/07/2009
04/07/2009
01/07/2009
03/07/2009
A1
Page 93 of 260
IIMA/CISG0104TEC
2. The reward (or penalty as negative reward) is to be computed as per the reward and penalty
tables given in L5:M8 and L12:M15 respectively.
Enter a formula in I5 and copy it downwards to compute the reward ( or penalty as negative
reward)
Vendor
Est
Time
5
6
7
A
B
C
CompSys
ITPro
CCS
Reward
Delay(+)
(+) or
StDate
CompDate or Saving
Penalty
(-)
(-)
100 01/01/2008 30/04/2008
20
-50
200 01/05/2008 07/11/2008
-10
15
150 01/04/2008 28/08/2008
-1
10
UnSatyam
20
-50
9
10
MindPlant
80
-4
10
4 PrjCode
01/10/2008 16/12/2008
Interval Saving
1 to 7
8 to 14
15 to 24
25
onwards
M
Reward
per day
1
8
15
10
15
20
25
25
Penalty Table
Penalty
Interval Delay
per day
1 to 4
1
20
5 to 9
5
30
10 to 14
10
40
15
15
50
onwards
11
12
13
14
15
Page 94 of 260
IIMA/CISG0104TEC
1.5 - 9.00
1.6 - 9.60
1.7 - 10.20
1.8 - 10.80
1.9 - 11.40
2.0 - 12.00
2.1 - 12.60
2.2 - 13.20
2.3 - 13.80
2.4 - 14.40
2.5 - 15.00
2.6 - 15.60
2.7 - 16.20
2.8 - 16.80
2.9 - 17.40
3.0 - 18.00
3.1 - 18.60
3.2 - 19.20
3.3 - 19.80
3.4 - 20.40
3.5 - 21.00
3.6 - 21.60
3.7 - 22.20
3.8 - 22.80
3.9 - 23.40
4.0 - 24.00
4.1 - 24.60
4.2 - 25.20
4.3 - 25.80
4.4 - 26.40
4.5 - 27.00
4.6 - 27.60
4.7 - 28.20
4.8 - 28.80
4.9 - 29.40
5.0 - 30.00
5.1 - 30.60
5.2 - 31.20
5.3 - 31.80
5.4 - 32.40
5.5 - 33.00
5.6 - 33.60
5.7 - 34.20
5.8 - 34.80
5.9 - 35.40
6.0 - 36.00
6.1 - 36.60
6.2 - 37.20
6.3 - 37.80
6.4 - 38.40
6.5 - 39.00
6.6 - 39.60
6.7 - 40.20
6.8 - 40.80
6.9 - 41.40
7.0 - 42.00
7.1 - 42.60
7.2 - 43.20
7.3 - 43.80
7.4 - 44.40
7.5 - 45.00
7.6 - 45.60
7.7 - 46.20
7.8 - 46.80
7.9 - 47.40
8.0 - 48.00
8.1 - 48.60
8.2 - 49.20
8.3 - 49.80
8.4 - 50.40
8.5 - 51.00
8.6 - 51.60
8.7 - 52.20
8.8 - 52.80
8.9 - 53.40
9.0 - 54.00
9.1 - 54.60
9.2 - 55.20
9.3 - 55.80
9.4 - 56.40
9.5 - 57.00
9.6 - 57.60
9.7 - 58.20
9.8 - 58.80
9.9 - 59.40
10.0 - 60.00
10.1 - 60.60
10.2 - 61.20
10.3 - 61.80
10.4 - 62.40
10.5 - 63.00
10.6 - 63.60
10.7 - 64.20
10.8 - 64.80
10.9 - 65.40
11.0 - 66.00
11.1 - 66.60
11.2 - 67.20
11.3 - 67.80
11.4 - 68.40
11.5 - 69.00
11.6 - 69.60
11.7 - 70.20
11.8 - 70.80
11.9 - 71.40
12.0 - 72.00
Page 95 of 260
IIMA/CISG0104TEC
In I4 give a formula that gives the average price according to the above criterion. If no aprtments
satisfy the criteria, then the result in I4 should be "NA" Test your work by finding the average
price of apartments having 2 bedrooms on third floor;
Another test case is find average price of apartments with 4 bedrooms on the first floor.
lakhs
NBdRms
FloorNo
AvgPrice
40
NA
30
30
200
40
B304
120
24
B103
210
42
C104
170
34
C102
200
40
C202
150
30
C301
175
35
14
D104
220
44
15
D301
130
26
16
D302
140
28
17
D303
110
22
Rs PerSqYd
20000
AptNo
Area(SqYds)
NBdRms
FloorNo
A203
200
A305
150
A104
150
B202
8
9
10
11
12
13
Price
Page 96 of 260
IIMA/CISG0104TEC
Ctgry
ShlfLife
30
1
2
Date format:
Dd/mm/yyyy
PrdCode
PackgDate
ShlfLife
ExpiryDate
A23
01/12/2010
30
31/12/2010
15
E54
13/12/2010
20/12/2010
365
F43
24/01/2011
60
25/03/2011
30
B21
02/02/2011
15
17/02/2011
C05
05/04/2011
365
04/04/2012
60
D45
01/05/2011
30
31/05/2011
10
A12
30/04/2011
30
30/05/2011
11
B43
25/05/2011
15
09/06/2011
12
A06
01/06/2011
30
01/07/2011
13
C07
05/06/2011
365
04/06/2012
38. Vacant Property Project (based on problem 8-14, page 133, of Grant, E.L., Ireson, W.G.,
Principles of Engineering Economy, Fourth Edition, The Ronald Press Company, New York,
1960)
An investment consists of buying a 200 square yard vacant property at a cost of Rs 1 lakh and
selling it at the end of the fifth year for Rs 3 lakh. The tax to be paid at the end of the first year
would be Rs 1000, and this would increase at the rate of 5% every year. The cost of maintaining
the plot, which consists of mainly cleaning it every once in a while, is Rs 5 per square yard per
year. The above proposal is evaluated by computing the internal rate of return (IRR), and NPV at
discount rate 0.15, in the following spreadsheet. All the text entries in different cells are self
explanatory. While the basic data is entered as parameters, the other values are obtained through
formulae. You need to identify the formulae behind the cells mentioned below:
Area(SqYds)
Cleaning(Rs/sqYd)
InitiaTax
%IncreaseinTax
Purchase Cost
1,00,000
Selling price
3,00,000
DiscountRate
YearNo.
Tax
1000
1050
1102.5
1157.625
1215.506
10
Cleaning
1000
1000
1000
1000
1000
11
Tax+Cleaning
2000
2050
2102.5
2157.625
2215.506
12
PurchaseCost
Inflow due to
Selling
-1,00,000
3,00,000
NetCashFlow
-1,00,000
-2,000
-2,050
-2,103
-2,158
2,97,784
13
14
200
5
1000
5
0.15
Page 97 of 260
15
NPV
16
IRR
IIMA/CISG0104TEC
42,146.24
23%
RmNo
Ndays
TotlChrg
RmNo
Type
Type
Chrg/day
25000
2000
3000
5000
DL
8000
6000
8000
GstName
Gupta
Saxena
4000
Shah
3000
Patel
15000
Patil
Iyer
DL
10
11
10
A hotel has kept ten rooms for advance reservation. A room belongs to one of the four types
S,D,L, or DL, each of which has a different per day tariff, and the per day tariffs of the four types
are given in the range I2:J5 of the above spreadsheet. The type to which each of the ten rooms
belongs is given in range F2:G11. The advance bookings received in the last two days are given
A1:D7; as shown, in the above range, column- A consists of the guest name (GstName), columnB consists of the roo number booked (RmNo), and column-C the number of days (Ndays) for
which the room is booked. You are required to compute in the corresponding rows of column-D ,
the total room tariff (TotlChrg) for each of the above bookings.
What is the formula in cell D2, which is copied to D3:D7.
Answer: __________________________________________________________________________
Page 98 of 260
IIMA/CISG0104TEC
Machine
Type
LatestMDate
NextMDate
L1
01/07/2011
M1
D1
5
6
7
8
9
Type
Intvl
29/09/2011
90
15/07/2011
14/08/2011
120
25/07/2011
23/09/2011
30
S2
01/08/2011
29/11/2011
60
L2
05/08/2011
03/11/2011
M2
10/08/2011
09/09/2011
S1
12/08/2011
10/12/2011
L3
15/08/2011
13/11/2011
A workshop has four different types of machines L,S,M, and D, each of which requires to be
opened for preventive maintenance at the end of a pre-specified interval (Intvl). The maintenance
interval in days for each type is given in range G2:H5 of the above spreadsheet.
Currently the workshop has nine machines, three of type L, two of type S, two of type M, and one
of type D. The machine codes are designed such that each code consists of two characters, the left
one indicating the type, and the second one the serial number within the type. The codes of each
machine are shown in A2:A9. The date on which the latest maintenance on each of these
machines was entered in C2:C9 in the format dd/mm/yyyy. The date on which the next
maintenance is due is obtained in D2:D9 through formulae. To obtain the next maintenance date,
the intermediate values found in B2:B9, which are self explanatory, are used.
1. What is the formula in cell B2, which is copied to B3:B9?
Answer: _______________________________________________________________________
2. What is the formula in D2, which is copied to D3:D9?
Answer:________________________________________________________________________
PlotNo
Capacity
Shelter
200
Yes
1000
Yes
500
No
5000
No
10000
Yes
500
No
1000
Yes
10
11
12
Capcity
Shelter
Page 99 of 260
IIMA/CISG0104TEC
The increasing number of fasts undertaken by several citizen groups fighting for lok pal bill has
caused a real estate business man to develop seven plots for political fasting and offer them for
rent. Each plot has a different capacity, in terms of number of agitators that it can accommodate,
and some have a shelter (YES) for the agitators and some dont (NO). This data is provided in the
range A2:A9, of the above spreadsheet, which includes self explanatory field headings.
Shri Kannan Harrare is planning a fast and estimates that there will be at least one thousand
agitators joining him in the event. He wants to hire a plot with shelter for the event. To find how
many plots satisfy his requirement he has developed a formula in cell D11. This formula makes
use of data filtering using the criterion range given in B11:C12.
1. What is the entry in cell B12?
Answer:_________________________________________________________________
2. What is the entry in cell C12?
Answer:_________________________________________________________________
3. What is the formula in cell D11?
Answer:__________________________________________________________________
Sno
SystolicBP
Monthly
Income (in
1000s)
Log income
160
100
150
200
2.301029996
150
150
2.176091259
140
75
1.875061263
145
80
1.903089987
165
55
1.740362689
155
68
1.832508913
135
55
1.740362689
10
142
72
1.857332496
11
10
128
75
1.875061263
G
Regression
Results
9.066845
129.5002
A statistician collected data on systolic blood pressure in mm and the monthly income in Rs
thousands for ten individuals , each of age above fifty, and entered them in the range B2:C11 of
the above spreadsheet. She/he hypothesized that the systolic BP in mm (Y) is strongly influenced
by the monthly income (X). The exact relationship hypothesized was:
Y = C + a log10 X
To estimate the values of C and a, the statistician computed intermediate values in D2:D11, and
in the range F2:G2 entered the array formula Linest, whose results are shown above in their
respective cells.
1. What is the value of C given by linest?
Answer:_______________________________________________________
2. What is the value of a given by linest?
Answer:__________________________________________________________
3. What is the formula in cell D2, which is copied to D3:D11?
Answer?_____________________________________________________________
IIMA/CISG0104TEC
IIMA/CISG0104TEC
IV.
Exercises-II
IIMA/CISG0104TEC
IV.
1.
Exercises-II
Design a spread sheet which helps you maintain your own savings bank balance up to date. Every
time you make a deposit or withdrawal, this spread-sheet has to be invoked, and the corresponding
amount has to be posted in the appropriate column, and the spread sheet immediately updates the
balance. The opening balance is to be given as input. Follow the design given below:
A
Savings Account
Opening Balance:
Date
Deposit(Rs)
Withdrawal(Rs)
Balance(Rs)
4
5
A.
B.
C.
2. Price Discount.
A product is sold to several different customers at a certain unit-price, say Rs 10 per unit. If the
number of units ordered is greater than 100, a certain discount on unit-price, say 10 percent, is offered
for each unit over and above the 100 units. For example, suppose the number of units ordered is 102.
Then 100 of the units are charged at normal unit-price, and the extra two at discount price. Design a
spread sheet that computes the total amount to be charged on each order, given the number of units
ordered in each order. Take the unit-price, the quantity upto which discount is not available, and the
percentage discount as parameters. Follow the design given below:
A
1
Unit price
Percentage discount
Order No.
Quantity
Amount (Rs)
5
6
7
Extension:
A.
Split the quantity into two parts, and show them separately: The quantity not eligible for
discount, the quantity eligible for discount
B.
Similarly, the amount to be paid also is to be split into two:
The amount for quantity charged at normal rate
The amount for quantity charged at discounted rate
IIMA/CISG0104TEC
3. A School Project.
It is proposed to start a primary school with standards 1 through 5, with one section for each standard,
and with 50 students per class. The estimated number of square feet of floor area per student in the
building is 20. The construction cost will be Rs. 200 per square foot. The staff salary per month is
estimated to be Rs 25,000 per month in the beginning and is estimated to increase at the rate of 10%
per year. Other operational costs of the school per year will be Rs. 20,000. What should be the fee in
rupees per month per student so that the investment cost could be recovered in five years.
Vendor A
Rs. 50,000
Vendor B
Rs. 40,000
Node
Cable
5. Promotion policy.
An organization wants to evaluate its promotion policy for its A,B, and C category employees.
Currently, the policy is to promote an A category employee 5 years after he or she joins that grade, a
B category employee after 6 years, and a C category employee after 7 years. Given below is a sample
list of 10 employees and their relevant data. Through spreadsheet, find the date of promotion of each
employee to the next grade.
How many employees would be promoted on or before 1/1/2000?
Emp.
Code
E0001
Grade
A
E0002
1/1/1993
E0003
1/1/1992
E0004
3/3/1998
E0005
4/3/1998
E0006
5/4/1997
E0007
6/5/1997
E0008
1/3/1996
E0009
3/6/1997
E0010
5/8/1996
Extension: The date of birth of each employee is known. The retirement age is 60 years. If the
retirement age occurs before the date for next promotion, put a star in a separate column.
IIMA/CISG0104TEC
Income (Rs)
40,000
35,000
41,000
75,000
1,00,000
Extension: Suppose the tax computation rule is modified as below. There is no standard deduction.
Compute the tax first and then deduct from it Rs.1000 to get the actual tax to be paid.
7. Vegetable Prices.
The following table, published in news papers from the data given by Agricultural Producers
Marketing Cooperative, shows the price in Rs/Kg of some vegetables for the years 1996 and 1998.
Compute the percentage increase of price for each of the vegetables. Arrange the items in decreasing
order of percentage increase in price.
Name of the vegetable
Potatoes
6.5
12
Onions
7.5
16
Pumpkin
10
18
Carrot
20
50
Lady's Finger
11
32
Gourd
18
18
Tomatoes
11
32
Coriander leaves
10
44.5
Green Chillies
11
45
Cauliflower
27
50
Cabbage
14
32
Bitter Gourd
14
27
Brinjal
20
20
Parwal
12
26
Extension:
A. Find average percentage increase
B. Find average percentage increase among those whose 1996 price is greater than 15.
IIMA/CISG0104TEC
Basic Wage
(Rs/hr)
20
30
40
35
25
Hours worked
50
40
30
30
40
No. of pieces
Produces
400
450
310
275
400
Extension: Suppose the workers are grouped into three types, A,B, and C. The Basic wage per hour
depends on the type to which the worker belongs. Therefore, in the input, you are given only the type
to which the worker belongs, and not the basic wage rate directly. Additionally, the basic wage rate
for each type is given in the form of a table. For the sample of workers given above, assume that the
new data is:
Worker
Number
1
2
3
4
5
Worker
Type
A
A
B
C
B
Worker
Type
A
B
C
Basic
(Rs/hr)
30
40
50
Assuming that the other data remains unchanged, develop a spreadsheet to answers the questions
posed.
IIMA/CISG0104TEC
Customer Number
C100
C200
C100
C300
C200
Quantity Sold
500
700
1500
1100
1000
Unit
Price
10
25
5
100
Threshold
Quantity
5000
10000
10000
1000
%
Discount
10
15
2
5
The details of products bought through ten purchase orders are given in the next table:
Purchase
Order No.
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
Product
No.
P2
P3
P1
P4
P2
P2
P4
P3
P2
P3
Quantity
Purchased
500
1500
1000
10000
7500
1500
1000
2000
1700
5000
Compute using a spread sheet the total amount due to be paid on each purchase order.
IIMA/CISG0104TEC
The number of buses currently operating is 900, and the total kms. operating is 855.68 lakhs.
Next year new routes can be operated by using 10 more buses. The number of kms. increases
to 875 lakhs as a result.
2.
In the current year the occupancy ratio is 60%. Next year it is likely to increase to 65%.
3.
The fare can be increased by 10%. As a result the demand may decrease by 2%.
4.
By using better driving practices the tyre cost can be brought down by 10%.
Rs. In lakhs
3506.00
91.6
818.61
35.18
218.74
209.72
955.00
438.90
200.00
100.00
2976.15
621.45
The cost of fuel, lubricants, and tyres are proportional to kms. operated; the M.V. taxes, cost of spares
are proportional to number of buses. Personnel cost can be assumed as cost per person * staff per bus
* no. of buses. Other costs are fixed and increase by 10% each year.
No. of machines
6
7
4
7
The next table shows for each of the products how much processing time one unit of it takes at each
of the machine centres, and its per unit contribution.
IIMA/CISG0104TEC
Product
P1
P2
P3
P4
Contribution
3
10
2
5
Three product mix plans A, B, C and have been proposed for the forthcoming week as shown below:
Product
P1
P2
P3
P4
Questions:
1
Evaluate each plan in terms of the total machine centre hours required, and the total
contribution. Are all plans feasible? Which plan is the best?
2.
In case a plan(s) is infeasible suggest which parameters need to be changed and by how much
to make the plan feasible?
3.
IIMA/CISG0104TEC
After analysing B's quotation, XYZ asked D whether D could also offer a three year contract, for
which D was agreeable and offered the three options as above with the following amounts: If the
payment under option 1 is Rs. 100, then the annual payment under option 2 would be Rs. 93.33 and
under option 3 the one time payment would be Rs. 240.
A list of the different types of equipment, the number of units under each category which were being
considered for the present maintenance contract, and a break-up of these according to the supplier are
given below:
Type
PC
PC/XT
PC-AT/286
PC-AT/386
80 column SMP
132 column slow speed DMP
132 column high speed DMP
Total number
2
23
3
1
13
9
2
Notes:
1. Of the 18 XTs bought from B, four were bought with colour monitor, and the rest with
monochrome.
2. Each of the XTs and ATs had a 20 MB hard disk.
The maintenance charges under option one for one unit of each equipment are shown below.
Equipment
Standard PC (2-floppy drives)
Standard PC-XT
(20MB, HDD, IFDD, CGA, 640KB RAM)
Standard PC-AT (2MB RAM, 20MB
HDD, 1FDD, CGA Monitor)
80 column DMP
132 column DMP (slow)
132 column DMP (fast)
900
1350
1650
1000
1600
2300
It may be noted that the charges quoted by D are the same as those charged by them last year. During
the past one year, D's performance was considered to be quite good by XYZ.
Using the above data find which of the above proposals should be accepted by XYZ.
Feb
150
Mar
200
Apr
100
May
80
Jun
80
Jul
75
Aug
200
Sep
300
Oct
350
Nov
100
Dec
100
Find out the quantities of P1, P2, P3 and P4 that we need to produce (or purchase) to meet the above
demand. The inventory at the beginning of January of different products is as follows:
IIMA/CISG0104TEC
Product
P1
P2
P3
P4
Inventory at beginning
of January
50
400
600
1000
Use the following equation: Inventory at the end of month = Inventory at the beginning + production
in the month - Consump- tion in the month. Assume that all lead times are zero.
Extension:
Suppose the lead times for production for P2 and P1, and the lead times for purchase for P3 and P4
are known. How do you modify your computation? Use the following data: For Product P1, the lead
time is one month, for P2, P3 and P4 two months each.
The project consists of setting up a plant to produce a product. The full capacity of the plant is
2,00,00,000 tonnes per year. However, it is estimated that the full capacity cannot be achieved
in the very first year. The rate of production at the end of the first year is expected to be
1,00,00,000 tonnes per year. Later this rate is expected to increase at the rate of 20,00,000
tonnes per year till the full capacity is achieved.
2.
The capital investment in the project would be Rs.100,00,000 and the entire investment has to
take place right at the beginning of the project. This is required to acquire buildings, plant and
machinery.
3.
The plant, machinery, and buildings are to be depreciated as per the straight line method. The
amount of depreciation per year is equal to 15% of the initial cost of the above assets.
4.
The unit variable cost of production is estimated to be Rs.0.15 and is expected to remain
constant throughout the project. The fixed cost per year is estimated to be Rs. 25,00,000 in the
first year, and is expected to increase by 3% each year.
5.
It is assumed that there is no dearth of demand and that the entire quantity produced can be
sold. The unit price (assumed constant) is assumed to be Rs. 0.45.
6.
7.
The life of the project is assumed to be 7 years; at the end of this period, all the assets can be
disposed off at their book value.
Question: Using Spread Sheet, find whether the above proposal is financially acceptable. Assume
that the discount rate is 18%.
IIMA/CISG0104TEC
16. Problems In Materials Management (The following three problems, 16.1,16.2, and 16.3
were suggested by Prof. T.P. Rama Rao, IIM, Ahmedabad)
16.1. Lead Time Analysis: The performance of a purchase or production department is largely
governed by the lead times experienced by the various items. Lead time is generally defined as the
interval between the perception and the fulfillment of a need. Accordingly, if a purchase requisition
for an item is raised on January 1, 1987, and the item is received at the stores on January 25, 1988,
the total lead time experienced by this item is said to be twenty five days. The total lead time for a
purchased item is made up of several components: 1. the interval between the raising of the purchase
requisition and the dispatch of the corresponding purchase order, 2. the interval between the dispatch
of the purchase order and the receipt of material, and finally 3. the interval between the receipt of the
material and its acceptance by the inspection department. An analysis of these different components
can be of great help in deciding the areas to be improved in the purchasing and the receipt process.
Suppose the data on the Date of Requisition, Date of Receipt, and Date of Acceptance is available in
the form shown below. Design a spread sheet to find the mean and variance of these components and
the total.
RQ DATE
3/1/87
3/1/87
4/1/87
4/1/87
6/1/87
PO DATE
6/1/87
5/1/87
7/1/87
8/1/87
9/1/87
RC DATE
15/1/87
2/2/87
22/1/87
19/1/87
20/1/87
ACC DATE
17/1/87
5/2/87
26/1/87
25/1/87
24/1/87
16.2. Vendor Analysis: Even though selection of a supplier for any given item involves much
judgement, the modern tendency is to make this process as objective as possible. For this, all possible
suppliers are numerically rated on dimensions such as price, delivery, and quality. Then a combined
score for each supplier is arrived at by multiplying the individual scores by suitable weights, which
are subjective, and adding them up. Then the vendors are ranked using their combined score.
Suppose a company rates its vendors on three dimensions: price, delivery, and quality. The following
formulae are used to arrive at the respective scores:
1.
Price score = (Lowest price among all vendors)/(price of the current vendor)
2.
3.
The weights used for price, delivery, and quality in developing the combined score are 50, 25, and 25
respectively. Develop a spread sheet to find the vendor ratings for this company. Use the following
sample data:
Vendor Code
1001
1002
1003
1004
Unit Price
32.00
25.00
30.00
28.00
PO Date
3/1/87
4/1/87
6/1/87
10/1/87
Rec Date
25/1/87
10/1/87
21/1/87
1/2/87
% Defective
4
10
8
10
Assume that the acceptable quality level, that is acceptable percentage defective, is 5 for the item
under consideration.
IIMA/CISG0104TEC
16.3. Consumption Budgeting: For the past year we know for each user the quantity of each item
consumed. Given this data, and the price table containing the unit price of each item, design a spread
sheet that gives us, in the form of a cross table, the value consumed by each user for each item. This
would be of help in setting consumption targets for the next year, if we know the percentage increase
in the price of an item or the percentage increase in the quantity of consumption of a user. Use the
following data:
USER
A100
A100
A100
B100
B100
C100
C100
D100
ITEM
1001
1002
1003
1002
1004
1002
1004
1005
QUANTITY
100
200
150
75
125
110
78
102
Price Table
ITEM
1001
1002
1003
1004
1005
UNIT PRICE
10
15
20
17
18
PONO
6
7
2
1
5
4
9
3
10
8
15
16
17
11
18
12
19
13
20
14
SUPNO
S1
S4
S2
S3
S2
S1
S3
S5
S1
S6
S4
S6
S1
S4
S6
S2
S5
S4
S6
S5
VALUE
1000
500
2000
3000
700
800
200
10000
15000
500
1000
1100
900
1200
700
1300
500
1400
600
1500
LT
3
2
9
5
7
8
15
10
1
4
5
9
6
5
4
6
3
7
8
9
The above table shows the data on several purchase orders. For each order the data items given are:
1. Serial Number (SNO),
2. Purchase Order Number (PONO),
3. Supplier Number (SUPNO),
4. Value of the Order (VALUE), and
5. Lead time (LT).
IIMA/CISG0104TEC
IIMA/CISG0104TEC
onwards. In planning horizon, in a machine centre we process only the quantity just enough to meet
the requirements at the end of the horizon.
Suppose for example that for product P1 the requirement in a planning horizon is 100 pieces. The
WIPs of P1 before M2,M3,M4, and M5 are 30,50,30,and 40 respectively. Then to meet the end-ofthe-horizon requirement we need to process on M5, 1000 pieces; on M4, 960 pieces; on M3, 940
pieces; on M2, 890 pieces; and on M1, 860 pieces.
As a second example, suppose, the requirement of P2 is 2000 pieces. The WIPs of P2 before
M2,M3,M4, and M5 are 100,200,750, and 1300 respectively. Then to meet the given requirement of
P2, we need to process on M2 5000 pieces of P2; on M4, 700 pieces; and on the other machine
centres none.
Given the end-of-horizon requirements and the WIPs before each machine centre for each of the
products, design a spread sheet to compute the number of pieces of each product to be processed on
each centre just to meet the given requirements. Further you are also given for each centre and for
each product, the production rate in number of pieces per hour. Find the number of hours needed for
each product on each centre, and for all products put together the total number of hours of load for
each machine centre.
IIMA/CISG0104TEC
Name of the
macro
ColorRed
ColorGreen
StyleBold
StyleItalic
IIMA/CISG0104TEC
One year
800
Two years
1500
Three years
2200
400
700
600
1300
1000
1900
90
60
150
100
200
140
Analyze the above scheme financially, and for each category of subscriber find which kind of
subscription would be the most desirable. Make suitable assumptions regarding parameters such as
discount rate.
C
BookNo
.
D
UserNo.
BookNo
.
UserNo.
UserNo.
Tot.PendingFine
E
IssueDate
IssueDate
F
DueDate
DueDate
G
ReturnDate
ReturnDate
H
Dela
y
-------
I
Fine
Dela
y
Fine
J
Cleared
K
BookNo
.
L
Price
-----
Cleared
Question 1. Write a formula in cell H6, such that when copied to H7:H15, it computes the Delay
for each of the corresponding transactions, as per the rules given above.
IIMA/CISG0104TEC
Answer: _________________________________________________________________________
Question 2. Write a formula in cell I6 such that when copied to I7:I15, it computes the fine for
each of the transactions as per the rules given above.
Answer: __________________________________________________________________________
_________________________________________________________________________________
Question 3. In the range C24:C28, the User Numbers of each of the five users are entered. In the
corresponding cells of D24: D28, you need to obtain the total pending fine of the corresponding
users, with the help of the data table feature, along with the criterion range given in C18:J19. The
field headings in the criteria range are already given as shown in the figure.
3.a. Give below the values to be filled in, if any in the second row of the criteria range.
Answer:_________________________________________________________________
18
19
C
BookNo.
D
UserNo.
E
IssueDate
F
DueDate
G
ReturnDate
H
Delay
I
Fine
J
Cleared
_______________________
DateBirth
03-Jan-49
19-Jul-51
18-Jun-55
05-May-54
09-Feb-40
10-May-41
02-Feb-44
03-May-40
04-Oct-49
IIMA/CISG0104TEC
From the above data you need to extract the list of movie-multiplex combinations (along
with other relevant information) that satisfy Mr. Jolly Good's requirement. Mr. Jolly Good
may want to experiment with the spreadsheet by changing the desirable starting timewindow (for example, between 5.00 PM and 6.00 PM, between 6.30 PM and 7.30 PM etc).
The output should be written starting from cell P4, and using as many rows below it as
needed, one row for each feasible multiplex-movie combination.
B.
Additionally, for each theatre and movie combination produced above, you need to compute
the ticket charge for four tickets for the silver and gold classes, and write them in adjoining
cells after each row of output produced above. For English movies some theatres offer
concession; the concessional charge is obtained by applying a given percentage of
concession on the normal charge. Hindi movies are charged at the normal rates. The normal
charges for both the classes, and the percentage concession for English movies are given in
the spreadsheet itself.
C.
Compute in one cell the minimum charge among all the feasible options.
Show neatly a layout of the additional cells used by you in answering the above questions, and
explain in detail all the formulae and other contents.
Multiplex
FR
FR
FR
FR
FR
FR
FR
FR
FR
FR
WA
WA
WA
WA
WA
WA
WA
CG
CG
CG
CG
CG
CG
CG
RW
RW
RW
RW
RW
RW
RW
IIMA/CISG0104TEC
C
Movie
Terminator3
ChoriChori
DMH
Hungama
Jaai
Jhankar Beats
MPKDH
Oops
Qayamat
Deewarein
Hungama
ChoriChori
Oops
MPKDH
Qayamat
Terminator3
DMH
Hungama
ChoriChori
Oops
Qayamat
DMH
MPKDH
Terminator3
Hungama
ChoriChori
Oops
Deewarein
DMH
Qayamat
Terminator3
Multplxcode
FR
WA
CG
RW
Mltplxame
FunRepublic
WideAngle
CityGold
Rworld
Moviecode
MPKDH
DMH
Expansion
MainPremKiDiwaniHoon
DarnaManaHai
IIMA/CISG0104TEC
IIMA/CISG0104TEC
The function is given below with a few blank lines. Fill in the blanks.
Function valid(strg As String) As String
'To validate a ten-digit string using check digit method
'Input argument is a ten-digit string
'Output is "OK" or "NotOK"
'Modulo 11 method for check digit
'Multipliers are 1,2,...,9
'Important functions and operators used:
'Mid(s,p,n):
Returns from string s the substring
'
starting from position p and of length n
'Right (s,n):
Returns from string s the substring
'
at the right end of length n
'Val(s):
Converts the string s composed of only digits
'
into its corresponding number
'Len(s)
Length of string s
'Mod Operator:
A Mod B, where A and B are integers, gives the remainder
'
when A is divided by B
IIMA/CISG0104TEC
ccr = wc
nr = n
Dim w(1 To 20) As Integer, c(1 To 20) As Integer
'Read weights of objects from C6:C16 (range "weights")
Range("weights").Select
For j = 1 To n
w(j) = ActiveCell.Offset(j - 1, 0).Value
c(j) = 0
Next j
Do While nr <> 0 ' Still some objects are to be assigned
' Is there a J such that C(j) = 0 and w(j).LE.CCR
jobj = 0
j=1
_________________________________
_________________________________
____________________
____________
__________
_________
End If
Loop
' Write C(j)'s in range "allocation"
Range("allocation").Select
_________________________________
_________________________________
_________________
Range("Noofbins").Value = cc
End Sub
IIMA/CISG0104TEC
IIMA/CISG0104TEC
IIMA/CISG0104TEC
rank of each country and determine the ranks. Is it possible to determine the ranks without
actually sorting the data as mentioned above? Suppose the ranks are generated by treating
one gold medal as equal to 4 silver medals, or 10 bronze medals. Using the same rule, one
silver medal becomes equal to 2.5 bronze medals. What would be the new ranking as per this
rule?
3. In a cell(s) of your choice, show the name of the country or countries with the maximum
number of golds. Similarly, show in separate cells the names of countries with the maximum
nmber of silvers and bronzes.
4. Classify the countries according to the continent to which they belong: Asia, Australia,
Europe, Africa, North America, and South America. Generate the medal tally for each
continent.
5. How many countries have won all three categories of medals?
6. List the names of countries each of which has won at least 5 golds and at least a total of 20
medals. Develop a two way table by varying the above two values (that is at least 6 golds and
at least 21 total number etc)
7. According to a hypothesis, the countries with top position in gold medals, do not rank high in
bronze medals. Does the above data support this hypothesis?
8. Build a feature in the spreadsheet such that the colour of the font for the country names
changes as follows: A. red, if the country has a single digit total, B. blue, if the country has no
gold nor silver and has single digited number of bronze medals, and C. green, if the country
has a rank of less than or equal to ten.
Table: Medals Tally in Atlanta Olympics
(Source: http://en.wikipedia.org.wiki/1996_Summer_Olympics_Medals_Table)
S.No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Country
Algeria[ALG]
Argentina[ARG]
Armenia[ARM]
Australia[AUS]
Austria[AUT]
Azerbaijan[AZE]
Bahamas[BAH]
Belarus[BLR]
Belgium[BEL]
Brazil[BRA]
Bulgaria[BUL]
Burundi[BDI]
Canada[CAN]
Chinese Taipei[TPE]
Costa Rica[CRC]
Croatia[CRO]
Cuba[CUB]
Czech Republic[CZE]
Democratic People's Republic of Korea[PRK]
Denmark[DEN]
Ecuador[ECU]
Ethiopia[ETH]
Finland[FIN]
France[FRA]
Georgia[GEO]
Gold
2
0
1
9
0
0
0
1
2
3
3
1
3
0
1
1
9
4
2
4
1
2
1
15
0
Silver
0
2
1
9
1
1
1
6
2
3
7
0
11
1
0
1
8
3
1
1
0
0
2
7
0
Bronze
1
1
0
23
2
0
0
8
2
9
5
0
8
0
0
0
8
4
2
1
0
1
1
15
2
Total
3
3
2
41
3
1
1
15
6
15
15
1
22
1
1
2
25
11
5
6
1
3
4
37
2
IIMA/CISG0104TEC
Country
Germany[GER]
Great Britain[GBR]
Greece[GRE]
Hong Kong[HKG]
Hungary[HUN]
India[IND]
Indonesia[INA]
Ireland[IRL]
Islamic Republic of Iran[IRI]
Israel[ISR]
Italy[ITA]
Jamaica[JAM]
Japan[JPN]
Kazakhstan[KAZ]
Kenya[KEN]
Korea[KOR]
Latvia[LAT]
Lithuania[LTU]
Malaysia[MAS]
Mexico[MEX]
Mongolia[MGL]
Morocco[MAR]
Mozambique[MOZ]
Namibia[NAM]
Netherlands[NED]
New Zealand[NZL]
Nigeria[NGR]
Norway[NOR]
People's Republic of China[CHN]
Phillippines[PHI]
Poland[POL]
Portugal[POR]
Puerto Rico[PUR]
Republic of Moldova[MDA]
Romania[ROM]
Russian Federation[RUS]
Slovakia[SVK]
Slovenia[SLO]
South Africa[RSA]
Spain[ESP]
Sweden[SWE]
Switzerland[SUI]
Syrian Arab Republic[SYR]
Thailand[THA]
Trinidad and Tobago[TRI]
Tunisia[TUN]
Turkey[TUR]
Uganda[UGA]
Ukraine[UKR]
United States of America[USA]
Unknown
Uzbekistan[UZB]
Yugoslavia[YUG]
Zambia[ZAM]
Gold
20
1
4
1
7
0
1
3
1
0
13
1
3
3
1
7
0
0
0
0
0
0
0
0
4
3
2
2
16
0
7
1
0
0
4
26
1
0
3
5
2
4
1
1
0
0
4
0
9
44
0
0
1
0
Silver
18
8
4
0
4
0
1
0
1
0
10
3
6
4
4
15
1
0
1
0
0
0
0
2
5
2
1
2
22
1
5
0
0
1
7
21
1
2
1
6
4
3
0
0
0
0
1
0
2
32
1
1
1
1
Bronze
27
6
0
0
10
1
2
1
1
1
12
2
5
4
3
5
0
1
1
1
1
2
1
0
10
1
3
3
12
0
5
1
1
1
9
16
1
0
1
6
2
0
0
1
2
1
1
1
12
25
0
1
2
0
Total
65
15
8
1
21
1
4
4
3
1
35
6
14
11
8
27
1
1
2
1
1
2
1
2
19
6
6
7
50
1
17
2
1
2
20
63
3
2
5
17
8
7
1
2
2
1
6
1
23
101
1
2
4
1
IIMA/CISG0104TEC
IIMA/CISG0104TEC
APRIL
38
35
32
38
33
MAY
41
42
40
43
40
JUNE
40
44
39
44
40
38
A
2
43
D
1
44
B
2
X
Y
Z
TRUE FALSE FALSE
D
Science
75
65
90
59
80
Science
>=60
Science
77.5
Formula in A12:____________________________________________________
Formula in B12: ____________________________________________________
IIMA/CISG0104TEC
Year
Production of
Sugar beet
(1,000 tons)
Mean July
Temperature
( Degrees F)
Mean
Rainfall
(inches)
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
470
520
560
510
500
550
630
640
650
620
62
62
63
61
64
61
62
63
61
58
33
42
32
38
31
40
44
36
30
43
1
1
1
2
1
3
1
4
1
6
1
1
1
1
IIMA/CISG0104TEC
1
B
3
2
20
C
2
0.5
15
D
1
1
11
E
0.5
1
18
F
4
5
25
G
5
4
20
H
1
0.8
30
I
0.8
2.5
10
J
0.9
1.5
8
K
2.5
2.8
4
L
1.5
0.85
30
M
2.8
0.15
7
N
0.85
3
10
O
0.15
2
18
Using matrix multiplication, compute the daily in-take of proteins, fat and carbo-hydrates in
grams by Mr.X.
IIMA/CISG0104TEC
The paradox here lies in the fact that the required probability, P(n), turns out to be larger than
what one would normally guess. The answer is
P(n) = 1 {(365 * 364 * (365-(n-1))/365 n } for n>=2.
Using spreadsheet compute the above probability for a given value of n, say for n = 10,
15,20,25,30,35,40,45, 50.
Alternative formulae. If the above formula is directly applied in numerical computation, you
might not only find that the expression is quite inconvenient to apply, but it would have to handle
large numbers like 365n . It might even lead to numerical inaccuracy. You would find it more
convenient to use the following recursion than the direct formula.
Denoting the answer to the above problem with the number of people equal to n as P(n), a
recursive relation for P(n) is:
P(n) = P(n-1) + ((n-1)/365)*(1-P(n-1)) , n >=3
P(2) = 1/365
Use the above formulae to answer the question posed above.
Some approximations are found to yield easily computable, reasonably accurate, formulae for the
above probabilty. One such approach involves using the approximation ex 1 x. Re-writing
the formula for P(n) as
P(n) = 1 {1. (1 1/365).( 1 2/365).( 1 (n-1)/365)},
and substituting 1 1/365 by e 1/365, 1 2/365 by e1 2/365,, and 1 (n-1)/365 by
e (n-1)/365 , we get
P(n) = 1 e (n) (n-1) / (2x365) . In the above formula e is the base of natural logarithms, and its
numerical value can be taken as 2.71828
Re-compute P(n) using the above approximation.
For each of the above schemes:
Show the results in the form of a data table between n and P(n),
Find the smallest value of n for which P(n) is greater than or equal to 0.5.
IIMA/CISG0104TEC
If a job is finished after its due time, it is said to incur tardiness, which is equal to (finish time
due time) in the case of a delayed job. If the job finishes not later than its due time, its tardiness is
zero. There is a penalty for incurring tardiness on a job; this penalty is imposed based on a slab
system: if the tardiness is between 1 and 25 units of time (both 1 and 25 included), there is a flat
penalty of Rs P1; if the tardiness is between 26 and 50 units of time (both 26 and 50 included)
there is a flat penalty of Rs P2; if the tardiness exceeds 50, the penalty is Rs P3. The values
P1,P2, and P3 vary from job to job, and these are given in range S4:AG6. The range S3:AG3
consists of the corresponding job numbers, R4:R6 consists of the lower bounds of the penalty
slabs. For example, the values of P1,P2, and P3 for job 9 are Rs. 3, 6, and 11 respectively. For
example, if job-9 experiences a tardiness of 32, then it would incur a penalty of Rs 6.
Obviously, the tardiness experienced by each job, and the penalty incurred depends on the
sequence in which the jobs are processed. The user decides the sequence and enters it in range
B10:P10. For the sample data shown in the accompanying spreadsheet, the given sequence is job10 first, followed by job-9 next, and so on and the last job is job-11.As per the sequence given in
range B10:P10, and given that the processing of the first job in the sequence has to begin at time
zero, the starting time, finish time, tardiness, and penalty that would be incurred, are computed,
along with some other values needed, in the range B11:P16; and certain other statistics in
C17:C19.
Write down the formulae behind the cells given below:
Cell Address
Formula
Coopied to
B11
C11:P11
C12
D12:P12
B13
C13:P13
B14
C14:P14
B15
C15:P15
B16
C16:P16
C17
(Number of
tardy jobs)
C18
(Average
tardiness)
C19
(Maximum
tardiness)
IIMA/CISG0104TEC
U V
AA AB AC AD AE AF AG
Job Sequencing on a
single facility
Penalty
Table
2
3
JobNo
4
5
TaskTime
10
15
DueTime
20
30
11
12
14
90
50
10
11
12
13
14
15
10
12
60
70
80 120
85
75
65
51
10
6
7
8
9
Position No
10
JobNo
11
10
11
12
13
14
15
10
14
13
12
12
11
TaskTime
14
12
10
15
12
12
11
10
12
Start Time
20
32
42
57
62
69
75
80
13
Finish Time
14
Duetime
15
20
32
42
57
62
69
75
80
70
60
50
90
20
30
40 120
75
Tardiness
22
27
22
23
53
16
Penalty
14
17
18
AvgTardiness
10
19
MaxTardiness
53
80
2 3
10
11
12
13
14
15
2 4
26
12
15
10
11
14
11
13
14
17
11
11
10
1
0
1
10
8
4
IIMA/CISG0104TEC
134
IIMA/CISG0104TEC
Your answers
Cell address
Formula or heading
Explanation
G3
G4
H3
H4
I3
I4
Any other
Cell (give its address)
Flight
Schedules
From and To
Ahmedabad
2
3
4
5
6
7
8
9
10
CITY
Mumbai
Mumbai
Mumbai
Mumbai
Mumbai
FltNo
IC613
IC614
IC603
IC609
IC610
Time
A0630
D0710
A1800
D1850
A2015
Days
1111111
1111111
1111111
1111111
1111111
FROM
DELHI
TO
AHMEDABAD
CITY
FltNo
DATE
27/07/04
Time
Days
135
Mumbai
Mumbai
Mumbai
Mumbai
Mumbai
Mumbai
Mumbai
Mumbai
Mumbai
Mumbai
Mumbai
Delhi
Delhi
Delhi
Delhi
Delhi
Delhi
Delhi
Delhi
Delhi
Kolkatta
Kolkatta
kolkatta
Kolkatta
Goa
Goa
Jaipur
Jaipur
Bangalore
Bangalore
Chennai
Chennai
Hyderabad
Hyderabad
Hyderabad
Hyderabad
Kuwait
Kuwait
Muscat
Muscat
Sharjah
Sharjah
IIMA/CISG0104TEC
IC604
9W321
9W322
9W324
9W325
9W326
9W480
9W473
9W701
9W705
S26228
IC817
IC818
IC861
IC862
IC885
IC886
S26130
9W702
9W706
IC7267
IC7267
IC7269
IC7269
9W480
9W473
IC7269
CE7267
IC610
IC609
9W325
9W322
IC563
IC564
IC981
IC982
IC982
IC981
IC886
IC885
IC564
IC563
D2055
A0640
D0720
D2030
A1755
D1835
A1050
D1230
A0735
A1910
D0900
A0725
D0810
A1935
D2015
A1825
D0130
D2055
D0815
D1945
A1825
D1855
A1950
D2020
A1050
D12309
A1950
D1855
A2015
D1850
A1755
D0720
A2010
D0500
A1850
D0750
A0705
D1955
A0035
D1905
A0400
D2105
1111111
1111111
1111111
1111111
0111111
1101111
0111111
0111111
1111111
1111111
1111111
1111111
1111111
1111111
1111111
0010101
1001010
1111111
1111111
1111111
0010100
0010100
0100010
0100010
0111111
0111111
0100010
0010100
1111111
1111111
1111111
1111111
0101010
0010101
1000100
0100010
0100010
1000100
1001010
0010101
0010101
0101010
Delhi
Delhi
IC817
IC861
A0725
A1935
1111111
1111111
(Source for the above table: schedule publicly available on the web)
40. Gender Based Income Tax
In a certain country, where the monetary unit is Rupee, a citizen is to pay income tax as per the following
rule:
Subtract standard deduction (SD) from gross income to obtain the net income. If SD is greater than gross
income the net income is taken as zero. The amount of income tax is obtained by multiplying the net
income with the tax rate.
136
IIMA/CISG0104TEC
Both the standard deduction and the tax rate are dependent on the sex of the tax payer. The standard
deduction also depends on the status of the tax payer, all tax payers being divided into the following four
status categories: R, NR, N, and D. The following table gives the standard deduction in Rupees thousands
for each of the four status categories.
Status
R
NR
N
D
Normal
(N)
100
0
0
50
Male (M)
Minority
Senior
(M)
Citizen(S)
150
200
0
0
0
0
70
150
Normal
(N)
120
50
50
60
Female (F)
Minority
Senior
(M)
Citizen (S)
170
200
70
100
70
100
80
120
The percentage tax rate depends not only on the sex of the tax payer but also on the slab to which the net
income belongs, as per the following table:
Net Income
Slab
50,000
>50,000&1,00,000
>1,00,000&5,00,000
> 5,00,000
Normal
(N)
0
5
25
30
Male (M)
Minority
Senior
(M)
Citizen (S)
0
0
0
0
10
5
20
8
Normal
(N)
0
0
10
20
Female (F)
Minority
Senior
(M)
Citizen (S)
0
0
0
0
5
2
10
5
The status, sex and the gross income of a sample of 10 tax payers is given in the following table:
IdCode Status Sex Gross(Rs)
C001
R
MN
100000
C002
R
MS
200000
C003
NR M M
60000
C004
D
FS
75000
C005
D
FN
600000
C006
R
MN
900500
C007
R
F M 1100000
C008
NR
MM
545000
C009
D
MN
456000
C010
D
FN
347000
Using spread sheet, compute the tax in rupees for each of the above 10 tax payers.
Develop suitable coding for different categories of tax payers. Find also for the above sample, who has to
pay the maximum tax, and his or her IdCode.
137
IIMA/CISG0104TEC
1 Regular
75
130
95
140
35
2 Medium
150
230
200
240
45
3 Large
260
310
310
340
65
Each of the above types is available in its feast version for Rs. 30 extra.
A number of other options such as toppings are usually offered, but can be ignored for the task at hand. To
further simplify the analysis, the proprietor assumes that the low budget customers want the proprietor to
suggest them only alternatives each of which consists of one unit of a Pizza; and that the budget of a
customer never exceeds the price of the costliest combination. In case the budget permits several
alternatives, the proprietor wants to rank the alternatives in descending order of price, and indicate to the
customer only those with rank not greater than 3.
For example, when a customers budget is Rs.110, then the following four combinations are feasible:
Alternative
number
1
2
3
4
Combination
Veg-I, Regular, feast, no extra cheese
Veg-I, Regular, non-feast, extra cheese
Veg-I, Regular, non-feast, no extra cheese
NV-I, Regular, non-feast, no extra cheese
Price(Rs)
105
110
75
95
The proprietor, however, suggests to the customer only three alternatives, that is alternative-1, alternative-2,
and alternative-4.
Given below is a design of a spread sheet which has as input the codes of all the 48 combinations possible
(four based on type, three based on size, two based on extra cheese wanted or not, two based on feastversion wanted or not). For each combination the total price of one unit is calculated and listed. When a
customer calls, the proprietor enters in a cell the maximum amount that the customer is willing to pay, and
138
IIMA/CISG0104TEC
when he performs certain operations, the system outputs in a range, the feasible combinations that he could
suggest to the customer, as per the rules described above.
In the spread sheet (see next page) the following are the values in their respective ranges:
Range
Contents
The codes of the 48 combinations. This is given as input. Each code consists of
four characters. Left most character (First Character) indicates the type (1, 2, 3 or
D41:D88 4) : second character indicates the size (1, 2, 3) ; third character indicates whether
the version is feast or normal (1 or 0) the last character indicates whether extra
cheese needed (1) or not (0)
E41:E88 P1: First component of the price of each combination, due to type and size.
P2: The second component of the price of each combination, due to price of extra
F41:F88
cheese if applicable.
P3: The third component of the price of each combination, due to extra price of
G41:G88
feast version, if applicable.
P: Total price of one unit of the corresponding combination, if feasible; otherwise H41:H88
999999.
I41:I88 Is the combination feasible (True or False) for the given budget in cell I38
J41:J88 Rank of the corresponding cells in column H, in the descending order of P.
In addition to the ranges described above, the following entries are input in the range H27:K32
HHI
I
JJ
KK
1
2
3
27
1
75 150 260
28
2
130 230 310
29
3
95 200 310
30
4
140 240 340
31
5
35
45
65
32
Into cell I39 is entered the extra cost of a feast version, which is 30 currently.
139
IIMA/CISG0104TEC
D
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Combination code
1111
1110
1101
1100
1211
1210
1201
1200
1311
1310
1301
1300
2111
2110
2101
2100
2211
2210
2201
2200
2311
2310
2301
2300
3111
3110
3101
3100
3211
3210
3201
3200
3311
3310
3301
3300
4111
4110
4101
4100
4211
4210
4201
4200
4311
4310
4301
4300
P1
P2
P3
Budget:
Feast:
P
30
Feasible?
Rank
140
IIMA/CISG0104TEC
Answer the following questions related to the above spread sheet (you are not allowed to use cells or
ranges other than those mentioned)
Questions:
41.1 In each of the following ranges, a formula is given in the first cell, and it is copied to the other cells of
the range. Write the formula in the first cell.
Range
E41:E88
F41:F88
G41:G88
H41:H88
I41:I88
J41:J88
41.2. The desired output (the code of each combination which is within the budget, and satisfies the other
rules described above) is to be written in the range the first cell of which is L40, which consists of the string
FEASIBLE COMBINATIONS. Design a criteria range with a maximum of two columns and two rows,
including the headings row, in the cells L37:M38, such that when used along with an appropriate data list in
advanced data filter, it will produce the output in the range mentioned above.
a. Draw a grid of cells below indicating your criteria range and fill them with their headings, and formulae
or other contents. On the top of the grid write the column labels and on the left, write the respective row
numbers.
Your answer:
141
IIMA/CISG0104TEC
b. What is the address of your data list range for the above filter?
Your answer:
142
IIMA/CISG0104TEC
143
IIMA/CISG0104TEC
IIMA/CISG0104TEC
especially if the graph is quite large, several sub-optimal procedures can be devised. One such procedure,
called a greedy heuristic is described below:
Step-1. Start with colour-1 as your current colour. None of the nodes is assigned any colour.
Step-2. (Node scan.) Consider the nodes in their index order, that is in the order node-1, node-2,, node-n.
When a node is considered, assign the current colour to it if it has not yet been assigned a colour,
and if none of its adjacent nodes is assigned the current colour.
Step-3. If at the end of step-2, there are still some nodes without being assigned a colour, increase the index
of the current colour by one, and go to step-2 (ie go through a node scan). Else, Stop.
Illustration:
On the next page is shown a ten node graph, on each of which are shown the node index and the colour
assigned to it by the above greedy heuristic. You can see that nodes 1,3,5,7 and 8 are assigned colour-1,
nodes 2,4,6, and 9 are assigned colour-2, and node-10 is assigned colour-3. You can easily verify that no
two adjacent nodes are assigned the same colour. For example, nodes 2 and 7 are adjacent and their colours
are 2 and 1 respectively; similarly, nodes 9 and 10 are adjacent and their colours are 2 and 3 respectively.
The adjacency matrix for the graph is also shown below the graph for clarification.
Question.
Suppose an n-node graph is represented by its adjacency matrix and the adjacency matrix is entered in the
cells of a range of an excel sheet. The range has n rows and n columns and is named grph. Initially, the
entries in this range correspond to the entries in the adjacent matrix. A sub called graphcolour, written in
VBA, when invoked through a command button, applies the greedy heuristic to the graph represented by
grph and fills in the diagonal cells of the above range with the colours assigned by the heuristic to the
corresponding nodes; that is, the entry in the jth row and jth column of the range, as a result of the execution
of the above sub, would be the index of the colour assigned to node-j. In the listing of the sub given at the
end of this question, fill in the blanks. Do not use any ranges, cells, or variables of your own other than those
already mentioned in the listing.
145
IIMA/CISG0104TEC
Node-2
Colour-2
Node-3
Colour-1
Node-1
Colour-1
Node-7
Colour-1
Node-6
Colour-2
Node-4
Colour-2
Node-9
Colour-2
Node-10
Colour-3
Node-8
Colour-1
Node-5
Colour-1
A 10-node graph with node-index and colour-index shown for each node
Node
No.
1
2
3
4
5
6
7
8
9
10
1
1
10
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
146
IIMA/CISG0104TEC
Sub graphcolour()
'The range named "grph" has equal number of
'rows and columns and contains initially 1's and zeroes
'corresponding to the entries in the corresponding cells of the
'adjacency matrix of the graph to be coloured
' n is the number of nodes
'(i,j)cell of grph is 1 if j is adjacent to i, i = 1,2,.,n; j = 1,2,,n
'(j,j)cell of grph is zero initially, j=1,2,..., n
'(j,j)cell contains the index of the colour assigned to node-j, j=1,2,,n
IIMA/CISG0104TEC
3
1
Degree=5
3
2
Degree=3
3
Degree=3
Nodeindex
1
2
3
4
0
2
0
1
2
0
2
1
0
2
0
1
1
1
1
0
Matrix showing number of arcs between each pair of nodes for the multi-graph of the above figure.
148
IIMA/CISG0104TEC
For computations, an n-node multi-graph is represented by an nxn matrix A called its adjacency matrix,
whose elements A(i, j) denote the number of arcs directly connecting i and j, for i = 1 to n and j = 1 to n; A(
i,j) = A(j,i).
Suppose the adjacency matrix of a multi-graph G with n-nodes is given in range named EULER in an Excel
spreadsheet. The listing of a VBA function named IsEuler with some blanks is given below. This function
returns the value TRUE or FALSE depending on whether the graph represented by the adjacency matrix in
EULER is an Euler Graph. Fill in the blanks without using any extra variables or ranges already referred to
in the listing.
Function IsEuler(E As Range) As Boolean
' E is a range consisting of number of arcs
' between various nodes of a multi-graph
' Range("E").Cells(i,j).value denotes the number of arcs between nodes
' i and j in the graph represented by E
' The function returns TRUE if the graph is an Euler graph; otherwise False
Dim n As Integer, i As Integer, j As Integer
Dim Sum As Integer
n = __________________________
' Compute the degree of each node
' If the degree is odd then the graph is not an Euler Graph
____________________ = True
For j = 1 To n
Sum = ______________
For i = _____________ To n
Sum = ______________________________________
Next i
' Is Sum Odd?
If ______________________________Then
___________________ = False
Exit For
End If
Next j
End Function
149
IIMA/CISG0104TEC
150
IIMA/CISG0104TEC
Variables
Objective Type:
Constraints
Variables
Max
(LE)
(GE)
= (EQ)
0 (GE)
0 (LE)
Unrestricted in sign (UR)
Min
(LE)
(GE)
= (EQ)
0 (GE)
0 (LE)
Unrestricted in sign (UR)
Dual
Objective type:
Variables
Constraints
Objective Type:
Variables
Constraints
Min
0 (GE)
0 (LE)
Unrestricted in sign (UR)
(GE)
(LE)
=
(EQ)
Max
(LE)
(GE)
Unrestricted in sign (UR)
(LE)
(GE)
=
(EQ)
151
IIMA/CISG0104TEC
Suppose a spreadsheet consists of the input defining the primal problem in a few ranges as given below:
S.No.
1
2
3
Range Name
NCONSTR
NVAR
PRIMAL
Description
Number of constraints (m)
Number of variables (n)
Starting cell for the primal matrix.
If you count the (row,column) of this cell as (1,1) then:
Rows 1,2,3,m starting with the above cell contain coefficients of respective constraints
Row m+1 contains the coefficients of objective function
Row m+2 the type of each variable
Columns 1,2,, n correspond to the respective primal variables
Column (n+1) corresponds to the right hand side values (b)
Column (n+2) contains the type of each constraint.
You need to write a SUB in VBA that formulates the dual of the above primal and writes it in the same way
as the input for the Primal. The output is to be written beginning with the cell named as DUAL.
In formulating the dual, you can use the conversion rules coded in the form of the following four ranges:
RangeName
Contents
Explanation
MaxCtoV
GE
LE
EQ
LE
GE
UR
MaxVtoC
GE
LE
UR
GE
LE
EQ
MinCtoV
GE
LE
EQ
GE
LE
UR
MinVtoC
GE
LE
UR
LE
GE
EQ
152
IIMA/CISG0104TEC
To clarify the above problem description, we have shown below a part of a spreadsheet that consists of
1.
2.
the dual (Range B14:F19) of the above primal, given as output by a SUB that is written to perform the
task described above.
A
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-2
2
0
-2
LE
1
0
2
3
GE
3
1
1
5
GE
1
0
1
0
UR
5
4
6
GE
LE
EQ
Max
-2
1
3
1
5
LE
2
0
1
0
4
GE
0
2
1
1
6
UR
-2
3
5
0
LE
GE
GE
EQ
Min
Important range names (not all of which are shown) in the above sheet:
RangeName
Primal
Dual
Nconstr
Nvar
MaxCtoV
MaxVtoC
MinCtoV
MinVtoC
Range address
B6:B6
B14:B14
B3:B3
C3:C3
J6:K8
M6:N8
P6:Q8
S6:T8
153
IIMA/CISG0104TEC
Number of
immediate
predecessors
0
1
1
1
1
2
Number of
immediate
successors
2
1
1
1
1
0
List of immediate
predessors
1
1
2
3
4,5
Table: Information on immediate successors and predecessors of each task, derived from the above figure.
In a computer program dealing with assembly line planning, the precedence information is represented in
the form of an (n by n) zero-one matrix where n is the number of tasks. If the element in row-I and columnJ of this matrix is 1, then it implies that task-J is an immediate predecessor of task-I; and if the element is
zero, it implies that task-J is not an immediate predecessor of task-I. Such a matrix is called a precedence
matrix. The precedence matrix corresponding to the precedence diagram of the figure mentioned above is
given below:
0
1
1
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
154
IIMA/CISG0104TEC
Suppose the precedence matrix of an assembly job is given on a spreadsheet in a range starting from the cell
named as PREDMAT.The number of tasks is given in the cell named NTASKS. Assuming that the number
of tasks does not exceed 50, develop the following VBA functions are developed:
Function
Ispred(I,J)
Npred(I)
Nsuc(I)
Predlist(I)
Explanation
The function returns TRUE or FALSE depending on whether task-J is
an immediate predecessor of task-I
Number of immediate predecessors for task-I
Number of immediate successors for task-I
An array function, that returns the list of immediate predecessors of I
EmpCode
E001
E001
E001
E001
E001
E001
E001
E001
E001
E001
E002
E002
E002
E002
E002
E002
E003
E003
E003
E003
E003
E003
E004
E004
E004
E004
E005
E005
E005
E005
DateTime(dd/mm/yyyy
hh:mm:ss AM/PM)
01/01/2005 09:30:00 AM
01/01/2005 01:30:00 PM
01/01/2005 02:30:00 PM
01/01/2005 06:30:00 PM
02/01/2005 08:30:00 AM
02/01/2005 01:15:00 PM
02/01/2005 01:45:00 PM
02/01/2005 03:20:00 PM
02/01/2005 03:30:00 PM
02/01/2005 07:00:00 PM
01/01/2005 07:30:00 AM
01/01/2005 04:45:00 PM
02/01/2005 08:00:00 AM
02/01/2005 12:45:00 PM
02/01/2005 01:35:00 PM
02/01/2005 05:38:00 PM
01/01/2005 07:50:00 AM
01/01/2005 01:10:00 PM
01/01/2005 01:55:00 PM
01/01/2005 05:45:00 PM
02/01/2005 07:30:00 AM
02/01/2005 05:00:00 PM
01/01/2005 10:05:00 AM
01/01/2005 04:30:00 PM
02/01/2005 09:00:00 AM
02/01/2005 05:00:00 PM
01/01/2005 08:00:00 AM
01/01/2005 05:00:00 PM
02/01/2005 09:00:00 AM
02/01/2005 03:30:00 PM
Enter (E) or
Leave (L)
E
L
E
L
E
L
E
L
E
L
E
L
E
L
E
L
E
L
E
L
E
L
E
L
E
L
E
L
E
L
155
IIMA/CISG0104TEC
IIMA/CISG0104TEC
For administrative expenses like telephone, courier and clerical work, a sum of Rs 40,000 is to be set apart.
Questions:
If the entire expenditure of the conference is to be met by the registration fee alone, then what should be
the registration fee per participant?
If a maximum amount of Rs two lakh could be raised through sponsorships, what should be the
registration fee per participant?
To answer the above questions, experiment with various possible values of parameters like number of
delegates and sponsorship amount.
Can you conclude from your experiments that, in general, the more the participants, the less the
registration fee per participant, for break-even?
Enter the list into a spreadsheet. Reorganize the list by sorting it on each of the dimensions mentioned
above; additionally, sort it by country and category.
B.
Develop a table showing for each country and category combination, the number of companies in the
list that come under the combination.
C.
Using a suitable set of features to list all companies whose sales were more than $80 billion and market
value greater than or equal to $200 billion.
D.
How many companies in the list are close to the maximum value in each attribute; that is, find the
number of companies whose sales is close to the highest sales in the list; find the number of companies
whose profit is close to the highest profit in the list, and so on. A company is considered close to
another company on a given dimension, if its value in that dimension is greater than a certain given
percentage (for example 95%) of the highest value in that dimension. Provide the percentage for
defining the closeness as a parameter.
E.
Consider the idea of closeness to the top company as discussed in D above. Some companies are close
to the topmost company on one dimension, some on two dimensions, some on three, and some on all
four. Thus, depending on how many dimensions a company is close to the corresponding top most
company, you can classify companies into four classes. Count and display the companies belonging to
each class.
F.
Prepare a table of total sales category-wise, and find the category with maximum sales.
G.
Show all companies with profits greater than or equal to 20% of sales, or profits greater than or equal to
10% of assets.
157
Forbes
2000
Rank
1
2
3
Name
IIMA/CISG0104TEC
Country
4
5
Citigroup
General Electric
American Intl
Group
ExxonMobil
BP
6
7
Bank of America
HSBC Group
8
9
Toyota Motor
Fannie Mae
United States
United
Kingdom
United States
United
Kingdom
Japan
United States
10
11
Wal-Mart Stores
UBS
United States
Switzerland
12
ING Group
Netherlands
13
Royal Dutch/Shell
Group
14
15
16
Berkshire Hathaway
JP Morgan Chase
IBM
Netherlands/
United
Kingdom
United States
United States
United States
17
18
19
20
Total
BNP Paribas
Royal Bank of
Scotland
Freddie Mac
France
France
United
Kingdom
United States
21
22
DaimlerChrysler
Altria Group
Germany
United States
23
24
ChevronTexaco
Pfizer
United States
United States
25
26
Wells Fargo
Verizon Commun
United States
United States
27
Barclays
28
Morgan Stanley
United
Kingdom
United States
29
30
General Motors
Nippon Tel & Tel
United States
Japan
31
32
Microsoft
Nestl
United States
Switzerland
Category
Sales
($bil)
Profits
($bil)
Assets
($bil)
Market
Value
($bil)
United States
United States
United States
Banking
Conglomerates
Insurance
94.71
134.19
76.66
17.85
15.59
6.46
1,264.03
626.93
647.66
255.30
328.54
194.87
222.88
232.57
20.96
10.27
166.99
177.57
277.02
173.54
49.01
44.33
10.81
6.66
736.45
757.60
117.55
177.96
135.82
53.13
7.99
6.48
171.71
1,019.17
115.40
76.84
256.33
48.95
9.05
5.15
104.91
853.23
243.74
85.07
94.72
4.73
752.49
54.59
133.50
8.40
100.72
163.45
56.22
44.39
89.13
6.95
4.47
7.58
172.24
792.70
104.46
141.14
81.94
171.54
131.64
47.74
35.65
8.84
4.73
4.95
87.84
745.09
663.45
116.64
59.29
90.21
46.26
10.09
752.25
44.25
157.13
60.70
5.12
9.20
195.58
96.18
47.43
111.02
112.94
40.36
7.43
6.20
82.36
120.06
92.49
285.27
31.80
67.75
6.20
2.57
387.80
165.97
97.53
103.97
33.69
4.90
791.54
61.33
33.00
3.64
580.63
64.81
185.52
92.41
3.82
2.17
450.00
150.87
27.47
73.00
34.27
64.56
8.88
5.48
85.94
62.15
287.02
106.55
Banking
Banking
Consumer durables
Diversified
financials
Retailing
Diversified
financials
Diversified
financials
Oil & gas operations
Insurance
Banking
Technology
hardware &
equipment
Oil & gas operations
Banking
Banking
Diversified
financials
Consumer durables
Food, drink &
tobacco
Oil & gas operations
Drugs &
biotechnology
Banking
Telecommunications
services
Banking
Diversified
financials
Consumer durables
Telecommunications
services
Software & services
Food, drink &
tobacco
158
33
34
35
36
37
38
39
Name
SBC
Communications
Deutsche Bank
Group
Siemens Group
HBOS
IIMA/CISG0104TEC
Country
United States
Germany
Germany
United
Kingdom
Italy
United States
Spain
40
ENI
ConocoPhillips
Banco Santander
Central
Merrill Lynch
41
42
43
Wachovia
Time Warner
Hewlett-Packard
United States
United States
United States
44
United States
45
South Korea
46
Samsung
Electronics
Johnson & Johnson
47
48
ABN-Amro
Holding
Honda Motor
American Express
49
50
51
52
53
54
United States
United States
United
Kingdom
Netherlands
Japan
United States
Japan
United States
France
France
58
59
60
61
62
63
Nissan Motor
Bank One
AXA Group
Socit Gnrale
Group
PetroChina
Goldman Sachs
Group
BBVA-Banco
Bilbao Vizcaya
Intel
MetLife
Home Depot
Viacom
Allstate
Merck & Co
64
Novartis Group
Switzerland
65
ENEL
Italy
55
56
57
China
United States
Spain
United States
United States
United States
United States
United States
United States
Category
Sales
($bil)
Profits
($bil)
Assets
($bil)
Market
Value
($bil)
Telecommunications
services
Diversified
financials
Conglomerates
Banking
39.16
5.97
100.17
82.93
58.85
1.53
792.49
50.23
86.62
32.68
2.81
3.09
85.47
571.76
75.77
52.87
53.29
90.49
28.70
4.82
4.83
3.28
67.91
81.95
442.24
76.13
46.72
56.78
Diversified
financials
Banking
Media
Technology
hardware &
equipment
Household &
personal products
Semiconductors
26.64
3.47
485.77
57.52
24.47
38.08
73.06
4.25
2.65
2.54
400.87
121.78
74.71
62.35
77.95
70.20
46.99
5.81
53.86
131.89
50.22
5.95
54.58
72.72
Drugs &
biotechnology
Banking
40.01
6.74
46.66
160.96
24.48
2.87
406.99
48.11
Banking
23.64
3.98
704.95
39.29
Consumer durables
Diversified
financials
Consumer durables
Banking
Insurance
Banking
67.44
24.17
3.61
3.00
63.09
175.00
40.61
68.89
57.77
21.04
90.10
35.52
4.19
3.40
1.00
1.61
60.56
290.01
456.13
526.54
41.71
58.38
41.39
40.61
29.53
22.84
5.67
2.54
58.36
394.14
90.49
50.12
24.10
2.81
288.80
44.67
Semiconductors
Insurance
Retailing
Media
Insurance
Drugs &
biotechnology
Drugs &
biotechnology
Utilities
30.14
35.79
62.90
25.85
32.15
30.78
5.64
2.24
4.04
2.47
2.73
7.33
47.14
326.84
35.37
90.94
134.14
42.59
196.87
26.34
82.29
68.66
32.90
108.76
26.77
5.40
46.92
116.43
38.99
2.11
71.36
46.84
159
Name
66
Unilever
67
68
69
70
71
72
Washington Mutual
Crdit Agricole
Deutsche Post
Comcast
Volkswagen Group
Tokyo Electric
Power
Munich Re
BMW-Bayerische
Motor
Ford Motor
Tyco International
US Bancorp
Roche Group
73
74
75
76
77
78
79
80
81
Royal Bank of
Canada
GlaxoSmithKline
IIMA/CISG0104TEC
Country
Category
Sales
($bil)
Profits
($bil)
Assets
($bil)
Market
Value
($bil)
Netherlands/
United
Kingdom
United States
France
Germany
United States
Germany
Japan
50.70
2.24
45.49
72.19
Banking
Banking
Transportation
Media
Consumer durables
Utilities
18.01
31.77
41.23
18.35
91.33
41.62
3.88
1.12
1.64
3.24
2.71
1.40
275.18
531.01
169.33
109.16
112.87
116.68
39.69
38.80
26.83
67.30
17.42
30.63
Germany
Germany
Insurance
Consumer durables
45.85
52.23
1.14
2.12
191.33
58.11
26.63
29.03
United States
Bermuda
United States
Switzerland
164.20
37.57
14.57
25.18
0.76
1.19
3.73
2.48
312.56
62.80
189.29
45.77
26.29
58.41
52.88
95.38
Canada
Consumer durables
Conglomerates
Banking
Drugs &
biotechnology
Banking
18.82
2.28
305.01
31.82
United
Kingdom
China
Drugs &
biotechnology
Oil & gas operations
34.16
6.34
29.19
124.79
39.16
1.94
45.32
50.09
Japan
Finland
63.23
37.05
0.98
4.52
68.04
29.15
38.00
104.30
22.58
3.59
49.62
54.08
28.44
15.34
19.21
96.94
19.82
1.92
2.69
3.81
1.45
4.35
51.52
269.94
77.15
40.11
36.59
55.06
36.51
36.28
37.19
166.09
14.22
45.68
16.53
29.58
2.13
1.10
1.89
4.24
196.40
97.35
223.60
44.42
47.19
23.76
33.53
28.73
32.81
3.54
28.37
79.62
82
83
84
BellSouth
United States
85
86
87
88
89
Walt Disney
Natl Australia Bank
Gazprom
Carrefour Group
Cisco Systems
United States
Australia
Russia
France
United States
90
91
92
93
FleetBoston Finl
RWE Group
UniCredito Italiano
BT Group
94
United Parcel
Service
United
Technologies
Fortis
United States
Germany
Italy
United
Kingdom
United States
Consumer durables
Technology
hardware &
equipment
Telecommunications
services
Media
Banking
Oil & gas operations
Food markets
Technology
hardware &
equipment
Banking
Utilities
Banking
Telecommunications
services
Transportation
United States
Conglomerates
31.03
2.36
34.65
48.77
Netherlands
52.51
0.56
507.98
30.19
United States
Netherlands
Diversified
financials
Chemicals
Insurance
32.63
17.75
1.74
1.63
41.89
266.59
39.85
23.49
Belgium
France
Banking
Consumer durables
19.62
38.17
1.36
2.05
368.37
54.04
21.64
19.64
95
96
97
98
99
100
Dow Chemical
Aegon Insurance
Group
Dexia
Renault Group
160
IIMA/CISG0104TEC
52. Optimal Machine Operation. ( Based on problem-8, Chapter 18, page 498, in Thuesen,
H.G.,Fabrycky, W.J., Thuesen G.J., Engineering Economy, Fifth Edition, Prentice Hall, 1977)
ABC Machine shop has just purchased eighteen identical automatic machines, each at a cost of 10,000
monetary units(MUs) . It employs six operators, one per three machines. Each operator is paid wages at the
rate of 5 monetary units (MUs) per hour and the shop operates 2000 hours per year. According to some of
the neighboring machine shops, each of the machines should be operated at 360 revolutions per minute
(rpm). At this speed, the expected life of a machine would be 5 years, and its annual maintenance cost 1500
MUs. The rate of production of a machine would be 180 units of the product per year. The annual power
cost would be 360 MUs. Assuming that the above are the only major costs, the proprietor wanted to know
the break-even price that he should charge per unit of the product at the above speed of operation.
On further inquiry, the proprietor came to know that the speed at which a machine is operated determines its
cost of operation; both the power consumption and maintenance charges increase with the speed of
operation, while the life of the machine remains more or less the same. The cost of power can be assumed to
be proportional to the speed of operation, while the maintenance cost changes non-linearly with increase in
speed. However, low speeds are not desirable, because the quantity of production increases with speed, the
quantity being directly proportional to the speed in rpm of the machine. To decide the speed at which the
machines have to be operated, the proprietor had the following data collected on the maintenance costs
likely to be incurred at different possible speeds:
Speed (rpm)
225
250
300
330
360
380
400
Maintenance cost
(MUs per year per machine)
600
700
800
950
1500
2200
3200
Using the above data, find the most desirable speed of operation of the machines from the financial view
point, assuming that the quantity of production is directly proportional to the speed of operation of a
machine, and that the quality of the product and the per-unit price that could be charged are independent of
the speed. Use the discount rate of 12% per year in your analysis. Furthermore, the salvage value at the end
of the life of a machine can be taken to be zero.
IIMA/CISG0104TEC
Each village is connected to the highway by two paths, one parallel to the X-axis and the other parallel to the
Y-axis. If the distance along either of them is less than a given 'tolerance', then the village is considered to
be 'close' to the highway. The parameters a,b, and c of the equation ax + by + c = 0 that represents the
highway are given in cells A1,B1, and C1 respectively and the tolerance in D1.
A. Use the range D20:D29 for formulae to tell us whether the corresponding village is 'close' to the
highway. Assume that the range A20:D29 is named as LTAB. What is the formula in D20?
B. Develop a spreadsheet formula such that when it is entered into cell B31 and then copied into the other
cells of the range B31:K40 , you get the types of distance between all the village pairs. For this purpose
you can use if necessary, the range LTAB mentioned above. What is the formula in B31?
C. In the B32:K51 compute the distances between each pair of the villages, as per the distance-types
obtained in B31:K40.
Use the following sample data:
Village Number
1
2
3
4
5
6
7
8
9
10
X-Coordinate
10
15
20
25
30
35
40
45
50
55
Y-Coordinate
20.08
30.1
40.09
50.5
61
72
80.01
90.02
100.5
113
Take the equation describing the highway as 2x-y = 0, and the tolerance as 0.05.
54. Pre-Paid Taxi Service.
The Gandhi-Nehru International Airport at Navi Dilli runs a pre-paid taxi service, with the help of local
traffic police, for the benefit of the arriving passengers. There are both AC and Non-AC taxis available, and
the charges for these are different. No advance bookings are possible. All bookings are made by the arriving
passengers at the prepaid taxi counter, located just near the exit of the arrival lounge.
The different components of the fare are:
1. Normal fare, depending on the distance of the zone in which the destination of passenger(s) is located.
This fare is subject to a minimum charge. For this purpose, the whole of Navi Dilli is divided into 20
zones, and each zone is considered to be at a certain distance from the airport. A map of Navi Dilli,
showing the different zones, is pasted both inside and outside the prepaid taxi counter for easy reference.
2. Night charge: if the time at which the booking is made falls between 11 PM and 5 AM in the night, 20%
of normal charge is charged extra.
3. Rush hour charge: Between 8:30AM and 11:30 AM, and further between 5:00 PM and 8:30 PM, 30% of
the normal charge is charged extra.
4. Luggage charges are Rs 10 per piece of luggage; however, the first three pieces are not charged.
5. A service charge of Rs 30 per AC taxi, and Rs 20 per non-AC taxi.
162
IIMA/CISG0104TEC
An Excel spread sheet is designed, as shown in the next figure, to assist the pre-paid taxi counter operator in
computing the fare for each taxi. Whenever a request for booking a single taxi is made the following details
are entered in range C4:C10 by the operator. The entries, as can be seen from the headings in the
corresponding cells of the figure, are: Time at which the booking is made (this is the basis on which night
time and rush hour charges are decided), The type of taxi being booked (AC or NONAC), The name of the
passenger in whose name the booking is being made ( this is just for record, and is not needed in
computations), number of passengers ( needed only for records; ; actually, the maximum number of
passengers per taxi is three; if the number is such that more than one taxi is needed, then for each taxi, the
data is separately entered), total number of pieces of luggage, address of the destination ( max of 200
characters, not really needed for computations), and zone number in which the destination falls. Based on
the above inputs, the various components of the fare are computed and output in the range C11:C17. All
time data is entered and shown in hh:mm:ss AM/PM format; and the same is the setting at the windows
level.
In making the above computations, several parameters are to be used. These are given in the following
tables (in the computations, the parameters are obtained through appropriate cell referencing, and not
through hard coding):
1. The minimum fare, per KM normal fare, and service charge per taxi for AC and NONAC taxis: range
H5:J8
2. Distance in KM from the airport to each zone: range H11:I31
3. Night time interval: L11:M11; additionally, two time constants are provided in cells L12:M12 to
facilitate computations.
4. Extra charge for night time is 20%of normal charge ( M9)
5. Rush hour intervals: L16:M16 and L17:M17
6. Extra charge for rush hour is 30% ( given in M14) of normal charge
7. Number of luggage pieces for which there is no luggage charge is 3 (given in J33)
8. Luggage charge for each piece of luggage over and above the number of free pieces allowed: Rs 10 per
each extra piece (given in J34)
163
IIMA/CISG0104TEC
1
2
3
4
5
6
7
8
Time
AC/NONAC
Name
NoofPassengers
Total Luggage
Address
10
11
Zone Number
Fare Normal
8
500
Distance
12
13
Night charge
Rush hour
Charge
Luggage charge
100
0
Night?
RushHr?
15
16
Service Charge
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Total Charge
14
34
E
F G
Pre-Paid Taxi
Service
1:35 AM
AC
XYZ
2
2
Minimum
PerKm
Service
Charge
AC
100
25
30
NONAC
50
18
20
Extra
Night
Charge
20%
20
Night
time
1
2
Distance
in KM
5
8
12
Extra
Rush
Hour
Charge
30
4
5
6
9
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
15
18
20
14
18
11
8
17
20
16
9
12
8
15
20
630
Zone No
TRUE
FALSE
No of
FreeBags
Charge/
bag
Rush
Hour
11:00:00 PM
5:00:00 AM
11:59:59 PM
12:00:00 AM
30%
From
8:30 AM
To
11:30 AM
5:00 PM
8:30 PM
3
10
35
164
IIMA/CISG0104TEC
Question: Give the formula in each of the following cells of the above spreadsheet
Cell address
Explanation of contents
E10
C11
E12
C12
Night charge
E13
C13
C14
C15
Service charge
C17
Total charge
165
IIMA/CISG0104TEC
Color code
R
O
Y
GY
In writing the weight and color code no fixed sequence is followed. For example, a 25 kg box with greenish
yellow fruit is sometimes coded as GY25, and sometimes as 25GY. Call the combination of weight and
color code written on a box as its box code. The price (in Rs.) of each box depends on both the color of the
fruit contained by it and its total weight as given in the following table, each row of which corresponds to a
color and each column to a weight range as indicated.
R
O
Y
GY
15 kg-18kg
200
210
220
230
19 kg - 21 kg
210
225
240
260
22 kg - 23 kg
225
260
290
320
24 kg - 25 kg
250
280
320
350
The next figure shows a spread sheet designed to compute and analyze the prices related to a set of the
above boxes. Data related to a sample of 10 boxes is provided in the figure. The column headings are selfexplanatory. The basic input consists of the serial number of each box (A6:A15) and the code indicating the
color and the weight as mentioned above (B6:B15). The price matrix is given in the range J6:M9.
Question 1.
In the range C6:C15, the weight of the box is extracted from the box code contained in the corresponding
cells of the range B6:B15. What is the formula in cell C6 (this formula is copied to C7:C15), considering
that your formula can be confined only to the four color codes given above and need not be very general.
Answer:______________________________________________________________
_______________________________________________________________
Question 2.
In the range D6:D15, the color code is extracted from the box code contained in the corresponding cells of
B6:B15. What is the formula in cell D6 (this formula is copied to D7:D15).
Answer:______________________________________________________________
_______________________________________________________________
166
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
IIMA/CISG0104TEC
Sl.No
1
2
3
4
5
6
7
8
9
10
BoxCode
25R
O20
22Y
GY21
Y18
19GY
24O
19Y
GY16
15R
Kg
25
20
22
21
18
19
24
19
16
15
Color
R
O
Y
GY
Y
GY
O
Y
GY
R
WtType
4
2
3
2
1
2
4
2
1
1
Price
250
225
290
260
220
260
280
240
230
200
Sl.No
BoxCode
Kg
Color
GY
WtType
Price
Avg Price
250
225
252.5
250
250
NoofBoxes
3
2
2
3
3
252.5
O
3
Y
R
O
Y
GY
E
F
FRUIT PRICES
R
O
Y
GY
15
1
200
210
220
230
19
2
210
225
240
260
22
3
225
260
290
320
24
4
250
280
320
350
Question 3.
The weight ranges are divided into four types, type 1 corresponding to the range 15 kgs to 18 kgs, type 2 to
19 kgs to 21 kgs, type 3 to 22 kgs to 23 kgs, and type 4 to 24 kgs to 25 kgs. Assume that weight is
expressed as integral number of kgs and it is never less than 15 nor greater than 25. In range E6:E15, the
weight types are obtained, using the information in C6:C15 and the categorization given in J4:M5. What is
the formula in E6 (this formula is copied from E7:E15).
Answer:_______________________________________________________________________
Question 4.
The price of each box is obtained in the range F6:F15 from the information contained in the ranges and cells
mentioned above. What is the formula in F6 (this formula is copied to F7:F15).
Answer:_______________________________________________________________________
Question 5.
In the sample data mentioned above, the average price of boxes corresponding to each color, and the number
of boxes corresponding to each color are to be tabulated respectively in the range D22:E25 as shown in the
figure. The codes of the colors of each of the rows in the above table are given in C22:C25. Data table
167
IIMA/CISG0104TEC
option is chosen from the Excel menu system by highlighting the table range C21:E25 for the above
purpose (you can use A17:F18 as criteria range if you wish in answering the following questions).
5A
5B
5C
What is the column input cell given as a part of the above data table
operation?
Answer_______________________________________________________________
Question 6
From the data table obtained above, the maximum average price and the maximum number
of boxes by comparing the different color categories are obtained in cells D27 and E27 respectively. The
corresponding color codes ( in case of a tie, the first one eligible in the corresponding column is taken) are
obtained in cells D28 and E28 respectively.
6A
6B
IIMA/CISG0104TEC
from city-2 to city-4 is given in cell E6 as 61. The cost of travelling from a city to itself is infinity and is
given as 9999.
A
4
5
6
7
8
9
10
11
12
13
9999
9
20
15
29
43
6
128
20
9999
21
28
8
55
5
15
51
9999
9
17
62
2
26
61
23
9999
16
24
3
24
37
19
22
9999
21
4
10
2
5
10
34
9999
1
Suppose the cost matrix of a travelling salesperson problem is given in a range named tsprange. A sub
called tsp is developed in VBA such that for the TSP given in tsprange, it finds a solution by applying the
cheapest neighbor heuristic, and displays the sequence of the cities to be visited in the row immediately
below tsprange, starting with the column immediately preceding the first column of tsprange; the total cost
of the solution is displayed in the cell immediately below the second cell of the above solution. Assume that
tsprange is so located that at least one column to its immediate left and two rows below it immediately are
available for the above output. Fill in the blanks in the sub tsp.
Sub tsp()
'--------------------------------------------------------------------'... To solve travelling salesperson Problem
'... using the cheapest neighbor heuristic
'
'... The distance matrix is given in the range named tsprange
'
'... n... ...........Number of cities
'... costmat(i,j)... cost of going to city-j from city-i
'... mincol(j)...... index of minimum cost column in row j
'... minval(j)...... minimum value of cost in row j
'... tcost.......... total cost of a solution
'... row ........... index of the row currently being examined
'... i and j ....... control variables in FOR NEXT Loops
'... 9999 .......... used for infinity
'-------------------------------------------------------------------Dim mincol() As Integer, minval() As Single, n As Integer
Dim costmat() As Single
Set tspmat = Range("tsprange")
n = tspmat.Rows.Count
ReDim mincol( _______), minval( __________ )
ReDim costmat( ________________ )
Dim tcost As Single
Dim i As Integer, j As Integer, row As Integer
'initialize
169
IIMA/CISG0104TEC
For i = 1 To n
mincol(i) = 0
minval(i) = 9999
costmat(i, 1) = 9999
For j = 2 To n
costmat(i, j) = _______________________
Next j
Next i
tcost = 0
tspmat.Cells(n + 1, 0).Value = 1 display the city in position-1
tspmat.Cells(n + 1, n).Value = 1 display the city in position n+1
'... Start with city-1 as the current city
'... Find in the row of the current city, min val, and mincol
'....to decide the next city to be visited
'... update cost matrix to ensure that the next city is not visited from anywhere else
'... update tcost
'... next city becomes current city
row = 1
For i = 1 To n - 1
For j = 2 To n
If ____________________________ < minval(row) Then
____________________________
___________________________
End If
Next j
tcost =_________________________________
End Sub
IIMA/CISG0104TEC
to city-1 Therefore the above sub when run with the above sample data changes the format of the following
cells to bold face: G5,D6,E7,B8,C9,F10. Write the sub formattsp.
Hint: In VBA the statement to be used to change the font of a cell to boldface is :
Cell reference. Font.Bold = True
For example if you want to format the cell in the second row and third column of range named xyz to bold
face the VBA statement should be:
Range(xyz).cells(2,3).font.bold =True
Your Answer
171
IIMA/CISG0104TEC
formattsp()
End sub
172
IIMA/CISG0104TEC
Latitude
13.05N
22.32N
18.56N
28.38N
Capital
Kabul
Yerevan
Baku
Manama
Dhaka
Minsk
Thimphu
Bandar Seri Begawan
Phnom Penh
Beijing
Nicosia
P'yongyang
T'bilisi
New Delhi
Latitude (Degrees.Minutes)
34.28N
40.10N
40.29N
26.10N
23.43N
53.52N
27.31N
04.52N
11.33N
39.55N
35.10N
39.09N
41.43N
28.37N
173
IIMA/CISG0104TEC
Country
Indonesia
Iran (Islamic Republic of)
Iraq
Israel
Japan
Jordan
Kazakhstan
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Lebanon
Malaysia
Maldives
Moldova, Republic of
Mongolia
Myanmar
Nepal
Oman
Pakistan
Philippines
Qatar
Russian Federation
Saudi Arabia
Singapore
South Korea
SriLanka
Syrian Arab Republic
Taiwan
Tajikistan
Thailand
Turkey
Turkmenistan
Ukraine
United Arab Emirates
Uzbekistan
Viet Nam
Yemen
Capital
Jakarta
Tehran
Baghdad
Jerusalem
Tokyo
Amman
Astana
Kuwait
Bishkek
Vientiane
Beirut
Kuala Lumpur
Male
Chisinau
Ulan Bator
Yangon
Kathmandu
Masqat
Islamabad
Manila
Doha
Moskva
Riyadh
Singapore
Seoul
Colombo
Damascus
Taipei
Dushanbe
Bangkok
Ankara
Ashgabat
Kiev (Rus)
Abu Dhabi
Tashkent
Hanoi
Sanaa
Latitude (Degrees.Minutes)
06.09S
35.44N
33.20N
31.71N
35.41N
31.57N
51.10N
29.30N
42.54N
17.58N
33.53N
03.09N
04.00N
47.02N
47.51N
16.45N
27.45N
23.37N
33.40N
14.40N
25.15N
55.45N
24.41N
01.22N
37.35N
6.55N
33.30N
25.02N
38.33N
13.45N
39.57N
38.00N
50.30N
24.28N
41.20N
21.05N
15.24N
L
M
S
Source-1
0.25
0.3
0.3
Source-2
0.35
0.15
0.5
174
IIMA/CISG0104TEC
According to the above table, 25% of the mangoes from source-1 (as measured by weight) are large, 30%
medium, and 30% small, and the remaining unsuitable for pickles. Similarly, among the mangoes from
source-2, 35% are large, 15% medium, and 50% small.
The size of the market is such that FPC does not want to make more than 1.8 units of L, 1.2 0f M, and 2.4 of
S.
The per unit sales price of L,M, and S are 22.81, 11.89, and 11 monetary units respectively.
The raw material is bought over several different weeks in each season at different prices. The detailed data
on these prices is not available. The data is available only on the total quantity of each type of mango
purchased in each season over the past several seasons, and the total purchase cost for each season( see the
following table). The total purchase cost involves not only the cost of the mangoes, but a few other
miscellaneous unspecified costs, which can be considered fixed.
Season No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Purchase quantity
Source-1
Source-2
4.5
5
4
3.5
5
2.5
3.5
5
4
3.5
3
3.8
2
2
4
3
2
3
2
2.5
3.5
4
3
4.5
5
3
4
1.5
2
3
Total Cost
46
32
32
37
31.5
31.2
18
26
34
21.1
33.8
37
35.5
20
25
Assume that the above values for pickle and fruit quantities (ex: thousands of Kgs) and revenue and cost
(ex: 000s of Rs) are in compatible and consistent units.
From the above table, estimate the unit purchase cost of each type of mango, using regression . Then,
through an LP formulation, find the quantities of L,M, and S to be produced by FRP to maximize its profits.
Assume that the costs not mentioned above are negligible.
Structure the data on your spreadsheet such that whenever you change any data that is fed to the regression,
the data that is going to be fed to solver would automatically change.
175
IIMA/CISG0104TEC
TIME
(hh:mm)
CALLED NO.
STATION
DURATION
(hh:mm:ss)
CALLS
AMOUNT
(Rs)
01/08/2006
01/08/2006
03/08/2006
03/08/2006
04/08/2006
09/08/2006
09/08/2006
12/08/2006
12/08/2006
18:46
18:48
21:14
22:15
20:57
20:04
20:41
8:15
21:15
9898119763
9898119763
8674241361
8632357112
8632357112
9833570091
9849367352
8632357112
4055164856
Mobile STD
Mobile STD
Gudivada
Guntur
Guntur
Mobile STD
Mobile STD
Guntur
Hyderabad
00:00:12
00:00:54
00:08:18
00:21:48
00:04:12
00:02:30
00:07:54
00:05:54
00:05:54
1
2
17
44
9
5
16
12
12
1.32
2.64
22.48
58.18
11.9
6.61
21.15
15.86
15.86
176
IIMA/CISG0104TEC
DATE
(dd/mm/yyyy)
TIME
(hh:mm)
CALLED NO.
STATION
DURATION
(hh:mm:ss)
CALLS
AMOUNT
(Rs)
12/08/2006
12/08/2006
12/08/2006
12/08/2006
12/08/2006
12/08/2006
12/08/2006
12/08/2006
13/08/2006
13/08/2006
13/08/2006
13/08/2006
14/08/2006
14/08/2006
15/08/2006
15/08/2006
15/08/2006
16/08/2006
17/08/2006
17/08/2006
18/08/2006
19/08/2006
19/08/2006
20/08/2006
21/08/2006
22/08/2006
23/08/2006
23/08/2006
23/08/2006
23/08/2006
24/08/2006
24/08/2006
25/08/2006
26/08/2006
26/08/2006
29/08/2006
29/08/2006
31/08/2006
01/11/2006
01/11/2006
01/11/2006
01/11/2006
02/11/2006
02/11/2006
03/11/2006
03/11/2006
03/11/2006
03/11/2006
21:24
21:28
21:30
21:35
21:57
22:37
22:59
23:02
10:35
20:52
21:21
21:27
20:20
20:37
11:00
11:12
13:08
8:11
12:04
16:34
16:42
13:40
20:09
22:51
11:17
11:29
9:54
10:44
11:52
17:46
10:54
22:36
12:31
11:45
11:52
12:35
12:37
10:55
9.35
10.07
14.13
14.16
12.28
12.53
9.28
9.43
10.04
11.26
9849367352
9849367352
9825578057
9868304604
9935426294
8632357112
8674241361
8632357112
8632357112
2228540014
2228540014
2227820605
4023733334
9441321990
4023733334
9945698685
9440542629
9450137885
8632357112
8632357112
4027135841
8632357112
4023733334
8674241361
8632357112
8632357112
8632357112
8632357112
8632357112
4027135841
8632357112
9825309049
8674241361
8632357112
8632357112
8632357112
8632357112
8632357112
8572246251
8632357112
1124682101
1124682101
8674241361
8632357112
5122598794
8632357112
9440261752
8674241361
Mobile STD
Mobile STD
Mobile STD
Mobile STD
ISD
Guntur
Gudivada
Guntur
Guntur
Bombay
Bombay
Bombay
Hyderabad
BSNL Mobile STD
Hyderabad
ISD
BSNL Mobile STD
BSNL Mobile STD
Guntur
Guntur
Hyderabad
Guntur
Hyderabad
Gudivada
Guntur
Guntur
Guntur
Guntur
Guntur
Hyderabad
Guntur
Mobile STD
Gudivada
Guntur
Guntur
Guntur
Guntur
Guntur
Chithoor
Guntur
Delhi
Delhi
Gudivada
Guntur
Kanpur
Guntur
BSNL Mobile STD
Gudivada
00:05:42
00:08:42
00:02:54
00:00:42
00:04:24
00:19:18
00:31:06
00:20:24
00:02:00
00:09:24
00:09:24
00:08:48
00:04:18
00:08:06
00:01:00
00:01:54
00:08:42
00:03:18
00:08:00
00:10:24
00:06:48
00:11:42
00:07:30
00:04:00
00:10:42
00:20:24
00:09:06
00:01:24
00:16:24
00:02:24
00:09:42
00:07:48
00:01:24
00:05:06
00:00:36
00:06:12
00:01:00
00:08:18
00:01:12
00:14:18
00:01:54
00:01:12
00:24:18
00:11:30
00:08:42
00:13:36
00:06:36
00:10:06
18
6
2
9
39
63
41
4
19
19
18
9
17
2
4
18
7
16
21
14
24
15
8
22
41
19
3
33
5
20
16
3
11
2
13
2
4
17
3
29
2
3
49
23
18
28
14
21
23.8
7.93
2.64
11.9
51.57
83.31
54.21
5.28
25.12
25.12
23.8
11.9
22.48
2.64
5.28
23.8
9.25
21.15
27.77
18.51
31.73
19.83
10.57
29.09
54.21
25.12
3.96
43.63
6.61
26.44
21.15
3.96
14.54
2.64
17.19
2.64
5.28
22.48
3.96
38.34
2.64
3.96
64.79
30.41
23.8
37.02
18.51
27.77
177
IIMA/CISG0104TEC
DATE
(dd/mm/yyyy)
TIME
(hh:mm)
CALLED NO.
STATION
DURATION
(hh:mm:ss)
CALLS
AMOUNT
(Rs)
03/11/2006
03/11/2006
03/11/2006
05/11/2006
05/11/2006
05/11/2006
05/11/2006
05/11/2006
06/11/2006
06/11/2006
06/11/2006
07/11/2006
07/11/2006
07/11/2006
07/11/2006
07/11/2006
07/11/2006
08/11/2006
08/11/2006
08/11/2006
09/11/2006
09/11/2006
09/11/2006
09/11/2006
09/11/2006
10/11/2006
10/11/2006
11/11/2006
11/11/2006
11/11/2006
12/11/2006
12/11/2006
13/11/2006
13/11/2006
14/11/2006
14/11/2006
14/11/2006
15/11/2006
15/11/2006
15/11/2006
15/11/2006
16/11/2006
16/11/2006
16/11/2006
17/11/2006
17/11/2006
17/11/2006
18/11/2006
16.27
20.4
21.21
10.46
16.04
16.13
16.4
21
7.45
11.03
11.28
10.03
16
16.22
17.19
21.1
21.19
10.51
19.34
21.19
10.55
11.04
11.13
17.5
18.15
9.27
9.32
7.49
9.55
11.23
16.46
19.35
11.2
21.24
10.12
10.22
16.27
10.31
10.45
18.08
22.25
11.46
16.58
21
11.57
21.22
22.25
7.41
8632357112
8572246251
8632357112
8644222612
8632357112
8632357112
5122598794
9849908545
9440261172
8632357112
8632357112
8632357112
8632357112
9392520541
8632357112
8644226142
8674241361
8632357112
5122598794
8674241361
8632357112
8674241361
8674241361
8674241361
8632357112
8674241361
8674241361
8674241361
8632357112
8674241361
8632357112
8632357112
8632357112
8632357112
8632357112
8632357112
8632357112
8632357112
8632357112
8632357112
2692261285
8632357112
8674241361
9849908545
8632357112
9849908545
8632357112
8632357112
Guntur
Chithoor
Guntur
Tenali
Guntur
Guntur
Kanpur
Mobile STD
BSNL Mobile STD
Guntur
Guntur
Guntur
Guntur
STD
Guntur
Tenali
Gudivada
Guntur
Kanpur
Gudivada
Guntur
Gudivada
Gudivada
Gudivada
Guntur
Gudivada
Gudivada
Gudivada
Guntur
Gudivada
Guntur
Guntur
Guntur
Guntur
Guntur
Guntur
Guntur
Guntur
Guntur
Guntur
Anand
Guntur
Gudivada
Mobile STD
Guntur
Mobile STD
Guntur
Guntur
00:10:00
00:03:24
00:00:48
00:00:36
00:00:30
00:06:48
00:05:00
00:01:12
00:05:06
00:06:24
00:21:54
00:23:36
00:16:42
00:21:06
00:06:42
00:13:48
00:06:48
00:19:06
00:00:18
00:05:18
00:06:48
00:05:48
00:04:12
00:01:54
00:15:06
00:00:12
00:03:54
00:06:54
00:13:48
00:11:54
00:15:18
00:07:30
00:21:54
00:11:36
00:03:24
00:03:30
00:08:18
00:13:12
00:02:06
00:10:36
00:16:12
00:16:18
00:00:42
00:02:00
00:10:42
00:02:06
00:12:36
00:10:18
20
7
2
2
1
14
10
3
11
13
44
48
34
43
14
28
14
39
1
11
14
12
9
4
31
1
8
14
28
24
31
15
44
24
7
7
17
27
5
22
17
33
2
4
22
5
26
21
26.44
9.25
2.64
2.64
1.32
18.51
13.22
3.96
14.54
17.19
58.18
63.47
44.96
56.86
18.51
37.02
18.51
51.57
1.32
14.54
18.51
15.86
11.9
5.28
40.99
1.32
10.57
18.51
37.02
31.73
40.99
19.83
58.18
31.73
9.25
9.25
22.48
35.7
6.61
29.09
22.48
43.63
2.64
5.28
29.09
6.61
34.38
27.77
178
IIMA/CISG0104TEC
DATE
(dd/mm/yyyy)
TIME
(hh:mm)
CALLED NO.
STATION
DURATION
(hh:mm:ss)
CALLS
AMOUNT
(Rs)
18/11/2006
18/11/2006
19/11/2006
20/11/2006
20/11/2006
20/11/2006
20/11/2006
20/11/2006
20/11/2006
20/11/2006
21/11/2006
21/11/2006
22/11/2006
23/11/2006
24/11/2006
24/11/2006
26/11/2006
26/11/2006
26/11/2006
26/11/2006
26/11/2006
27/11/2006
27/11/2006
28/11/2006
28/11/2006
29/11/2006
29/11/2006
29/11/2006
30/11/2006
01/04/2007
01/04/2007
02/04/2007
05/04/2007
05/04/2007
06/04/2007
06/04/2007
06/04/2007
06/04/2007
07/04/2007
07/04/2007
08/04/2007
08/04/2007
08/04/2007
08/04/2007
08/04/2007
10/04/2007
11/04/2007
12/04/2007
10.27
17.3
20.16
7.42
7.45
8.22
11.48
19.58
20
20.39
11.16
11.48
10.3
10.22
9.28
13.09
11.44
19.25
21.05
22.18
22.57
10.05
12.31
10.47
21.18
7.54
9
9.04
19.02
20.35
21.29
21.15
20.56
22.15
9.03
10.23
22.31
22.52
22.13
22.15
9.15
9.23
9.33
10.06
10.24
8.06
21.52
16.2
8632357112
8632357112
4027502346
8632357112
9326881784
4065164856
8632357112
9326881784
9326881784
8632357112
8632357112
8632357112
8632357112
8632357112
9326881784
8632357112
4027502346
4027502346
9849908545
4027502346
8632357112
8632357112
5122598794
8632357112
9392520541
8632357112
8632357112
9302520541
4065164856
8632357112
8674241361
8632357112
8674241361
4023548488
8632357112
8632357112
4023548488
4023548488
4023548488
4023548488
4023548488
4023548488
4023548488
4023548488
4023548488
8632357112
4023548488
1128524458
Guntur
Guntur
Hyderabad
Guntur
STD
Hyderabad
Guntur
STD
STD
Guntur
Guntur
Guntur
Guntur
Guntur
STD
Guntur
Hyderabad
Hyderabad
00:00:18
Hyderabad
Guntur
Guntur
Kanpur
Guntur
STD
Guntur
Guntur
STD
Hyderabad
Guntur
Gudivada
Guntur
Gudivada
Hyderabad
Guntur
Guntur
Hyderabad
Hyderabad
Hyderabad
Hyderabad
Hyderabad
Hyderabad
Hyderabad
Hyderabad
Hyderabad
Guntur
Hyderabad
Delhi
00:03:36
00:23:54
00:02:06
00:05:00
00:02:24
00:02:12
00:12:00
00:02:36
00:00:42
00:13:48
00:08:30
00:15:00
00:07:12
00:24:36
00:01:36
00:07:42
00:00:18
00:00:36
00:00:12
00:07:42
00:11:36
00:18:42
00:02:36
00:10:42
00:04:24
00:22:36
00:01:54
00:02:24
00:10:06
00:01:06
00:11:06
00:08:30
00:09:12
00:10:00
00:15:36
00:02:42
00:00:54
00:01:00
00:01:00
00:00:48
00:00:30
00:02:48
00:00:48
00:00:30
00:00:42
00:04:42
00:01:54
00:01:30
8
48
5
10
5
5
24
6
2
28
17
30
15
50
4
16
1
2
1
16
24
38
6
22
9
46
4
5
21
3
23
17
19
20
32
6
2
2
2
2
1
6
2
1
2
10
4
3
10.57
63.47
6.61
13.22
6.61
6.61
31.73
7.93
2.64
37.02
22.48
39.67
19.83
66.12
5.28
21.15
1.32
2.64
1.32
21.15
31.73
50.25
7.93
29.09
11.9
60.83
5.28
6.61
27.77
3.96
30.41
22.48
25.12
26.44
42.31
7.93
2.64
2.64
2.64
2.64
1.32
7.93
2.64
1.32
2.64
13.22
5.28
3.96
179
IIMA/CISG0104TEC
DATE
(dd/mm/yyyy)
TIME
(hh:mm)
CALLED NO.
STATION
DURATION
(hh:mm:ss)
CALLS
AMOUNT
(Rs)
12/04/2007
12/04/2007
12/04/2007
13/04/2007
14/04/2007
14/04/2007
17/04/2007
18/04/2007
18/04/2007
18/04/2007
19/04/2007
19/04/2007
20/04/2007
20/04/2007
20/04/2007
20/04/2007
21/04/2007
21/04/2007
21/04/2007
22/04/2007
24/04/2007
26/04/2007
26/04/2007
26/04/2007
27/04/2007
16.22
22.15
23.12
22.3
9.09
20.29
20.12
9.44
22.01
23.03
18.4
22.46
20.15
22.01
22.34
23.03
21.09
22.07
22.48
19.32
21.07
21.12
21.55
22.04
12.07
9871264343
4023548488
4023548488
4023548488
8632357112
8632357112
8632357112
8632357112
4023548488
4023548488
8632357112
4023548488
8632357112
4023548488
4023548488
4023548488
5122598794
4023548488
4023548488
8632357112
8632357112
8632357112
9849908545
4065164856
4422313732
Mobile STD
Hyderabad
Hyderabad
Hyderabad
Guntur
Guntur
Guntur
Guntur
Hyderabad
Hyderabad
Guntur
Hyderabad
Guntur
Hyderabad
Hyderabad
Hyderabad
Kanpur
Hyderabad
Hyderabad
Guntur
Guntur
Guntur
Mobile STD
Hyderabad
Madras
00:01:06
00:01:00
00:02:48
00:08:30
00:38:30
00:10:12
00:10:00
00:17:24
00:01:48
00:05:12
00:11:36
00:08:42
00:15:30
00:00:54
00:00:54
00:05:12
00:15:00
00:00:30
00:00:30
00:06:30
00:06:54
00:15:36
00:01:54
00:03:00
00:04:54
3
2
6
17
77
21
20
35
4
11
24
18
31
2
2
11
30
1
1
13
14
32
4
6
10
3.96
2.64
7.93
22.48
101.82
27.77
26.44
46.28
5.28
14.54
31.73
23.8
40.99
2.64
2.64
14.54
39.67
1.32
1.32
17.19
18.51
42.31
5.28
7.93
13.22
180
IIMA/CISG0104TEC
Month
Jan
Jan
Feb
Feb
Mar
Mar
Apr
Apr
May
May
Jun
Jun
MM ( j )
52.5
56
65.61
56.86
85.62
91.33
107.58
107.58
127.64
136.15
105.79
105.8
Fortnight No ( j)
13
14
15
16
17
18
19
20
21
22
23
24
Month
Jul
Jul
Aug
Aug
Sep
Sep
Oct
Oct
Nov
Nov
Dec
Dec
MM ( j )
64.81
69.14
63.49
67.73
71.4
71.4
72
76.8
56.47
56.48
47.8
50.99
181
IIMA/CISG0104TEC
KC (i,j) values for each crop (i) and for each fortnight ( j)
Crop No.
1
2
3
4
5
6
7
8
9
10
Crop Name
Paddy-1
Paddy-2
Bajra-K
Vegetable-K
Wheat
Hy.Cotton
Oilseed
Sugarcane
Tobacco
Fruitcrop
Fortnight No.
6
7
1.04
1.14
1.14
1.1
0.4
1.01
0.4
0.51
0.75
0.75
0.95
1.1
1.1
1.1
1.25
0.75
0.75
0.75
0.75
0.7
0.7
0.7
0.7
0.78
10
11
12
1.1
1.1
0.17
0.17
1.25
1.05
1.05
0.7
0.7
0.65
0.65
20
0.95
21
0.95
22
23
24
1.23
1.22
1.15
0.27
1.15
1.1
0.7
1.15
0.34
0.95
1.1
0.7
1.14
0.38
1.02
0.69
0.95
1.1
0.7
0.97
0.44
0.88
1.05
0.7
1.03
0.7
0.65
0.75
0.73
1.1
0.7
0.87
0.7
0.38
KC (i,j) values for each crop (i) and for each fortnight ( j) (continued)
CropNo.
1
2
3
4
5
6
7
8
9
10
CropName
Paddy-1
Paddy-2
Bajra-K
Vegetable-K
Wheat
Hy.Cotton
Oilseed
Sugarcane
Tobacco
Fruitcrop
Fortnight No.
18
19
1.05
1.05
0.95
0.95
0.97
0.45
1.16
1.23
13
1.1
1.1
0.29
0.17
14
1.1
1.1
0.5
0.21
15
1.1
1.05
0.93
0.31
16
1.05
1.05
1
0.61
17
1.05
1.05
1
0.96
0.3
0.56
0.83
1.08
1.15
1.15
1.15
1.05
0.25
0.65
1.05
0.25
0.65
1.05
0.28
0.65
1.05
0.54
0.65
1.05
0.77
0.65
1.05
1.05
0.65
1.15
1.1
0.7
182
IIMA/CISG0104TEC
The retirement age of an employee is 60 years. If the date of completing 60 years falls in
between a month, the retirement date is rounded off to the end of the month. That is, if the date
of birth is 10 December 1930, the employee would complete 60 years on 10 December 1990,
but he / she would retire on 31st December 1990.
2.
Each employee gets a consolidated salary at the end of each month. On the day of retirement,
an employee gets paid a lump sum amount as retirement benefit. This retirement benefit is
equal to 30 times the monthly salary at the time of retirement.
3.
The exact salary at the time of retirement depends on several factors such as the promotions etc.
However, to simplify the problem, assume that, on the average, the salary of an employee
increases every year by 15% of previous years salary. Assume for this purpose, that the
increment is given always at the beginning of an year, i.e. from 1st January onwards. For
example, if the salary in the year 87 was 100, that in 88 would be 1.15 * 100, in 89 it would be
1.15 * 1.15* 100 and so on.
Your spread sheet should consist of the following data on each employee:
1.
2.
3.
Employee number
Date of birth
Present salary
2.
3.
4.
5.
For any given year, it should display the total retirement benefits that the company would have
to pay. You can specify in which cell the year has to be entered, and in which cell the output
would be displayed.
For any given month in a given year, it should display the total retirement benefits that should
be paid by the company.
For each year, from 2000 to 2010, it should display in the form of a table how many employees
are due to retire.
The above spread sheet is intended to be a general one. Test your data on a sample data of 50
employees. Create your own data.
The spread sheet should be capable of being used according to Indian date system or American
date system. However, it is tedious to keep re-entering the dates in the sample data to test it
under both conditions. Write a macro through which you can do the following: Initially, the
global default international date is dd/mm/yy, and all date strings are entered accordingly. For
testing it with the global data format mm/dd/yy, you must invoke your macro; the date strings
should automatically get re-written according to the new format. That is, if the previous string
were: 13/11/85, the new string should be 11/13/85. Another macro should be able to bring the
global date format back to its original, and similarly, the date strings should also revert to their
original form.
183
IIMA/CISG0104TEC
Employee number
Basic salary (in Rs. per month) as on the given date
Date of Birth
Date of joining the organization
2.
3.
4.
The scheme is applicable only for employees who have completed 10 years of service with the
organization on the date given. For this purpose the number of years of service is computed as
equal to the year number of the given date minus the year number of the date of joining the
organization.
The compensation amount consists of two components: (a) A fixed component which is
independent of the basic salary and is dependent on the number of years of service completed
till the given date. (b) The second component depends on the basic salary as on the given date
and the number of years of service remaining till retirement.
The fixed component of emoluments is equal to Rs. 1,00,000 if the number of years of service
completed is greater than 10 and less than or equal to 15 years. It is equal to Rs. 2,00,000 for
number of years of service completed is greater than 15 and less than or equal to 20. For
number of years of service completed is greater than 20 the component is equal to Rs. 4,00,000.
The number of years of service completed till the given date is computed in the same way as in
point 1 above.
The second component of the compensation is equal to the basic salary per month multiplied by
2 multiplied by remaining years of service. Remaining years of service is computed as equal to
the year of retirement minus the year of the given date. The year of retirement in turn is
computed as 60 plus the year of birth.
Design a spreadsheet to contain the inputs mentioned above and the date on which the scheme is applicable.
In addition the spreadsheet should accept the employee number of any employee who wants to know the
benefits that he/she would get if he/she chooses to retire on the given date and exhibit the compensation that
he is eligible for. If he is not eligible to retire on the given date then the spreadsheet should give a
corresponding message. You can write a macro to display the desired output.
184
IIMA/CISG0104TEC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
MillCode
TM1
TM1
TM1
TM1
TM1
TM1
TM2
TM2
TM2
TM2
TM2
TM3
TM3
TM3
TM3
TM4
TM4
TM4
TM4
TM4
MemberCode
ABC
DEF
XYZ
PPP
BBB
AAA
CCC
DDD
MMM
NNN
ACC
CCD
BBC
CDE
GGF
FFH
HHF
TTF
TTR
VVT
11:00 AM
12:00 PM
StartTime
6:25 AM
7:05 AM
8:00 AM
11:55 AM
1:30 PM
4:15 PM
7:30 AM
9:32 AM
10:25 AM
11:48 AM
5:38 PM
7:35 AM
9:32 AM
10:27 AM
11:40 AM
7:40 AM
9:32 AM
10:25 AM
11:48 AM
5:38 PM
EndTime
6:50 AM
7:15 AM
8:40 AM
12:30 PM
2:00 PM
4:30 PM
8:02 AM
10:04 AM
11:01 AM
12:43 PM
5:51 PM
8:02 AM
10:06 AM
11:01 AM
12:43 PM
8:02 AM
10:04 AM
11:01 AM
12:43 PM
5:51 PM
Distance(KM)
3
1
3.25
4
4.2
1.5
4
5
4.8
7
1.8
3.5
5
5.6
7
2.5
4
3.8
6
1.1
Duration
(min)
25.00
10.00
40.00
35.00
30.00
15.00
32.00
32.00
36.00
55.00
13.00
27.00
34.00
34.00
63.00
22.00
32.00
36.00
55.00
13.00
Speed
(Km/hr)
7.20
6.00
4.88
6.86
8.40
6.00
7.50
9.37
8.00
7.64
8.31
7.78
8.82
9.88
6.67
6.82
7.50
6.33
6.55
5.08
I. For each of the above data records, the duration of usage in minutes and the average speed in Km/hour are
computed in the corresponding cells of columns G and H.
I.1. What is the formula in G6, if it is copied to the other relevant cells in the same column?
Answer: _____________________________________________________________________
I.2. What is the formula H6, if it is copied to the other relevant cells in the same column?
Answer: _____________________________________________________________________
185
IIMA/CISG0104TEC
II. In M10:Q13, the following are tabulated as shown in the following figure,from the data of part-I:
MillCode, Total duration of usage in minutes (TdurnMin), total duration of usage in hours (TdurnHrs),
Percentage utilization (Utlzn) assuming that each machine is available for usage for a total of eleven hours,
and the average speed at which the machine was run in its usage (AvgSpd) in Km/hour, ignoring the periods
during which it was not used. For this purpose, the data table feature was used, in conjunction with the
criterion range M5:M6 (not shown in the following figure). Further, in the row following the data table (that
is row number 14)the same statistics as above are obtained for all machines considered together.
8
9
10
11
12
13
14
M
MillCode
TM1
TM2
TM3
TM4
Overall
N
TDurnMin
155
155
168
158
158
639
O
TDurnHrs
2.58
2.58
2.80
2.63
2.63
10.65
P
Utlzn
23.48
23.48
25.45
23.94
23.94
24.2
Q
AvgSpd
6.56
6.56
8.07
8.01
6.61
7.33
Fill in the contents of the two cells of the criterion range and the formulae in the data table area as asked
below:
Cell
Address
M5
N9
O9
P9
Q9
N14
P14
Q14
III. CAO is not satisfied with the current way the one hour maintenance slot is allocated everyday for the
machines. He would like to choose the slot which is least used by the regular users. The slot should be one
of the twelve from among the following: 6:00 AM to 7:00 AM, 7:00AM to 8:00 AM, 8:00 AM to 9:00
AM,, 5:00 PM to 6:00 PM. For the data currently collected he would like to find which of the above
twelve slots has least usage in terms of duration of use falling within the slot, considering all machines
together (the total usage can even be more than one hour because we are considering the sum of duration of
each machine within the concerned interval). For this purpose, additional values are computed in I6:J25 (
see the figure below). In D2:E2, not shown in the figure, the starting and ending times of an one-hour
maintenance-interval in question are obtained. In column I, for each record of the original data collected (
see part-I), whether the users usage-interval falls within the interval of D2:E2 is found through a
186
IIMA/CISG0104TEC
TRUE/FALSE answer. If the answer is TRUE, the duration of overlap is found in the corresponding cells of
J; if there is no overlap, the duration of overlap is zero. The total of all overlap values is found in J26. The
starting value of each of the twelve possible maintenance intervals are entered in D32:D43. The total overlap
values for each of the twelve intervals are obtained in E32:E43, using the data table feature, and using D2 as
the column input cell. The minimum of these tabulated values is found in E45. Finally, the starting and
ending values of the interval which gave rise to the above minimum are obtained in G31:H31. In case of
multiple minima, the first one is taken.
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
I
Overlap?
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
TRUE
TRUE
FALSE
FALSE
FALSE
TRUE
TRUE
FALSE
FALSE
TRUE
TRUE
FALSE
J
ExtentofOverlap
0.00
0.00
0.00
5.00
0.00
0.00
0.00
0.00
1.00
12.00
0.00
0.00
0.00
1.00
20.00
0.00
0.00
1.00
12.00
0.00
52.00
MntintvlS
Totverlp
52.00
25
85
46
84
117
52
159
30
0
0
15
26
6:00 AM
7:00 AM
8:00 AM
9:00 AM
10:00 AM
11:00 AM
12:00 PM
1:00 PM
2:00 PM
3:00 PM
4:00 PM
5:00 PM
MaintS
2:00 PM
MaintE
3:00 PM
187
IIMA/CISG0104TEC
E2
I6 (Copied to other
relevant cells in the
column)
J6 (Copied to other
relevant cells of the
column)
E31
E45
G31
H31
IV. The CAO wants to charge the users based on their actual usage in minutes (recording actual usage is
possible). For this the charge in Rs/minute should be chosen such that the total charge will break even with
the maintenance and electricity charges. The maintenance per year ( an year is assumed to be 365 days) per
mill is Rs 20,000, and each mill consumes 3units of electricity per one hour of usage; and the electricity
charge can be assumed to be Rs 6 per unit. If the data collected on the day in question can be assumed to be
truly representative, and if the gym operates on each day of the year, what is the formula to compute the
charge in Rs per minute ( the corresponding formula can be entered in any empty cell)
Answer:_____________________________________________________________________
V. In M18:O21 are found for each mill the total number of users who began before the noon (ie at or before
12:00 PM), and the total number who began in the afternoon
( ie after 12:00 PM), as shown below.
16
17
18
19
20
21
M
MillCode
TM1
TM2
TM3
TM4
N
NoinAM
4
4
4
4
4
O
NoinPM
2
2
1
0
1
For this purpose, the data table feature is used in conjunction with two criteria ranges, the first one being
N5:N6, and the second one being O5:O6, with the column input cell specified as M6. Fill the formulae in
the cells given below:
188
IIMA/CISG0104TEC
Cell
N5
N6
O5
O6
N17
O17
PassMark
StdCode
S1
S2
S3
S4
S5
S6
S7
S8
S9
S10
40
English
35
30
60
30
70
50
60
70
49
48
50
Science
30
70
50
40
80
55
65
65
51
48
50
Maths
50
80
70
70
70
50
70
30
51
90
S1
English
Science
English
English
Science
Maths
Science
5
20
10
10
10
20
2
S2
S4
S8
S10
FailList
Range Names
B5:E14
B18:B18
SM
OTPT
In the spread sheet shown above, the range SM ( currently B5:E14) consists of the marks obtained by a set
of students in English, Science, and Maths. In the row immediately above SM are shown the field headings
StdCode, English, Science, Maths in the corresponding columns; and in the row immediately preceding the
field headings, are given the pass marks for each of the three subjects in the corresponding columns. A sub
in VBA is written such that it outputs the information related to failed students in SM. The name of the sub
189
IIMA/CISG0104TEC
is FailList and it can be invoked by pressing the button with the same label. The output starts in the cell
named OTPT ( which in the example is cell B18). Each output line consists of the student code, subject in
which the student failed, and the deficiency in marks which led to the failure. In case a student has failed in
more than one subject, the student code is not repeated for the second (and third, if any) lines for the student,
but the subject and deficiency are displayed. The row of OTPT and the rows below it are ensured to be
empty before the sub is invoked. The listing of the sub is given below with some blanks. Fill in the blanks.
Sub FailList()
' To Output a list of Failed students
' The input is given in the format:
' Student code , marks in English, Scence and Math
' The Output consists of Student code, subject of failure, deficiency in marks
' If a student has failed in more than one subject her/his code is given only in the first
' line of output for the student
' Range Names: SM..... Range consisting of data on each student (B5:B14 in the example)
' The field headings are given in the row above the row of first student
' Pass marks are given for eachsubject, in the cell above the subject name
' OTPT.... The name of the first cell (B18 in the example) in the first student who has failed
'
Assume that the row containing OTPT and all rows below are
'
ensured to be empty before the sub is called
' n ... number of students in in the input
' def... deficiency of marks as compared to the pass mark
' Line... Line number being output
' CSCode... Current student code in the output
Dim CSCode As String, i As Integer, line As Integer, def As Integer, n As Integer
Dim j As Integer
line = 0
n = Range("SM").Rows.Count
CSCode = ""
For i = 1 To n
For j = 2 to 4
If ------------------------------------------------------------------------------------------------------------- Then
def = ---------------------------------------------------------------------------------------------------------line = line + 1
Range("OTPT").Cells(line, 2).Value = ------------------------------------------------------------Range("OTPT").Cells(line, 3).Value = --------------------------------------------------------------
IIMA/CISG0104TEC
End If
Next j
Next I
End Sub
191
IIMA/CISG0104TEC
66. Sudoku Support System. Consider a 9x9 grid as shown in figure-1. This grid is further divided into
nine 3x3 boxes ( or sub-squares), each marked with double-line boundaries in the figure.
A Sudoku puzzle consists of starting with such a grid, with some of the cells already filled in with the digits
1,2,,9, a cell not containing more than one digit, and requires the puzzle-solver to fill in the remaining
cells with digits according to the following rules:
(1) each cell of the grid contains only one digit,
(2) each of the digits 1,2,3,, 9 is contained in each row once and only once
(3) each of the digits 1,2,,9 is contained in each column once and only once, and
(4) similarly, each of the digits 1,2,3,, 9 is contained in each sub-square once and only once.
Every puzzle has a unique solution.
Given below is a VBA SUB called Sudoku, that takes as input a Sudoku puzzle given in a 9x9 range called
Pzl in the spreadsheet, and then fills each empty cell of the puzzle with a string of digits, called its
possibility-string, such that one of the digits in the string should be the digit that should occupy the cell in
the final solution. Finding the possibility strings should serve as an intermediate step in the solution of the
puzzle, and the strings should be of help to a puzzle-solver.
The procedure for producing the possibility-strings is as follows:
1. Assign to each empty cell the possibilty-string 123456789
2. Consider each of the cells (of the original puzzle) whose digit is not yet found. From the cell( i , j) under
consideration, eliminate from its possibility-string all the digits already filled-in in the cells of its row ( that
is row-i ), its column ( that is column-j), and its sub-square. What remains is (i,j)s possibility-string to be
output by the sub.
It is possible, in the above process of elimination, for a cell to be filled-in to get a possibility-string which
has only one digit; in that case, the only digit remaining in the possibility-string is the digit that the cell
would have in the final solution of the puzzle. Hence, in the consideration of further cells for reduction of
possibility-strings, such one-digit possibilty-strings are taken as though they are the filled-in values.
The output of the sub for the puzzle of Figure-1 is shown in Figure-3. To illustrate the above method of
generating the possibilty-strings, let us consider cell (5,7), that is the cell corresponding to row-5 and
column-7 of the given puzzle. Initially, the possibilty string in this cell would be 123456789. In row-5 the
puzzle already has the digits 3 and 4 filled in. Therefore the possibility string of cell (5,7) is reduced by
eliminating from 123456789 the digits 3 and 4, to obtain 1256789. Column-7 has only one filled-in
cell, and that cell is filled with 5. Hence the above possibility-string is further reduced by eliminating from it
the digit 5, to obtain 126789 . Cell (5,7) belongs to the sub-square bounded by fourth and sixth rows of
the grid, and seventh and ninth columns. This sub-square is already filled with the digits 1 and 8. Therefore,
by eliminating 1 and 8 from the above possibility-string we get the final possibility-string 2679 for cell
(5,7).
Fill in the blanks in the given VBA listing.
192
IIMA/CISG0104TEC
2
6
8
2
3
8
7
4
5
7
2
3
1
4
8
2
6
4
3
8
9
5
1
7
2
7
2
9
4
1
3
5
6
8
8
3
2
5
4
9
6
1
7
9
5
7
1
8
6
2
4
3
4
1
6
7
3
2
9
8
5
1
7
5
9
2
4
8
3
6
2
6
8
3
7
1
4
5
9
3
9
4
6
5
8
7
2
1
Figure-3. Output of the VBA Sub. Possibility-Strings, shown in italic-bold-underline format, in each empty cell of the
Puzzle, along with filled-in cells as already given, for the Puzzle of Figure-1.
14567
1456
1467
14
1347
1347
145
1247
1235
145
124
1347
14
1249
12
14
134679
1579
156
179
34679
3579
34567
1567
1569
1679
1568
2679
579
567
34567
4569
34679
2579
56
279
234679
13
789
3789
37
3468
48
48
368
35
46
468
79
16789
79
167
193
IIMA/CISG0104TEC
You may find the following VBA functions useful in understanding the listing and filling in the blanks :
1.
InStr(string1, string2). Searches for the position at which string1 occurs in string2, which is assumed to be
longer than string1. If the first string occurs within the second, the starting position of its first occurrence is
returned; otherwise zero is returned.
2. Str(integer). Returns the string form of integer, with a leading space
3. Trim(String). Removes all spaces from string, leading as well as trailing.
4. Repace (string1,string2,string3). Replaces the first occurrence of string2 within string1, by string3. If
string2 is not a substring of string1, then no replacement occurs.
5. Int(number). Greatest integer less than or equal to number ( also called floor function)
VBA Listing.
Sub Sudoku()
'-------------------------------------------------------------' Pzl.......a 9x9 range containing the puzzle
' Soln......a 9x9 range in which the solution to puzzle is obtained
as output
' P ........Reference for Range("Pzl")
' S ........Reference for Range"Soln")
' A ........9x9 array working space for holding the puzzle and
intermediate results
' Digit ....A digit in a cell
' i,,j ......Counters for FOR--Next Loops
'-------------------------------------------------------------Dim P As Range, S As Range
Set P = Range("Pzl")
Set S = Range("Soln")
Dim Digit As Integer
Dim A(1 To 9, 1 To 9) As String
Dim i As Integer, j As Integer
Pzl contains numeric digis in some cells
' copy range Pzl into Array A after converting
' the given digits into characters in the filled-in cells
' and filling each empty cell with the string "123456789"
For i = 1 To 9
For j = 1 To 9
Digit = _______________________________________
If Digit > 0 Then
A(i, j) = __________________'Convert Digit to string and remove
leading spaces if any
Else
A(i, j) = ___________________
End If
Next j
Next i
194
'
'
'
IIMA/CISG0104TEC
For i = 1 To 9
For j = 1 To 9
If ______________________ Then
' Attempt to reduce the possiblity-string of (i,j)th element
Call _______________
'
Call __________________'
End If
Next j
Next i
End Sub
195
IIMA/CISG0104TEC
End Sub
196
IIMA/CISG0104TEC
197
IIMA/CISG0104TEC
=
=
=
=
_______________________
ru - 2
________________________
cu - 2
For i = rl To ru
For j = cl To cu
If Len(A(row, col)) = 1 Then Exit For
If ___________________________________ Then
If (InStr(A(row, col), A(i, j)) > 0) Then
'The digit contained in A(i,j) is repeating in the possibility string of A(row,col)
'Eliminate it from A(row,col) by replacing it with null
A(row, col) = ______________________________________
End If
198
IIMA/CISG0104TEC
End If
Next j
Next i
End Sub
1
2
3
4
5
6
7
8
9
10
11
12
F
1
2
3
4
5
5
4
3
2
1
Suppose there is a named vertical range in a spreadsheet. An array function called Vrotate is written in VBA
such that it outputs in a highlighted range the contents of the above range after rotating MT through one of
three types of rotations: Type-1 rotation means rotation by 90 degrees clockwise, type-2 means rotation by
180 degrees clockwise, and type-3 means rotation by 270 degrees clockwise. The function is to be provided
with the two arguments, name of the input range and the type of rotation. For type-1 or type-3 rotation, a
suitable horizontal output range is to be highlighted by the user, and for type-2, a vertical output range is to
be highlighted, and then the formula = Vrotate with appropriate arguments is to be typed in, followed by
control+shift+enter. For example in the above spreadsheet F1:F5 contains a five-element input vector named
as MT. The range G6:K6 consists of the formula=Vrotate(MT,1), the range F7:F11 the formula
Vrotate(MT,2), and A6:E6 the formula =Vrotate(MT,3).
The VBA listing of function Vrotate is given below. Fill in the blanks
IIMA/CISG0104TEC
2. For the same combinations as bove, present the data on sum of the number of units sold, and on average
unit price.
3. Is it possible for you to break the year-wise data in the above analysis into quarter-wise data?
S.No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
OutletCode
4
4
2
2
5
2
3
1
3
5
5
1
4
2
1
5
4
2
2
3
4
4
1
2
2
1
1
2
5
5
3
5
1
3
3
5
4
Year
2010
2009
2008
2010
2010
2009
2008
2008
2010
2009
2008
2009
2008
2008
2010
2010
2010
2009
2010
2010
2008
2008
2009
2010
2008
2008
2008
2009
2009
2010
2008
2008
2009
2010
2009
2010
2008
S.No.
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
OutletCode
1
1
3
2
4
3
5
3
5
2
4
5
4
2
5
1
4
3
5
1
3
4
1
1
1
3
1
5
3
5
2
4
2
4
4
5
5
4
1
3
4
1
3
IIMA/CISG0104TEC
Year
2010
2009
2009
2010
2010
2010
2009
2008
2008
2008
2008
2009
2009
2008
2009
2010
2009
2009
2010
2010
2009
2010
2010
2009
2008
2008
2008
2010
2009
2008
2009
2010
2010
2009
2010
2008
2010
2008
2009
2009
2009
2010
2009
S.No.
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
OutletCode
1
2
3
5
1
2
3
1
3
2
2
4
2
1
2
3
1
2
4
4
5
2
3
3
4
5
5
5
3
5
3
4
2
4
1
2
4
3
5
1
IIMA/CISG0104TEC
Year
2008
2009
2010
2010
2010
2008
2008
2008
2010
2008
2009
2009
2009
2010
2008
2010
2009
2010
2009
2010
2008
2009
2008
2008
2008
2009
2009
2008
2008
2008
2010
2008
2010
2009
2009
2010
2010
2009
2009
2008
202
IIMA/CISG0104TEC
8
14
20
21
2
1
7
13
19
25
24
5
6
12
18
17
23
4
10
11
203
IIMA/CISG0104TEC
Option Explicit
Option Base 1
Function MgSq()
'--------------------------------------------------------------------------' Array function that outputs an odd order Magic Square
' in the highlighted range from which the function is called
' The highlighted area should have equal number of rows and columns and
' the number of rows and columns should be odd
' No error checking is done
' M ............Matrix to be filled in; set to range "MagicSquare"
' r ..............number of rows = number of columns in the magic square
' n .............total number of elements in the magic square= r*r
' i and j.......the row and column number for the element to be filled in
' ni and nj...possible row and column for next element to be filled in
' k ............. the next value to be filled in
'--------------------------------------------------------------------------Dim r As Integer
r = _______________________
Dim M() As Integer
ReDim ______________________________
Dim n As Integer, k As Integer
Dim i As Integer, j As Integer, ni As Integer, nj As Integer
For i = 1 To r
For j = 1 To r
M(i, j) = 0 ' Initialize M
Next j
Next i
n=r*r
i=1
j = _________________________
' Put 1 in the topmost row, middle column
M(i, j) = 1
For k = 2 To n
ni = (i - 1)
If ____________________ Then
ni = ________________________
End If
nj = (j - 1)
If _____________________ Then
nj = _____________________
End If
IF _______________________ THEN
____________________
____________________
ELSE
______________________________
End If
M(i, j) = k
Next k
______________________________
End Function
204
IIMA/CISG0104TEC
B. SUB MagicSum.
A SUB called MagicSum verifies the output generated by the function MgSq as follows.
The SUB is invoked by highlighting the output generated by the above function and then clicking a
command button associated with the SUB.
Let r be the number of rows and s be the number of columns of the highlighted range.
The SUB does the following:
1. If the number of rows is not equal to the number of columns, the SUB writes the message
Non-Square in the first column, one row above the highlighted range; then it stops.
2. It computes the sum of cells in the forward diagonal ( the diagonal running from the southwest corner to northeast corner) of the highlighted range. The sum is written in the column
following the last column of the range and in the row above the first row.
3. It computes the sum of the cells in the backward diagonal, and writes it in the column
following the last column of the range, and in the row following the last row.
4. It computes for each row, the sum of the cells in the row, and writes it in the same row, in
the column following the last column.
5. It computes for each column, the sum of the cells in the column, and writes it in the same
column, in the row following the last row.
If any of the sums in steps 2,3,4,5 is not equal to what the sum should be in a magic square of the
corresponding dimensions, then the output is preceded by ** in the same cell.
As an illustration, shown below is the output generated by the above SUB when it is invoked after
highlighting the 5x5 rage whose entries are in bold font.
15
16
22
3
9
65
8
1
14
6
20 13
21 19
2 25
65 **64
24
5
6
12
18
65
17
23
4
10
11
65
65
65
**64
65
65
65
65
IIMA/CISG0104TEC
IIMA/CISG0104TEC
Next i
'..find each column sum
For j = 1 To r
sum = 0
For i = 1 To r
sum = sum + ____________________________
Next i
_________________________________ = sum
If sum <> csum Then
______________________________ = "**" & sum
End If
Next j
End Sub
Option Explicit
Option Base 1
IIMA/CISG0104TEC
ReDim result(______________________________ )
For j = _____________________
result(____________) = _______________________________________
Next j
End Select
____________________________________________
End Function
208
IIMA/CISG0104TEC
For the above data , application of the forward pass algorithm yields the minimum possible project duration
as 230 time units. It can also be verified that the EST and EFT for the activities would be:
IIMA/CISG0104TEC
210
IIMA/CISG0104TEC
CalendarDate
EclipseType
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2011 Jan 04
2011 Jun 01
2011 Jul 01
2011 Nov 25
2012 May 20
2012 Nov 13
2013 May 10
2013 Nov 03
2014 Apr 29
2014 Oct 23
2015 Mar 20
2015 Sep 13
2016 Mar 09
2016 Sep 01
2017 Feb 26
2017 Aug 21
2018 Feb 15
2018 Jul 13
2018 Aug 11
2019 Jan 06
2019 Jul 02
2019 Dec 26
2020 Jun 21
2020 Dec 14
Partial
Partial
Partial
Partial
Annular
Total
Annular
Hybrid
Annular
Partial
Total
Partial
Total
Annular
Annular
Total
Partial
Partial
Partial
Partial
Total
Annular
Annular
Total
C
Eclipse
Magnitude
0.858
0.601
0.097
0.905
0.944
1.05
0.954
1.016
0.987
0.811
1.045
0.788
1.045
0.974
0.992
1.031
0.599
0.336
0.737
0.715
1.046
0.97
0.994
1.025
Duration
Visibility
Year
Month
Day
DurMin
DurSec
TotSec
Ndate
05m46s
04m02s
06m03s
01m40s
05m01s
02m47s
04m09s
03m06s
00m44s
02m40s
04m33s
03m39s
00m38s
02m10s
EUR,ASA,AFR
ASA,NAM,ARC
INO
AFR,ANT,AUS
ASA,PCF,NAM,ASA,PCF,NAM
AUS,PCF,SAM,PCF
AUS,PCF
NAM,SAM,EUR,AFR,ATL
INO,AUS,ANT
PCF,NAM
ARC,EUR,AFR,ASA,ATL
AFR,INO,ANT
ASA,AUS,PCF,INO
AFR,INO,ATL
SAM,ATL,AFR,ANT
NAM,SAM,ATL,AFR,ANT
ANT,SAM
AUS
EUR,ASA
ASA,PCF
PCF,SAM
ASA,AUS
AFR,EUR,ASA
PCF,SAM,ANT
2011
2011
2011
2011
2012
2012
2013
2013
2014
2014
2015
2015
2016
2016
2017
2017
2018
2018
2018
2019
2019
2019
2020
2020
1
6
7
11
5
11
5
11
4
10
3
9
3
9
2
8
2
7
8
1
7
12
6
12
4
1
1
5
20
3
10
3
9
3
20
3
9
1
6
21
15
13
11
6
2
26
21
14
5
4
6
1
5
2
4
3
0
2
4
3
0
2
46
2
3
40
1
47
9
6
44
40
33
39
38
10
346
242
363
100
167
249
186
44
160
273
219
38
130
04/01/2011
01/06/2011
01/07/2011
05/11/2011
30/04/2012
03/11/2012
30/04/2013
03/11/2013
09/04/2014
03/10/2014
28/02/2015
03/09/2015
09/03/2016
01/09/2016
06/02/2017
21/08/2017
15/02/2018
13/07/2018
11/08/2018
06/01/2019
02/07/2019
26/12/2019
21/06/2020
14/12/2020
M
Elapsed
Days
168
316
346
473
650
837
178
365
522
699
847
187
375
176
334
530
178
326
355
503
680
177
355
531
N
Month
Names
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
211
IIMA/CISG0104TEC
Inspired by the excitement created by a recent total solar eclipse, Mr. XYZ wanted to start a new business in the
domain of eclipse tourism. As a preliminary step in developing his business plan, he wanted to analyze the data on
solar eclipses that are predicted to occur during the decade 2011-2020. He downloaded the corresponding data from
the website of NASA ( http://eclipse.gsfc.nasa.gov/SEdecade/SEdecade2011.html) into the range A1:E25 of an
EXCEL sheet, which is shown above ( see Figure-1). The above range shows data on 24 eclipses, each row for one
eclipse, the total number of fields for each row being 5. Each field is precisely defined by NASA, and for the current
purpose you need not understand those definitions. Further, some data in the fields is changed and edited to simplify
our questions. The following table ( see Figure-2) describes each field of the above data:
Figure-2. Format of the input fields in Figure-1.
In the range F1:M25 of figure-1, the data imported from NASA site is recast in a form suitable for computations.
Figure-3 describes how each of the derived fields has been obtained along with their formats.
FieldName
CalendarDate
Format
Text string. Four characters for the year number, followed by a space, followed by three
characters for month name, followed by a space, followed by two characters for the day of the
month.
EclipseType
Text string. The four types of solar eclipses are Partial, Total, Annular, Hybrid.
EclipseMagnitude Number. The number is usually a positive fraction; for some eclipses, it can even be slightly
greater than one.
Duration
Text string. For Partial eclipse type, duration is not defined; hence the value of this field for a
partial eclipse is shown as a dash, -. For others, the string consists of two characters for
minutes, followed by m , followed by two characters for seconds, followed by s.
Visibility
Gives a list of regions in which the eclipse is visible, the successive regions in the list being
separated by a comma. For this purpose the whole surface of earth is divided into eleven zones,
each denoted by a unique three character code.
212
IIMA/CISG0104TEC
Format
Number
Number
H2:H25
I2:I25
Number
A dash,-, or a number
(whichever is applicable)
J2:J25
A dash,-, or a number,
whichever is applicable
K2:K25 A dash,-, or a number,
whichever is applicable
L2:L25
A number, formatted as a
date in the dd/mm/yyyy
format
M2:M25 A number
Explanation
Year of the eclipse in the corresponding row
Month of the eclipse in the corresponding row; 1 for Jan, 2 for Feb, 3
for Mar etc. The month names Jan,Feb,MarDec are given in
N2:N13 of the spreadsheet
Day of the month for the eclipse of the corresponding row
Minutes part of the duration; if the eclipse type is Partial, the value is a
dash.
Seconds part of the duration; if the eclipse type is Partial, the value is a
dash.
The duration is expressed in seconds; for Partial eclipse, the value is a
dash.
The same as the CalendarDate field, except that here the data is a number
shown in the date format dd/mm/yyyy.
The elapsed time in days since the immediately previous Total solar
eclipse; for the very first eclipse, that is the one in row-2, the elapsed time is
given to be 168 days
Question 1. In the 8 ranges(except the last ) listed in figure-3, a formula is given in the first cell of each range and
copied to the other cells of the range, to obtain the values shown in Figure-1. In the range M2:M25 the first cell is
filled with value 168, and a formula is given in M3, which is copied to the cells below.
Fill in the following table.
Question
Cell
1.1
F2
1.2
G2
1.3
H2
1.4
I2
1.5
J2
1.6
K2
1.7
L2
1.8
M3
Formula in the Cell ( which is copied to the other cells below in the range)
213
IIMA/CISG0104TEC
Figure-4. Range A27:F32 with some analysis of the Eclipse Data of Figures 1 and 3.
A
B
27 MeanIntvlTotl:
28 Type
MeanDurn(Sec)
29
30 Annular
199.3333333
31 Total
203.5
32 Hybrid
100
C
D
E
633.333
EclipseType
Type
MaxDurn(sec) Annular
363
Annular
363
Total
273
Hybrid
100
F
MaxSec
363
In range A27:F32 (see Figure-4) of the same spreadsheet as in all the other questions, further analysis of the data of
Figure 1 is performed.
Question 2.1. In Cell C27 is computed the mean interval in days between successive total solar eclipses of the above
decade through a formula. What is the formula in cell C27 (no criterion range nor a database function is to be used)?
Answer: _________________________________________________________
Question 2.2. A30:B32 tabulates the mean duration in seconds of the three types of eclipses Annular, Total, and
Hybrid, by a formula in B30, which is copied to B31:B32 (No criterion range nor the data table feature is involved in
this process). What is the formula in B30?
Answer:___________________________________________________________
Question 2.3: Using the criterion range E27:E28, and using the data table feature, the maximum duration of each
type of eclipses, Annular, Total, and Hybrid, is tabulated in D30:D32. The formula in D29 is =F28, and the table
range is C29:D32. What is the formula in F28?
Answer________________________________________________________________
214
IIMA/CISG0104TEC
A data table is shown in Figure-5 above in the range H30:I41. This data table tabulates for each of the eleven regions
the number of solar eclipses visible (out of the twenty four listed in the input). This table is obtained by data filtering
using the criterion range I27:I28 and a DCOUNT formula. The column input cell is H28.
Question 3.1. What is the formula in cell I28?
Answer:_________________________________________________________
215
IIMA/CISG0104TEC
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Date
01/05/2008
01/06/2008
01/07/2008
01/08/2008
01/09/2008
01/10/2008
01/11/2008
01/12/2008
01/01/2009
01/02/2009
01/03/2009
01/04/2009
Season
S
R
W
Meter
Units
1020711
250
1021361
650
1021961
600
1022261
300
1022461
200
1022611
150
1022766
155
1022906
140
1023006
100
1023126
120
1023226
100
1023366
140
MonthList
May,June
August,September
December,January
LB
0
51
201
Rs/Unt
2.5
3
4
K
Chrgat
LB
0
128
579
Uchrg FChrg
775
250
2375
650
2175
600
975
300
575
200
425
150
440
155
395
140
275
100
335
120
275
100
395
140
Data Table
1250
S
1250
R
350
W
220
Gduty
205
605
555
255
155
115
119
107
75
91
75
107
TChrg
1245
3645
3345
1545
945
705
729
657
465
561
465
657
Unts/D
8.3333
20.968
20
9.6774
6.4516
5
5
4.6667
3.2258
3.871
3.5714
4.5161
61
61
61
62
6990
6990
1650
1026
20.492
20.492
5.7377
3.5484
SlabTable
Mnth
4
5
6
7
8
9
10
11
12
1
2
3
S
XMnth
FALSE
Nday
s
30
31
30
31
31
30
31
30
31
31
28
31
SlbN
o
3
3
3
3
2
2
2
2
2
2
2
2
Mno
1
2
3
4
5
6
7
8
9
10
11
12
3495
3495
825
513
Name
January
February
March
April
May
June
July
August
September
October
November
December
114.6
114.6
27.05
16.55
216
IIMA/CISG0104TEC
The spreadsheet given in this question shows the data on the electricity consumption in twelve
consecutive months of Mr. ABC, and computations related to the electricity charges for each of
the above months, and analysis related to the electricity consumption in various seasons. Assume
that the windows date format set through control panel is dd/mm/yyyy.
The main input is in B9:C20. In this range, the following input is given:
Column B: For each of the twelve months, the date of the first day of the month,
Column C: the electricity meter reading noted at the beginning (say at 00:00 hrs mid-night!) of the
corresponding date given in column B. The meter reading is an integer.
The date and meter reading for the reading immediately preceding the above twelve readings are
given in B6 and C6 respectively.
Using the above data, the total charge for the electricity consumed by ABC is to be computed in
each of the twelve months. The total electricity charge consists of four components:
1. Uchrg (H9:H20): A variable component based on the number of units consumed in the month
(Units). An incremental slab system is used to compute this charge, the rate for the first 50 units
(ie from zero to 50, including 50) being Rs. 2.5 per unit, the rate for next 150 units ( ie from 51 to
200, including 51 and 200) being Rs. 3 per unit, and the rate for further consumption (ie for units
greater than or equal to 201) being Rs 4 per unit.
The lower bounds of each of the above three slabs, the per unit charge, and the Uchrg at the lower
bound of each of the intervals are shown in I2:K4.
While the entry in K2 is 0, that in K3 is obtained by a formula, and the formula is copied to K4 to
obtain the value in K4.
2. FChrg (I9:I20). A variable component indicating the fuel charge, which equals the fuel charge
per unit, whose value is given in cell D2, multiplied by the number of units consumed in the
corresponding month (Units). The Units in each month are computed in D9:D20.
3. Gduty (J9:J20). Government duty, which is a certain percentage (specified in D3), levied on
the sum of the above two charges.
4. Monthly meter rent (given in D4), and other fixed charges per month (given in D5).
5. TChrg(K9:K20). Total of all the above four components.
To facilitate the above computations, the calendar month number (Mnth)for which the charges
are computed, and the number of days in the month(Ndays), for each of the above twelve months
are also computed in E9:E20, and F9:F20 respectively. The number of the slab (SlbNo) to be
applied in computing
Uchrg is computed in G9:G20.
Further, after computing the total electricity charge in each month, the average number of units
consumed per day in the month (Unts/D) is also computed, and shown in L9:L20.
217
IIMA/CISG0104TEC
In the following table we give a list of cells referred above; for each cell write the formula
contained in the cell.
Cell
Cell formula
to be copied
to
K3
K4
D9
none
D10
D11:D20
E9
E10:E20
F9
none
F10
F11:F20
G9
G10:G20
H9
H10:H20
I9
I10:I20
J9
J10:J20
K9
K10:K20
L9
L10:L20
Cell formula
218
IIMA/CISG0104TEC
The data is further analyzed season-wise. For this purpose, a list of seasons and the months
corresponding to the seasons is developed. It is assumed that a season can have more than one
month, in which case the month names are given one after the other separated by commas. This
data is given in the range B22:C24, the first column showing the season names, and the second
the list of months in each season. A data table is developed in H22:N25 to tabulate for each
season the following:
1. the total number of units consumed in the season( I23:I25)
2. the total number of days in the season (J23:J25)
3. the total electricity charge incurred in the season (K23:K25)
4. the average number of units consumed per day in the sason (L23:L25)
5. average charge per calendar month in the season (M23:M25)
6. the average charge per day in the season (N23:N25)
To help do the above analysis, the number and name of each calendar month are given in range
N9:O20.A criterion range is developed in E23:E24. For the data table H22:N25, the column input
cell is E22.
In the following table, for each cell listed, write the cell formula. For E24, a formula with blanks
is already given; for this case, fill the blanks in the formula.
Cell
Cell formula
=_________________(FIND(VLOOKUP(________________________________________),
E24
VLOOKUP(__________________________________________________________),1))
I22
J22
K22
L22
M22
N22
219
IIMA/CISG0104TEC
Checkout
RmType
Charge from
Charge to
L M
S.No.
Checkin
3
4
5
6
7
8
9
10
11
12
1
2
ND
BChrg
0.25
0.1
K
TChrg
N
P
4000
6000
5000
7000
8000
10000
3000
4000
6
7
8
9
10
11
12
13
14
15
>4
16
17
There are four categories of rooms: Premium(P), Luxury(L), Royal (R), and Budget(B); each
room has two modes of occupancy, Single (S), and Double(D). The base tariff depends on the
combination of room category and occupancy mode; the base tariffs in Rs per day are given in
220
IIMA/CISG0104TEC
the range N2:P5 for each of the above combinations; column-O of the above range consists of
tariff for S and column-P for D.
There are additional charges over the base tariff:
1) if an extra bed (E) is put in the room to accommodate a child, there is an extra charge of
25%, given as a parameter in I1, over the base tariff;
2) if the room is facing the hotel garden (G), then the extra charge over base tariff is 10%,
which is given as a parameter in J1.
The above features that apply to each of the ten sample guests is given as a string in the
corresponding rows of D3:D12; this string begins with a character indicating the room category;
then followed by some or all of the following, whichever is/are applicable: D (for double
occupancy), E (for extra bed), and G (for garden facing), in any order. For example if the string
is BDG or BGD, then it means the room category is Budget, the occupancy mode is Double, and
it is Garden facing; since E does not appear, no extra bed was used. Similarly, PGE or PEG
means, Premium room, Garden facing, using an Extra bed, and occupancy mode is single,
because D is missing.
Furthermore, the duration of stay is computed using the rule that the allowed check-in and
allowed check-out times are 12:00 PM, ie 12:00 noon; and, one noon to the next noon is
considered as one day for purposes of charging. If the actual check-in happens before noon, it is
considered to have happened at 12:00 noon on the previous day, and if the actual check-out
happens after 12:00 noon, it is considered to have happened at 12:00 noon next day. For example,
if a person checks in at 10:30 AM on 1 July 2011, and checks out at 4:00 PM on 2 July 2011, then
the check-in is considered to have happened at 12:00 noon on 30 June 2011 and check-out at
12:00 noon on 3 July 2011, and the guest will be therefore charged for three days.
1. A formula is entered in E3 and copied to E4:E12, to compute the date and time from which
each of the corresponding guests has to be charged. What is the formula in E3?
______________________________________________________________________________
2. A formula is entered in F3 and copied to F4:F12, to compute the date and time up to which
each of the corresponding guests has to be charged. What is the formula in F3?
_____________________________________________________________________________
3. What is the formula in G3, copied to G4:G12, which computes the number of days for which
each of the guests is charged?
______________________________________________________________________________
4. A formula is entered in H3, and copied to H4:H12, to compute the total base charge, in Rs,
applicable to each of the guests for the number of days computed in G3:G12. What is the formula
in H3?
______________________________________________________________________
5. A formula is entered in I3, and copied to I4:I12, to compute the extra charges , in Rs, due to
extra bed (if any) for each of the guests, over the amount computed in H3:H12. What is the
formula in I3?
_________________________________________________________________________
221
IIMA/CISG0104TEC
6. A formula is entered in J3, and copied to J4:J12, to compute the extra charges, in Rs, due to
the fact the room is facing the garden (if any) for each of the guests, over the amount computed in
H3:H12. What is the formula in J3?
______________________________________________________________________________
7. A formula is entered in K3, and copied to K4:K12, to compute the total of all the charges
computed in the corresponding rows of H3:J12, for each guest. What is the formula in K3?
___________________________________________________________________________
8. Out of the above ten guests, how many have been charged for E, G, P,L,R, S? This data has
been tabulated in N11:O16, through the Data Table feature, using the criterion range defined in
Q7:Q8; for the data table, the column input cell is Q6.
8a. What is the formula in Q8?
______________________________________________________________________________
8b. What is the formula in O10?
______________________________________________________________________________
9. Out of the above ten guests, how many have checked in on a Sunday (ie day no. 1), how many
on Monday,, how many on Saturday? This data has been tabulated in Q11:R17 through the
data table feature, using the criterion range defined in R7:R8; for the data table, the column input
cell is R6.
9a. What is the formula in R8?
___________________________________________________________________________
9b. What is the formula in R10?
_____________________________________________________________________________
10. The duration of stay for each of the ten cases is summarized by tabulating how many guests
had a duration of 1 day, how many 2 days, how many 3 days, how many four days, and how many
greater than four days, in U11:U15, using COUNTIF. What is the formula in U11 copied to
U12:U15?
_____________________________________________________________________________
IIMA/CISG0104TEC
The following pseudo-code specifies a greedy heuristic to obtain a feasible solution (not
necessarily optimal) to the above problem:
Initialization:
Cost of assignment
0
No. of assignments made
0
While the number of assignments is less than n
Find the minimum cost value among all C( i , j)s, that is, find i min and j min such
that C(imin , j min) equals Min{C(i,j), i = 1,2,...,n; j = 1,2,...,n}
Assign Job j min to machine i min.
Change all costs of machine i min and of job j min to infinity;
that is, set C(imin , j ) to infinity for j = 1 ,2,..., n; and C( i , jmin ) to infinity for
i=1,2,...,n
No. of assignments made + 1
No. of assignments made
Cost of assignment
Cost of assignment +C( i min , j min)
End While
j2
j3
j4
j5
i1
11
12
18
40
19
i2
14
15
13
22
16
i3
11
17
19
23
25
i4
17
14
20
28
32
i5
15
22
15
Application of the above heuristic leads to the following assignments of(machine number, job
number):
(5,4), (1,1), (2,3), (4,2), (3,5) with the total cost of assignment
being 68.
We give below a VBA sub named GASSNMNT that uses the above heuristic to find a feasible
solution to a given assignment problem. Specifically, the input to the SUB is a cost matrix given
in the spreadsheet range named costrng. Each row of costrng corresponds to a machine and each
column to a job. The solution is written next to costrng by the SUB as follows: for each machine,
the number of the job assigned to it is written in the same row as the machines costs, in the
column just to the right of the costrng; for each job, the number of the machine assigned to it is
written in the same column as the jobs costs, one row below costrng. The total cost of assignment
is written in the row below and in the column to the right of costrng. Further, in costrng, the
colour of each assigned cells font is changed to red.
We show below the relevant portion of a spreadsheet to illustrate the input and output of the SUB.
223
IIMA/CISG0104TEC
11
12
18
40
19
14
15
13
22
16
11
17
19
23
25
17
14
20
28
32
15
22
15
68
In the sheet, A1:E5 is the range COSTRNG, consisting of the cost matrix of a 5x5 assignment
problem. The SUB writes its output in the row below the COSTRNG, that is, in row-6, and in the
column to the right of COSTRNG, that is, in column-F. For example in the input, c(2,3), that is
the cost of manufacturing job-3 on machine-2, is 13, which is the value in cell C2. In the output,
the value of cell F3 is 5, which means that the job assigned to machine-3 is job-5; the same
information is given in cell E6, whose value is 3, indicating that the machine on which job-5 is to
be manufactured is machine-3. The value of cell F6 is 68, indicating that the total cost of
assignments made by the heuristic for the above problem is 68.
Fill in the blanks in the SUB. The comments are correct and self explanatory.
224
IIMA/CISG0104TEC
Option Explicit
Option Base 1
Sub GASSNMNT()
'------------------------------------------------------------------------------'A greedy heuristic for the ASSIGNMENT problem.
'
'
Given a (n*n) range
'
each row, i, of which corresponds to a mchine, machine-I ,
'
and each column, j, of which corresponds to a job, job-j ,
'
each cell, cell (i,j), the cost of performing Job-j on Machine-i;
'
To assign the jobs to machines such that
'
a job is assigned to one and only one machine,
'
and a machine to one and only one job,
'
and the total cost of assignment is a minimum
'
'Heuristic Used:
' Repeat n times
'
Choose the row and column corresponding to min cost element, make the
assignment,
'
Update the total cost,
'
Make all costs in chosen row, and column, equal to infinity
' End Repeat
'
' Names of variables, ranges, and arrays:
'CMat ........The range consisting of the cost data
'Cost().......An internal square-array consisting of the cost matrix,
'N... ........No.of jobs, which is equal to no. of machines
'Infinity.....Numerical equivalent of infinity, which is max of all C(i,j) + 10
'MinVal.......Minimum value in the cost range
'MinCol.......The column number in which MinVal occurs
'MinRow.......The row number in which MinVal occurs
'i, j, k......Loop counters
'----------------------------------------------------------------------------------Dim
Dim
Dim
Dim
Dim
cmat As Range
n As Integer
i As Integer, j As Integer, k As Integer
TCost As Single, Infinity As Single
Minval As Single, MinCol As Integer, MinRow As Integer
ReDim _____________________________________
'***** Initialize Cost array, Clear red font if any, and set the value of
Infinity
Infinity = cmat(1, 1)
For i = 1 To n
For j = 1 To n
cost(i, j) = __________________________________________
cmat(i, j).Font.Color = RGB(0, 0, 0) 'Colour of font = black
If ___________________________ Then
Infinity = cost(i, j)
End If
Next j
225
IIMA/CISG0104TEC
Next i
Infinity = Infinity + 10
______________________ = 0
'**** Make n assignments,
For k = 1 To n
________________
__________________
__________________
'**** Scan each row
For i = 1 To n
**** Scan each column
For j = 1 To n
'*****
= Infinity
= 0
= 0
Next i
'****
Update TCost, and the output, and the colour of the assignment cell
TCost = _____________________________________
cmat(n + 1, MinCol) = MinRow
cmat(__________________________) = ____________________
cmat(_____________________________).Font.Color = RGB(256, 0, 0)
'**** Cross out the assigned column
For i = 1 To n
cost(_______________________) = Infinity
Next i
'**** Cross out the assigned row
For j = 1 To n
cost(__________________________________) = Infinity
Next j
Next k
cmat(____________________________) = __________________________
End Sub
226
IIMA/CISG0104TEC
V. Appendices
227
IIMA/CISG0104TEC
Formatting:
To change the width of the column of the cursor
To insert a row above the cursor
To insert a column to the left of the cursor
To delete one or more rows
To delete one or more columns
To change row height or column width
To change the font (font type, size, style, effects etc)
To change the alignment of an cell entry (horizontal,
vertical, inclined etc, text control like wrap around)
To change the color of the characters in a cell
To change the shading (or background) color of a cell
Conditional formatting
Date formatting
Time formatting
To change date settings in windows
Copy
Paste
Cut
Paste
Copy
Paste
File Operations:
To erase the current spreadsheet and display another
spreadsheet
Office icon
open
228
IIMA/CISG0104TEC
Function
Save As
Text to
Editing
Clear
Clear
Window
Freeze panes
advanced
Pivot table
229
IIMA/CISG0104TEC
Function
Others:
To add an add-in
To attach/ edit a comment in a cell
Use Solver
Scenario analysis
Goal seek
To Create a macro
To edit a macro
To associate a command button with a macro
To include form control buttons in quick access tool Microsoft Office Button Excel
Customize
All
bar
Options
Commands in the Choose
commands from list select all
(form control)
Add click
OK.
To perform VBA operations
To output a range to printer or disk file
To create a graph
To exit Excel system
230
IIMA/CISG0104TEC
Arrow keys
TAB
SHIFT+TAB
Move to the edge of the current data region (data region: A range of cells that contains data
and that is bounded by empty cells or worksheet borders.).
CTRL+arrow key
HOME
CTRL+HOME
Move to the last cell on the worksheet, in the bottom-most used row of the rightmost used
column.
CTRL+END
PAGE DOWN
PAGE UP
ALT+PAGE DOWN
ALT+PAGE UP
Switch to the next pane in a worksheet that has been split (Window menu, Split command).
F6
SHIFT+F6
While editing a cell address, to change a relative reference to absolute reference, for the
cell address immediately following the cursor (Four-way Toggle)
F4
Alt+F11
F2
CTRL+BACKSPACE
F5
SHIFT+F5
SHIFT+F4
TAB
231
IIMA/CISG0104TEC
Excel provides a number of trigonometric functions, which are not listed in the following table.
You will note that there are some functions which yield matrices (arrays) as their output. For
entering these functions in the formula box, choose the top-left cell of the range (or array) in
which the output has to appear, block the array, type in the formula and, instead of pressing the
Enter key press control, shft and enter keys together.
Function
Format
ABS
ABS(number)
EXP
EXP(number)
FACT
FACT(number)
INT
INT(number)
ROUND
ROUND(number, number
of places to be rounded to)
LN
LN(number)
MDETERM
MDETERM(array)
MINVERSE
MINVERSE(array)
MMULT
MMULT(array1,array2)
MOD
MOD(number, divisor)
PI
PI( )
RAND
RAND( )
SQRT
SQRT(number)
Explanation
Returns the absolute value of the argument
For example
=ABS(4.5) gives 4.5
=ABS(-4.5) gives 4.5
Returns e raised to the number
Returns the factorial of the number; if the
number is not an integer, it is truncated
Rounds the number down to the nearest
integer. For example,
=INT(13.67) gives 13
=INT(-13.67) gives -14
The given number is rounded to the given
number of places after the decimal point; if
the number of places to be rounded to is
negative, the rounding takes place to the left
of the decimal point, as shown in the second
example below:
=ROUND(1456.116,2) gives 1456.12
=ROUND(1456.116,-2) gives 1500
Returns the natural logarithm of the number
Returns the determinant of the matrix
contained in the square array specified
Returns the inverse of the matrix of the
given square array. This is an array
function.
Returns the matrix that is the product of the
matrix in array1 and that in array2. This is
an array function.
Returns the remainder obtained after
dividing the number with the divisor
Returns the value of the mathematical PI,
i.e., 3.14159
Returns a random number (generated from
uniform distribution) greater than or equal
to zero and less than 1; this is reevaluated
every time a recalculation takes place in the
worksheet. If you do not want the random
number to change press F9 after entering
the function in the formula box
Returns the positive square root of the given
number
232
IIMA/CISG0104TEC
SUM
SUM(range or array or
numbers)
SUMPRODUCT
SUMPRODUCT(array1,
array2,)
SUMIF
SUMIF(range1,criteria,
range2)
AVERAGEIF
AVERAGEIF(rangeif,crit
eria,range2)
COUNTIF
COUNTIF(range, criteria)
233
IIMA/CISG0104TEC
Statistical functions)
Arguments
AVERAGE,
AVERAGEA
Values or ranges or
arrays
CORREL
Array1, array2
COUNT,
COUNTA
Values or ranges or
arrays
FREQUENCY
MAX, MAXA
MIN, MINA
Values, ranges or
arrays
Values, ranges or
arrays
Values, range or
array
PERCENTILE
Array, k
PERCENTRANK
Array, x
MODE
234
RANK
STDEV,
STDEVA
STDEVP,
STDEVPA
IIMA/CISG0104TEC
Number, reference
range, order
Array
Array
VAR, VARA
Array
VARP, VARPA
Array
LARGE
SMALL
Array, k
Array, k
235
IIMA/CISG0104TEC
Text functions)
Within a text string, Character positions are counted from one onwards
The code number that corresponds to a character is given by ANSI character-set standards
Arguments
CHAR
Code number
CLEAN
Text
CODE
Text
CONCATENATE
Text1, text2,
DOLLAR
EXACT
Text1, text2
FIND
Find_text, within_text,
start_number
FIXED
LEFT
Text, number_of_characters
LEN
Text
LOWER
Text
MID
Text, start_number,
number_of_characters
PROPER
Text
REPT
Old_text, start_number,
no_of_characters, new_text
Text, number_of_times
RIGHT
Text, no_of_characters
SEARCH
Same as in FIND
SUBSTITUTE
Within_text,old_text,
new_text, instance_number
Value or reference
TEXT
TRIM
UPPER
VALUE
Value, format_text
Text
Text
Text
REPLACE
236
IIMA/CISG0104TEC
237
IIMA/CISG0104TEC
S.No.
1
Name of
Function
CHAR
2
3
CLEAN
CODE
4
5
6
7
CONCATENATE
DOLLAR
EXACT
FIND
FIXED
LEFT
10
LEN
11
12
LOWER
MID
13
14
15
16
PROPER
REPLACE
REPT
RIGHT
17
18
SEARCH
SUBSTITUTE
19
20
TEXT
21
TRIM
22
23
UPPER
VALUE
Example(s)
=CHAR(65)
=CHAR(48)
=CLEAN(CHAR(65)&CHAR(7))
=CODE("A")
=CODE("ABC")
=CONCATENATE("ABC","-","DEF")
=DOLLAR(13.45,2)
=EXACT("RAMA","rama")
=FIND("IN","INDIAN INSTITUTE OF MGMNT",4)
=FIND("X","INDIAN INSTITUTE OF MGMNT",4)
=FIXED(-2435.356,2,FALSE)
=FIXED(2435.668,2,TRUE)
=LEFT("ABCD")
=LEFT("ABCD",1)
=LEFT("ABCD",2)
=LEFT("ABCD",5)
=LEN("ABC")
=LEN("")
=LEN(CHAR(8))
=LOWER("ABC")
=MID("ABCD",2,1)
=MID("ABCD",1,2)
=MID("ABCD",2,4)
=PROPER("ind inst of mngmt")
=REPLACE("IndInstofMangmnt",4,4,"Institute")
=REPT("Inst",3)
=RIGHT("ABCD")
=RIGHT("ABCD",1)
=RIGHT("ABCD",2)
=RIGHT("ABCD",5)
=SEARCH("IN","Indian Institute",3)
=SUBSTITUTE("ABACADAE","A","X",3)
=SUBSTITUTE("ABACADAE","A","X",5)
=T("123")
=T(123)
=TEXT(123,"0.00")
=TEXT(123.12,"00")
=TEXT(-123.456,"0")
=TEXT(0.2,"0.00%")
=TEXT(123.45,"General")
=TRIM(" Ind Inst ")
=TRIM(" Ind Inst ")
=UPPER("abcd")
=VALUE("12.56")
=VALUE("1A")
Result
A
0
A
65
65
ABC-DEF
Rs13.45
FALSE
8
#VALUE!
-2,435.36
2435.67
A
A
AB
ABCD
3
0
1
abc
B
AB
BCD
Ind Inst Of Mngmt
IndInstituteofMangmnt
InstInstInst
D
D
CD
ABCD
8
ABACXDAE
ABACADAE
123
123.00
123
-123
20.00%
123.45
Ind Inst
Ind Inst
ABCD
12.56
#VALUE!
238
IIMA/CISG0104TEC
Char
!
"
#
$
%
&
'
(
)
*
+
,
.
/
0
1
2
3
4
5
6
7
86
V
131
87
W
132
88
X
133
89
Y
134
90
Z
135
91
[
136
92
\
137
93
]
138
94
^
139
95
_
140
96
`
141
97
a
142
98
b
143
99
c
144
100
d
145
146
147
148
149
150
239
IIMA/CISG0104TEC
In the serial number of a date, the serial number is counted from January 1, 1900; In the latest version
of Windows the last date permitted is Dec 31, 9999. The serial number of January 1, 1900 is given as
1. Serial number of time is a fraction and it indicates the fraction of the day that has elapsed from the
12.00 midnight of the day.
Name
DATE
Parameters
Year number, month
number, day number
DATEVALUE
Date text
DAY
Serial number
DAYS360
Start_date, end_date
EDATE
Start_date, month
EOMONTH
Start_date, number_of_
months
HOUR
Serial number
MINUTE
Serial number
MONTH
Serial number
NETWORKDAYS
Start_date, end_date
NOW
SECOND
Serial number
TIME
TIMEVALUE
TODAY
WEEKDAY
Serial number
WORKDAY
Start_date, days
YEAR
Serial number
YEARFRAC
Start_date, end_date
240
IIMA/CISG0104TEC
Function
Result
=DAY(E4)
11
2
3
=MONTH(E4)
=YEAR(D4)
=HOUR(F4)
18
=MINUTE(F4)
45
=SECOND(F4)
40
=WEEKDAY(E4)
=WEEKDAY(E4,2)
=DATE(1900,1,3)
10
=DATEVALUE("3/1/1900")
11
=DAYS360(DATEVALUE("1/1/190
1"),DATEVALUE("1/3/1902"))
12
=EDATE(B4,3)
20/10/2010
13
=EOMONTH(B4,3)
31/10/2010
14
=NETWORKDAYS(B6,B4)
15
=NETWORKDAYS(B6,B4,DATE(2
010,7,19))
1
1900
420
16
Function
=YEARFRAC(B4,B6)
IIMA/CISG0104TEC
Result
0.00833333
3
242
IIMA/CISG0104TEC
Database functions)
Each function in this category has three arguments: the reference to a database range including the
titles row, field number or title corresponding to the field or a cell address which contains the title
of the field on which the function has to operate, criteria range that specifies the condition for
selection of records from the database. If instead of a field number, the field title is given, then the
field title needs to enclosed in double quotes. Each function selects the records from the given
database according the criteria given in the criteria range and computes something using the
values in the specified field of the selected records. The functions SUMIF and COUNTIF, already
described in Appendix-2, are somewhat similar to (but not identical to) DCOUNT and DSUM.
Name
DAVERAGE
DCOUNT
DGET
DMAX
DMIN
DPRODUCT
DSTDEV
DSTDEVP
DSUM
DVAR
DVARP
243
IIMA/CISG0104TEC
In the following functions wherever, sorted order of values is required, assume that the sorted
order for the different characters and values in ascending order is -2,-1,0,1,2,3,,AZ,FALSE,TRUE. Capital case text and small case text are treated equivalent in matching.
Name of
function
Arguments
CHOOSE
Index_number,
value1,value2,
HLOOKUP
Lookup_value,
look_up_array,
row_index_number,
Range_lookup
(optional)
VLOOKUP
Lookup_value,
lookup_array,
column_index
number,
Range_lookup
(optional)
1. Array format:
Array, row_number,
column_number
INDEX
2. Reference format:
reference to one or a
list of arrays, row
number, column
number,
area_number
What it returns
From the given list of values, the value in the position
indicated by index_number. The Index number should
refer to a value between 1 and 29; the values in the list
could be constants, or references to cells or ranges.
Searches for the lookup_value in the top row of the
array, from the column containing the matching value,
returns the value in the row specified by the
row_index_number.
Range_lookup can be TRUE or FALSE. If it is omitted,
the default is TRUE. A TRUE value for Range_lookup
means an approximate match is acceptable. That is, the
values in the first row should be in the ascending order
from left to right, and the largest value less than or equal
to the look_up value is taken to be the matching value. If
the value of Range_lookup is FALSE, the values of the
first row need not be in the sorted order; the value that is
exactly equal to the lookup value is taken to be the
matching value. If there is no matching value an error
message is returned. While matching, lower and upper
case letters are not distinguished.
Same as above except that the search is done vertically
in the first column, and if a matching row is is found, the
result is returned from the column corresponding to the
column_index_number. The Range_lookup is TRUE or
FALSE and it works in a way similar to that in
HLOOKUP. If TRUE or omitted, an approximate match
is done in the lookup array; ie, the largest value less than
or equal to the lookup value is taken as the matching
value. In this case, the values in the first column of
lookup array should be in ascending order; If
Range_lookup is FALSE, the values in the first column
of lookup array need not necessarily be in ascending
order, and the value exactly equal to the lookup value is
taken as the matching value. Other rules are also similar
to those in HLOOKUP.
1. Array format: Returns the value at the intersection of
the specified column and row of the array, if the array is
two dimensional. If the array is one-dimensional, only
the column or row number, whichever is applicable, can
be given. If the number of column (or row) is given as
zero, an entire row(or column) is returned as array, in
which case the function needs to be typed in as an array
function.
2. Reference format: Returns only a reference of the cell
corresponding to the row and column numbers of the
244
Name of
function
LOOKUP
IIMA/CISG0104TEC
Arguments
Format 1 (Vector
format):
Lookup_value,
lookup_vector,
result_vector
Format-2 (array
format):
Lookup_value,
Array
MATCH
Lookup value,
lookup vector,
Match type (-1,0, or
1).
Match type is
optional.
OFFSET
Range or cell
reference, no of
rows, no of
columns, height,
width
INDIRECT
Reference text, a
logical value
What it returns
specified array, given through the area_number, in the
list of arrays given through the first parameter. The cell
reference output by this function is inturn used normally
by another function as an input parameter.
Vector format: Finds the position of the lookup_value in
the lookup_vector, and returns the value in the
corresponding position of the result_vector. The result
and lookup vaectors should be of the same length, but
they need not be of the same orientation: one can be a
row and the other a column. Lookup vector should have
values in ascending order.
Array format:
Case 1. The array has more columns than rows. The
matching value is searched for in the first row, and the
value in the corresponding position from the last row is
returned.
Case 2: The array has columns less than or equal to
rows. The matching value is searched for in the first
column, and the value in the corresponding position of
the last column is returned.
In both cases, the values in the first row (or column) are
assumed to be in increasing order, and an approximate
match is made like in other functions.
Relative position of the lookup value in the lookup
vector. If match type is -1, the matching value is taken to
be the smallest value greater than or equal to the lookup
value, and the vector is assumed to be sorted in
descending order. If the match type is 1 (which is the
default), the vector is assumed to be in the ascending
order, and the matching value is the largest value less
than or equal to the lookup value. If the match type is
zero, matching value is the value that is exactly equal to
the lookup value; in this case, the vector need not be
sorted.
Returns a range (or cell) reference, which is a specified
no of rows and columns away from the given reference
cell or the top-left cell of the given reference range; if
the returned reference is a range it will have the given
height and width. This function can be used as a
parameter that is a range within another function such as
SUM, AVERAGE, VLOOKUP , and LINEST. If the
number of rows is positive, you are saying that the
returned reference should be below the given reference,
and if it is negative, the returned reference is above the
given reference; similarly, positive number of columns
indicate an offset to right, and negative an offset to right.
The default height and width are the height and width of
the given reference. If OFFSET is used by itself, and not
as a parameter within another function, the result will be
the value of the returned reference.
The reference text is interpreted as a cell reference
which contains in turn another cell reference whos value
245
Name of
function
IIMA/CISG0104TEC
Arguments
indicating whether
the cell referred to
has A1 type
reference or
not(default is
TRUE)
What it returns
is needed.
For example suppose cell B1 has value 1 and cell C1 has
value 2. Further suppose cell A1 has the text B1, and A2
the text C1. Suppose in D1 you enter the function
=indirect(A1)+Indirect(A2). It will be interpreted as B1
+ C1 and therefore be evaluated as 1+2 and the result in
cell D1 would be 3.
As another example, consider using INDIRECT in a
spreadsheet with R1C1 cell referencing. Suppose using
Excel Options Formulas R1C1 reference style, you
have chosen R1C1 style in the spreadsheet. Suppose
cells R1C5 and R2C5 consist of the entries R1C7 and
R2C7 respectively. Suppose the cells R1C7 and R2C7
consist of the values 3 and 4 respectively. If in cell
R1C8
the
formula
=INDIRECT(R1C5,False)+INDIRECT(RC5) is entered,
it would yield the result 7.
246
IIMA/CISG0104TEC
2
3
4
5
6
10
15
30
100
150
1.5
15
5.9
2.5
25
4.8
4.8
48
2.5
5.9
59
1.5
The above figure shows the values in the range J2:N6 of a spreadsheet. The various Lookup functions are
illustrated below, with formulae that refer to the values of the above range.
S.No.
Formula
Result
=CHOOSE(3,L3,L4,L5,L6)
=CHOOSE(3,SUM(J3:J6),MAX(J4:J6),MIN(M3:M6))
1.5
=SUM(CHOOSE(2,J3:J6,K3:K6,M3:M6))
147
=INDEX(M3:M6,2)
4.8
=INDEX(J3:N3,3)
=INDEX(K3:M6,3,3)
2.5
=SUM(INDEX(K3:M6,0,3))
14.7
=MAX(INDEX(J3:K6,INT(INDEX(J3:J6,3)),0))
59
=INDEX(K3:K6,5)
#REF!
10
=INDEX((J3:J6,M3:M6,K3:K6),4,,2)
1.5
11
=MATCH(2.5,M3:M6,0)
12
=MATCH(4.95,J3:J6,0)
#N/A
IIMA/CISG0104TEC
S.No.
Formula
Result
13
=MATCH(4.95,J3:J6,1)
14
=MATCH(4.8,J3:J6,1)
15
=MATCH(10.5,J3:J6,1)
16
=MATCH(1.4,J3:J6,1)
#N/A
17
=MATCH(6.2,M3:M6,-1)
#N/A
18
=MATCH(5.9,M3:M6,-1)
19
=MATCH(4.81,M3:M6,-1)
20
IIMA/CISG0104TEC
Formula
=MATCH(2.4,M3:M6,-1)
Result
249
IIMA/CISG0104TEC
S.No.
Formula
Result
21
=MATCH(1.49,M3:M6,-1)
22
=MATCH(-5.5,M3:M6,-1)
23
=VLOOKUP("D",L3:N6,3,FALSE)
24
=VLOOKUP("D",L3:N6,2,FALSE)
1.5
25
=VLOOKUP(25.5,K3:N6,2,TRUE)
26
=VLOOKUP(100,K3:N6,2,TRUE)
27
=HLOOKUP(A,J3:N6,3,FALSE)
28
=HLOOKUP(25,J4:N6,2,FALSE)
48
IIMA/CISG0104TEC
S.No.
Formula
Result
29
=HLOOKUP(20,J2:N6,3,TRUE)
25
30
=HLOOKUP(175,J2:N6,3,TRUE)
31
=HLOOKUP(5,J2:N6,3,TRUE)
#N/A
32
=LOOKUP(2.7,J2:J6,N2:N6)
33
=LOOKUP(120,J2:N2,J6:N6)
1.5
34
=LOOKUP(60,K3:N6)
35
=LOOKUP(15.5,J2:N4)
25
36
=LOOKUP(3,J2:L6)
37
=OFFSET(K2,2,3)
38
=SUM(OFFSET(K2,2,2,3,1))
8.8
IIMA/CISG0104TEC
S.No.
Formula
Result
39
=OFFSET(J2,2,3)
4.8
40
=INDEX(OFFSET(K2,2,2,3,2),2,2)
252
IIMA/CISG0104TEC
Appendix-9: Some Excel functions whose inputs and/or outputs are arrays.
(Source: Microsoft Excel Help (F1) List of worksheet functions Math and trigonometry
functions)
S.No.
1.
2.
3.
4.
5.
6.
7.
8.
9.
Function
Explanation
Matrix multiplication of the two arrays
array1 and array2 in that order. The
MMULT(array1,array2)
dimensions of array1 and array2 should
be such that matrix multiplcation is
possible.
Inverse of the matrix specified by array.
MINVERSE(array)
It should be invertible.
Transpose of the matrix specified by
TRANSPOSE(array)
array.
Fits a regression using KnownYs and
KnownXs. Finds the projected Ys
corresponding to NewXs. If Const is
TREND(KnownYs,KnownXs,NewXs,Const)
TRUE the regression is estimated with a
constant; otherwise the constant is
assumed to be zero.
Fits a regression between KnownY's and
FORECAST(X,KnownYs,KnownXs)
KnownX's and finds the estimated vale
for X
Estimates a regression equation between
Y whose known values are given in a
vector KnownYs, and one or more
independent variables whose values are
given in a vector or matrix
KnownXs.Const and Stats are logical
constants, that is they should contain
LINEST(KnownYs,KnownXs,Const,Stats)
TRUE or FALSE values. If Const is
TRUE, the regression is estimated with
a constant; if Stats is TRUE all
regression statistics are prited. This is to
be entered as an array formula, in a
range of the follwing size: Number of
columns = no. of independent variables
+ 1; number of rows = 5.
For each pair of corresponding values in
SUMX2MY2(arrayX,arrayY)
array X and array Y, finds difference of
squares and sums the the differences.
For each pair of corresponding values in
SUMX2PY2(arrayX,arrayY)
array X and array Y, finds the sum of
squares, and sums the sum
For each pair of corresponding values in
SUMXMY2(arrayX,arrayY)
array X and array Y, finds the
difference, squares it and sums the result
253
IIMA/CISG0104TEC
Appendix-10: IS Functions
(Source: Microsoft Excel Help (F1) List of worksheet functions
Information functions)
All the following functions are concerned with checking whether the value in the specified cell is
of the given type. Each function returns TRUE or FALSE. The parameter of each can be a
specific vale or a reference to a cell
S.No.
Function
1.
ISBLANK(value)
2.
ISERR(value)
3.
ISERROR(value)
4.
ISLOGICAL(value)
5.
ISNA(value)
6.
ISNONTEXT(value)
6.
ISNUMBER(value)
7.
ISREF(value)
8.
ISTEXT(value)
Explanation
Is the given value, or the value in the given cell,
blank?
Is the given value or the value in the given cell an
error message except #N/A?
Is the given value or the value in the given cell any
error message including #N/A?
Is the given value or the value in the given cell a
logical value?
Is the given value or the value in the given cell the
error message #N/A?
Is the given value or the value in the given cell
anything other than text?
Is the given value or the value in the given cell a
number?
Is the given value or the value in the given cell a
reference?
Is the given value or the value in the given cell a
text?
254
IIMA/CISG0104TEC
S.No.
1.
2.
3.
4.
5.
6.
7.
8.
Error Code
######
#DIV/0!
#N/A!
#NAME!
#NULL!
#NUM!
#REF!
#VALUE!
Explanation
Negative date or time, or column not wide enough
Division of a number by zero
A value required is not available
Some text is not recognizable
The area of overlap between two ranges is null
Invalid numeric values
Invalid cell or range reference
Wrong type of operator or argument
255
IIMA/CISG0104TEC
Option
Max time
Explanation
Limit on the time taken by the solution process. The
computation will stop automatically if a solution is
not found within the maximum time limit.
Default
100
sec
Iterations
100
Precision
1.0E-6
Tolerance
Convergence
Assume linear
model
Assume nonnegative
Use autoscaling
Relevance
Relevant for all
types of
problems: LP,
mixed integer,
and non-linear
programs
Relevant for all
types of
problems
Relevant for all
types of
problems
0.05
Relevant for
mixed integer
programs.
0.0001
Relevant for
only non-linear
problems
256
IIMA/CISG0104TEC
S.No.
Option
Explanation
However an inverse operation is applied when the
final results are presented to the userso that the
results are in the original units.
If this option is chosen, the solver pauses at the end
of each iteration and displays the current solution on
the spreadsheet.
Method for estimating initial values of basic
variables
Show iteration
results
10
Estimates:
Tangent,
Quadratic
11
Derivatives:
Forward,
Central
12
Search:
Newton,
Conjugate
Default
Relevance
Relevant only
for non-linear
programs (ie
when using
GRG2)
Relevant only
for non-linear
programs (ie
when using
GRG2)
Relevant only
for non-linear
programs (ie
when using
GRG2)
257
IIMA/CISG0104TEC
Normal distribution)
There are two main functions, Normdist and Norminv, the first to find the value of cumulative
distribution function, given the value of a normal variate, and the second to find the value of a
normal variate, given the value of the cumulative distribution function. Normdist can also be
used to find the value of the probability density function for a given value of the variate, by
setting the value of the last parameter suitably. Although Normdist and Norminv can be used to
deal with a normal distribution with any given mean () and standard deviation ( ), ttwo special
functions Normsdist and Normsinv are provided to deal with the standard normal distribution ( ie
normal distribution with = 0, and = 1). The parameters associated with these functions are
described below:
1. Normdist ( x, , , CDF ): x is the value of the normal variate; is the mean of the normal
distribution; is the standard deviation of the normal distribution; CDF is a Boolean constant: if
TRUE or 1 is entered for CDF, it means you want the function to compute the value of the
cumulative distribution function at x; if FALSE, it means you want the function to compute the
value of the probability density function at x.
To further clarify,
Normdist ( x, , , TRUE ): given the value of a normal variate x following a normal distribution
with mean and standard deviation , to find the value of the cumulative distribution function at x ,
to find the probability that the random variable in question takes a value < = x
Normdist ( x, , , FALSE ): given the value of a normal variate x following a normal
distribution with mean and standard deviation , to find the value of the cumulative distribution
function at x , to find the probability density function at x, that is to find the y- coordinate of the
normal curve when the X-coordinate has value x.
2. Norminv ( p, , ): For the normal distribution with mean and standard deviation, find the
value x of the variate, such that the value of the cumulative distribution function at x is p; that is,
the probability of the normal variate taking a value less than or equal to x is p. p needs to be
between 0 and 1, otherwise an error will result.
3. Normsdist ( x, CDF ): For a standard normal distribution to compute the cumulative
distribution function or probability distribution function at x, depending on whether CDF is
TRUE or FALSE, more specifically,
Normsdist ( x, TRUE ): For the standard normal distribution, to find the value of the cumulative
distribution function at x
Normsdist ( x, FALSE ): For the standard normal distribution, to find the value of the probability
density function at x
Normsdist(x,CDF) is the same as Normdist(x,0,1,CDF)
4. Normsinv ( p ): For a the standard normal distribution, to find the value x of the the variate
such that the cumulative distribution has the given value p at x; p needs to be between 0 and 1,
otherwise an error will result.
258
IIMA/CISG0104TEC
Function
Normdist(3,0,1,TRUE)
Result
0.99865
Normdist(-3,0,1,TRUE)
0.00135
Normdist(0,0,1,TRUE)
0.5
Normdist(0,0,1,FALSE)
0.398942
Normdist(3,0,1,FALSE)
0.004432
Normdist(-3,0,1,FALSE)
0.004432
Normdist(12,10,2,TRUE)
0.841345
Normdist(14,10,2,TRUE)
0.97725
Norminv(0.99865,0,1)
2.9999977
10
Norminv(0.99865,10,2)
15.99995
11
Norminv(0.5,0,1)
-1.4e-16
12
Normsdist(0,True)
0.5
13
Normsinv(0.5)
259
IIMA/CISG0104TEC
260