EXCEL XP Intermediate

advertisement
Microsoft Excel - XP
Intermediate
§
§
§
§
§
§
§
§
Financial Functions
Goal Seeking
Variable Tables
IF Statements
AND & OR Functions
Mathematical Operations Between Separate Sheets
Mathematical Operations Between Separate Files
Solver (Linear Programming)
Table of Contents
SUPPORT FILES ...................................................................................................................................... 3
FINANCIAL FUNCTIONS...................................................................................................................... 1
Future Value (Fv) ................................................................................................................................... 1
FV Example 1: Single Payment.............................................................................................................. 2
FV Example 2: A Series of Payments.................................................................................................... 2
Present Value (PV)................................................................................................................................. 3
PV Example 1: A Single Payment/Deposit ............................................................................................. 4
Present Value Example 2: Using a custom formula ................................................................................. 4
PV Example 3: An Annuity.................................................................................................................... 4
Payments (PMT) .................................................................................................................................... 5
PMT Example 1: Using PV................................................................................................................... 5
PMT Example 2: Using FV................................................................................................................... 6
RATE......................................................................................................................................................... 6
Rate Example ......................................................................................................................................... 6
Internal Rate Of Return (IRR) ................................................................................................................. 7
Negative Cash Flow Note:...................................................................................................................... 7
IRR Example 1:...................................................................................................................................... 8
IRR Example 2:...................................................................................................................................... 8
Modified Internal Rate Of Return (MIRR)............................................................................................. 10
MIRR Example:.................................................................................................................................... 10
Net Present Value (NPV) ..................................................................................................................... 11
NPV Example 1: Initial Investment Begins One Year from Today........................................................... 12
NPV Example 2: Initial Investment Begins Today................................................................................... 12
NPV Example 3: Dealing with Negative Cash Flows.............................................................................. 12
ONE VARIABLE DATA TABLE............................................................................................................ 14
TWO VARIABLE DATA TABLE........................................................................................................... 14
One Variable Data Table Example:........................................................................................................ 15
Two Variable Data Table Example........................................................................................................ 16
GOAL SEEKING.................................................................................................................................... 18
IF STATEMENTS................................................................................................................................... 19
Allowable operators.............................................................................................................................. 20
Text in If Statements ............................................................................................................................. 20
Example 2: Nesting If Statements ......................................................................................................... 21
OR Conditions...................................................................................................................................... 22
AND Conditions................................................................................................................................... 23
USING MULTIPLE SHEETS.................................................................................................................. 24
Moving Between Sheets........................................................................................................................ 24
Renaming Sheets................................................................................................................................... 24
Inserting a Sheet ................................................................................................................................... 24
Deleting a Sheet.................................................................................................................................... 25
Moving a Sheet..................................................................................................................................... 25
Coping a Sheet ..................................................................................................................................... 25
Grouping Sheets ................................................................................................................................... 25
Mathematical Operations Between Sheets............................................................................................. 26
LINKING TO SEPARATE FILES .......................................................................................................... 27
Updating Links ..................................................................................................................................... 27
SOLVER ................................................................................................................................................. 28
Loading the Solver Add-In.................................................................................................................... 28
Solver Problem..................................................................................................................................... 29
Solver Solution:..................................................................................................................................... 29
The Reports.......................................................................................................................................... 33
SUPPORT FILES
Some of the examples in this handout utilized sample Excel worksheet data. The files can be downloaded
from the web at:
http://www.marshall.usc.edu/Web/Computing.cfm?doc_id=770#Excel
USC – Marshall School of Business
Academic Information Services – User Support
FINANCIAL FUNCTIONS
The time value of money can be divided into four basic components:
• Present Value:
What some amount in the future would be worth today.
• Future Value:
What an investment today will grow to become.
• Time:
The amount of time an investment is active.
• Rate:
The interest rate or cost of capital.
Rate
Present
Value
Future
Value
Time
Future Value (Fv)
The future value is the amount that a deposit/payment or a series of deposits/payments will grow to be over
time at a particular interest rate. For example, you deposit 100 dollars in a savings account today, what will it
have grown to in ten years? That amount is the future value.
The syntax for Excel’s FV function is as follows:
=FV(Rate,nperiods,payment,PV,type)
Rate:
This is the interest rate per period.
For example, at 9% annual interest, the monthly rate would be 9%/12 months.
nPeriods:
This is the total number of payment periods for an annuity.
For example, if you make monthly payments into a vacation club for 3 years, the number of
periods are 3 * 12 or 36 periods.
Payment:
(Optional) This is the payment amount made each period and cannot change over the life of
the annuity.
PV:
(Optional) Present Value is the reverse of FV. For example, how much money do you need
to deposit today if you want it to grow to 20K in 10 years? In the FV equation, if you are
only making one deposit rather then a series of deposits, then you would leave Payment out
and put in the single deposit amount for PV.
Type:
(Optional) Type is either: 1 or 0
0 or omitted means that payments are due at the end of each period.
1 means that payments are due at the beginning of each period.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 1
USC – Marshall School of Business
Academic Information Services – User Support
FV Example 1: Single Payment
You are going to put $100 dollars into a savings account and leave it there for 10 years. The annual interest
rate on the savings account is 6% compounded monthly.
How much will it have grown to be in 10 years?
=FV(Rate,nperiods,payment,PV,type)
Rate = 6%
nPeriods =
Payment =
PV =
10
0
-100
returns: $181.94
=FV(6%/12,10*12,0,-100,0)
Note:
And that:
=FV(6%/12,10*12,,100) is also acceptable.
=FV(6%,10,,100) = - $179.08
Note that PV is negative. Funds flowing away from you should be entered as a negative number.
FV Example 2: A Series of Payments
You are going to put an initial deposit of $1000 into a savings account and then $100 each month for ten
years. The annual interest rate is 6% compounded monthly. How much will you have at the end of 10 years?
=FV(Rate,nperiods,payment,PV,type)
Rate:
nperiods:
payment:
PV:
6%/12
10*12
-100
-1000
=FV(6%/12,10*12,-100,-1000)
Excel_XP_Intermediate.Doc
returns: $18,207.33
August 28, 2002
Page 2
USC – Marshall School of Business
Academic Information Services – User Support
Present Value (PV)
Returns the present value of an investment. The present value is the total amount that a series of future
payments is worth now. For example, the present value of $100 to be received ten years from now is about
$38 using a discount rate equal to 10% interest compounded annually. It is the reverse of the Future Value.
Another way to look at it is this: You want to have 100 dollars in a savings account by the end of the year.
How much do you have to put in at the beginning of the year so it will grow to $100 dollars by the end of the
year?
Excel provides a built in function for finding the Present Value of an annuity.
=PV(Rate,nPeriods,Payment,FV,type)
Rate:
This is the interest rate per period.
For example, if you borrow a car at 9% annual interest, the monthly rate would be 9%/12.
nPeriods:
This is the total number of payment periods for an annuity.
For example, if you take out a 3 year car loan, and make monthly payments, then the number
of periods are 3*12.
Payment:
(Optional) This is the payment amount made each period and cannot change over the life of
the annuity.
FV:
(Optional) FV is the future value, or what the amount will grow to.
Type:
(Optional) Type is either: 1 or 0
0 or omitted means that payments are due at the end of the period.
1 means that payments are due at the beginning of the period.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 3
USC – Marshall School of Business
Academic Information Services – User Support
PV Example 1: A Single Payment/Deposit
You need to make a deposit today that in 10 years will have grown to $100 dollars. The interest rate is 8%.
How much should you deposit?
Rate:
nPeriods:
Payment:
FV:
8%
10
0
100
=PV(8%,10,0,100)
($46.32)
returns:
Present Value Example 2: Using a custom formula
You don’t have to use Excel’s PV function; you could use the standard PV formula as well. The formula of a
single payment is as follows:
Using the same example as above, finding the present value using this
method would be constructed as follows:
= 100/(1+8%)^10
and would return:
PV = FV
(1 + Rate)
nPeriods
$46.32
PV Example 3: An Annuity
An annuity is a series of constant cash payments made over a continuous period. A car or house loan is an
example of an annuity
You are thinking of buying an insurance annuity that pays $500 at the end of every month for the next 20
years. You have no urgent need for the money and will deposit it into a savings account which earns 8%
interest.
The cost of the annuity is $60,000.
You want to determine if this would be a good investment.
Rate:
8%/12 (Payments are monthly.)
Number of periods: 20*12
(Payments are monthly.)
Payment Amount:
500
=PV(8%/12,12*20,500)
returns:
($59,777.15)
It would be a bad investment. This is because the annuity costs you $60,000 and after time is considered,
only returns $59,777.15.
Or in other words, $500 per month for 20 years at 8% interest would be the same as receiving $59,777.15 in
one lump sum today.
You are paying $60,000 in order to get $59,777.15
Excel_XP_Intermediate.Doc
August 28, 2002
Page 4
USC – Marshall School of Business
Academic Information Services – User Support
Payments (PMT)
The PMT function in Excel returns the periodic payment for an annuity based on constant payments and a
constant interest rate. For example, you can find out what your car payments would be for a given loan
amount, time, and interest rate.
=PMT(Rate,nPeriods,PV,FV,type)
Rate:
This is the interest rate per period.
For example, if you borrow a car at 9% annual interest, the monthly rate would be 9%/12.
nPeriods:
This is the total number of payment periods for an annuity.
For example, if you take out a 3 year car loan, and make monthly payments, then the number
of periods are 3*12.
PV:
(Optional) The Present Value is the total amount that a series of future payments is worth now
(the loan amount).
FV:
(Optional) The Future Value is the cash balance you want to attain after the last payment is
made. If FV is omitted, it is assumed to be 0. (The FV of a loan for example would be 0)
Type:
(Optional) Type is either: 1 or 0
0 or omitted means that payments are due at the end of the period.
1 means that payments are due at the beginning of the period.
Notes:
• FV and PV both have the word (optional) next to them but you must use one or the other or both in the
equation.
• To find the total amount paid over the duration of the annuity, multiply the returned PMT value by
nPeriods.
PMT Example 1: Using PV
You are planing to buy a new car. You are taking out a 3 year loan of $5,000 to help you pay for it and you
are borrowing at an interest rate of 8%.
What will the monthly loan payments be?
Rate:
nPeriods:
PV:
FV:
8% / 12 months per year
3years * 12 payments per year
$5,000
Doesn’t apply
=PMT(8%/12,3*12,5000)
Excel_XP_Intermediate.Doc
returns: ($156.68)
August 28, 2002
Page 5
USC – Marshall School of Business
Academic Information Services – User Support
PMT Example 2: Using FV
You would like to have $500,000 in your savings account by the time you retire. You have 30 years until
retirement and you have found a saving account which pays 6% interest.
How much do you have to deposit each month to reach your goal?
Rate:
nPeriods:
PV:
FV:
6% / 12 months
30 * 12 months
Doesn’t apply
500000
=PMT(6%/12,30*12,0,500000)
returns: ($
497.75)
RATE
Rate returns the interest rate per period of an annuity.
=RATE(nPeriods,PMT,PV,FV,type,guess)
Guess:
This is what you assume what the rate will be. If you omit guess, it is assumed to be 10%.
Rate Example
You are buying a new car and the salesperson tells you your monthly car payments will be $200 per month
and that the loan amount of $8,000 will be paid back over the next 4 years. What is the interest rate you are
being charged?
NPeriods:
PMT:
PV:
FV:
type:
4 * 12 months
- $200.00
$8,000
doesn’t apply
omitted or 0
(with Rate, you must make the PMT negative)
=RATE(4*12,-200,8000)
and
Excel_XP_Intermediate.Doc
0.77%*12
returns: 0.77% monthly
returns: 9.24% annually
August 28, 2002
Page 6
USC – Marshall School of Business
Academic Information Services – User Support
Internal Rate Of Return (IRR)
The internal rate of return (IRR) provides a measure of the average annual rate of return that a project will
provide. If the IRR exceeds the required return for a project, the project should be accepted.
It is the interest rate received for an investment consisting of payments (negative values) and income (positive
values) that occur at regular periods.
It finds the discount rate that equals the present value of future cash inflows to the investment cost.
•
•
The cash flows do not have to be even, as they would be for an annuity.
The project with the highest IRR is the most profitable considering time.
=IRR(values,
guess)
Values
Values is an array or a reference to cells that contain numbers for which you want to calculate the internal rate
of return. (b3:b10 for example)
•
•
•
Values must contain at least one positive value and one negative value to calculate the internal rate of
return.
IRR uses the order of values to interpret the order of cash flows. Be sure to enter your payment and
income values in the sequence they occur.
If an array or reference argument contains text, logical values, or empty cells, those values are ignored.
Guess
Guess is a number that you believe is close to the internal rate of return.
•
•
•
In most cases you do not need to provide guess for the IRR calculation. If guess is omitted, it is assumed
to be 0.1 (10 percent).
Microsoft Excel uses an iterative technique for calculating IRR. Starting with guess, IRR cycles through the
calculation until the result is accurate within 0.00001 percent. If IRR can't find a result that works after 20
tries, the #NUM! error value is returned.
If IRR gives the #NUM! error value, or if the result is not close to what you expected, try again with a
different value for guess.
Negative Cash Flow Note:
If in one of your years you have a negative cash flow, you cannot use Excel's IRR function. A negative cash
flow produces and second IRR and Excel only displays a single value for IRR.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 7
USC – Marshall School of Business
Academic Information Services – User Support
IRR Example 1:
You wish to invest in your own business. You estimate it will cost $150,000 to start the business and expect
to net the following income in the first six years: 20K, 25K, 45K, 50K, 60K, and 65K.
1
2
3
4
5
6
7
8
9
10
11
A
investment
IRR
B
-150000
20000
25000
45000
50000
60000
65000
Returns the IRR of:
15.5%
=IRR(b1:b7,8%)
IRR Example 2:
The following example demonstrates how time can affect the Internal Rate of Return of a project. Projects 2,
3, and 4 all require the same investment and return the same amount of cash, but some more quickly than
others.
A
B
C
D
E
1
Project 1
Project 2
Project 3
Project 4
2 Year 0
-1000
-1000
-1000
-1000
3 Year 1
100
175
275
600
4 Year 2
100
125
225
400
5 Year 3
100
150
250
500
6 Year 4
120
150
280
7 Year 5
100
160
220
8 Year 6
80
140
250
9 Year 7
100
150
0 Year 8
100
150
11 Year 9
110
150
12 Year 10
90
150
13
14
15 Cash inflow:
1000
1500
1500
1500
16 Profit:
0
500
500
500
17
18 IRR:
0%
8%
13%
24%
Excel_XP_Intermediate.Doc
August 28, 2002
Page 8
USC – Marshall School of Business
19 Formula used:
=IRR(B2:B12,7%)
Excel_XP_Intermediate.Doc
Academic Information Services – User Support
=IRR(C2:C12,7%)
=IRR(D2:D8,7%)
August 28, 2002
=IRR(E2:E5,7%)
Page 9
USC – Marshall School of Business
Academic Information Services – User Support
Modified Internal Rate Of Return (MIRR)
Returns the modified internal rate of return for a series of periodic cash flows where the positive and negative
cash flows are financed at different rates. For example, you borrowed the money at 10% interest, and
deposited your profits in an account which earned 8% profit.
=MIRR(values, finance_rate, reinvest_rate)
Values:
is an array or a reference to cells that contain numbers. These numbers represent a series of
payments (negative values) and income (positive values) occurring at regular periods.
Values must contain at least one positive value and one negative value to calculate the modified
internal rate of return. Otherwise, MIRR returns the #DIV/0! error value.
If an array or reference argument contains text, logical values, or empty cells, those values are
ignored; however, cells with the value zero are included.
Finance_rate: is the interest rate you pay on the money used in the cash flows.
Reinvest_rate:
is the interest rate you receive on the cash flows as you reinvest them.
Remarks
MIRR uses the order of values to interpret the order of cash flows. Be sure to enter your payment and income
values in the sequence you want and with the correct signs (positive values for cash received, negative values
for cash paid).
MIRR Example:
You are going to take out a loan of $120,000 to start your own business. You are borrowing at a rate of
12% and expect to reinvest your profits at a rate of 6%. Listed below is the loan amount and the profits you
expect to make.
A
Year 0
Year 1
Year 2
Year 3
Year 4
1
2
3
4
5
6
7 MIRR:
8 Formula:
Excel_XP_Intermediate.Doc
B
-120000
20000
25000
30000
50000
3%
=MIRR(B1:B5,12%,6%)
August 28, 2002
MIRR is 3%. The formula is
shown in cell B8.
Page 10
USC – Marshall School of Business
Academic Information Services – User Support
Net Present Value (NPV)
Net Present Value is similar to Present Value in that they both determine what a series of future cash flows
would be worth today as a lump sum. The primary difference is that the payments in PV must be of an equal
amount where as the payments with NPV need not be.
•
•
•
If the NPV is positive, the project should be accepted.
If the NPV is negative, the project should be rejected.
When comparing mutually exclusive projects, the one with the highest positive NPV should be selected.
=NPV(Rate,value1,value2,value3,…value29)
Rate:
is the rate of discount over the length of one period. (Cost of Capital)
ValueX…
are the payments and income.
Value1, value2,... must be equally spaced in time and occur at the end of each period. NPV
uses the order of value1, value2,... to interpret the order of cash flows. Be sure to enter your
payment and income values in the correct sequence.
•
Arguments that are numbers, empty cells, logical values, or text representations of numbers are counted;
arguments that are error values or text that cannot be translated into numbers are ignored.
•
If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells,
logical values, text, or error values in the array or reference are ignored.
•
The NPV investment begins one period before the date of the value1 cash flow and ends with the last cash
flow in the list. The NPV calculation is based on future cash flows. If your first cash flow occurs at the
beginning of the first period, the first value must be added to the NPV result, not included in the values
arguments. For more information, see the examples below.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 11
USC – Marshall School of Business
Academic Information Services – User Support
NPV Example 1: Initial Investment Begins One Year from Today
You are considering a project which requires an initial investment of $10,000 one year from today and will
return annually: $3000, $4200, and $6800 in the 3 years that follow. At an annual discount rate of 10
percent, the net present value of this investment is:
1
2
3
4
5
6
7
A
Year 1
Year 2
Year 3
Year 4
NPV:
B
-10000
3000
4200
6800
=NPV(10%,B1:B4)
NPV(10%,B1:B4)
returns:
$1188.44
NPV Example 2: Initial Investment Begins Today
This example is almost exactly like the previous example except that the initial investment of $10,000 is made
today, not one year from today. When this is the case, the initial investment must be outside of the NPV
formula. If it were within the NPV function, Excel would use the present value of 10,000 a year from today
rather than its current value.
1
2
3
4
5
6
7
A
Year 0
Year 1
Year 2
Year 3
NPV:
B
-10000
3000
4200
6800
=NPV(10%,B2:B4)+B1
NPV(10%,B2:B4) + B1
returns:
$1307.29
NPV Example 3: Dealing with Negative Cash Flows
In this example, we are predicting that in year 4 there will be a negative cash flow in year 4. The initial
investment of 10,000 is made today.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 12
USC – Marshall School of Business
1
2
3
4
5
6
7
A
Year 0
Year 1
Year 2
Year 3
Year 4
Year 5
Year 6
B
-10000
3000
4200
6800
-5000
3000
2500
Excel_XP_Intermediate.Doc
Academic Information Services – User Support
NPV(10%,B2:B7) + B1
returns:
$1166.17
August 28, 2002
Page 13
USC – Marshall School of Business
Academic Information Services – User Support
ONE VARIABLE DATA TABLE
A One Variable Data Table allows the user to build a table which contains a range of possible answers to an
equation if one of the values in the equation is allowed to vary.
For example, you want to see what your car payments would be for several different loan amounts.
One Variable Data tables can be structured in either of two ways:
If the variables are in a column, then the formula must be one cell above them
and one column to the right.
If the variables are in a row, then the formula must be one row below and one
column to the left.
TWO VARIABLE DATA TABLE
With a two variable data table, a formula has two components which are allowed to vary. For example, you
are taking out a car loan and not only are you unsure of the loan amount, but you are also unsure of how many
years you should take out a loan for.
The two variable Data Table is constructed as shown below:
Formula
Column
Variables
Row Variables
Leave this area empty. (Answers will appear here.)
With a One or Two Variable Data Table, you must name a blank cell(s) to represent the component(s) of the
formula which varies.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 14
USC – Marshall School of Business
Academic Information Services – User Support
One Variable Data Table Example:
You are considering taking out a 3 year loan at an interest rate of 6%. However, the amount you take out
(between 10K and 20K) depends upon what you’re monthly payments will be.
=PMT(Rate,nPeriods,PV)
Rate:
nPeriods:
PV:
6%/12 months
3*12 years
A1 or any blank cell. (column variable)
A
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
B
C
=PMT(6%/12,3*12,A1)
10000
11000
12000
13000
14000
15000
16000
17000
18000
19000
20000
1.
Place the formula in cell B3 as shown above (a 0 will display).
2.
Place the loan amounts in cells A4:A14
3.
Highlight A3:B14
4.
From the menu, click on:
DATA - TABLE
5.
At “Column Input Cell”, type in:
6.
Click on:
OK
The loan payments for each loan
in cells B4:B14.
Excel_XP_Intermediate.Doc
August 28, 2002
A1
amount will appear
Page 15
USC – Marshall School of Business
Academic Information Services – User Support
Two Variable Data Table Example
You are considering taking out a loan at an interest rate of 6%. The loan amounts you’re considering range
from 10K to 20K and the number of years range from 1 to 8 years. Construct a two variable table showing
all the different possible monthly loan payments.
• The loan amounts will be the column variables and will be represented by cell A2.
• The Number of Periods will be the Row Variables and will be represented by cell A1.
•
Rate:
6% / 12 months
nPeriods:
A1 * 12 years
(row variables)
PV:
A2
(column variables)
A
B
C
D
E
F
G
H
I
=PMT(6%/12,A1*12,A2)
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
10000
11000
12000
13000
14000
15000
16000
17000
18000
19000
20000
1.
Enter the loan amounts in cells A4:A14
2.
Enter the years in cells B3:i3
3.
Enter the formula in cell A3 (#DIV/0! will appear. This is normal.)
4.
Highlight from A3:i14
5.
From the menu, click on:
Excel_XP_Intermediate.Doc
DATA - TABLE
August 28, 2002
Page 16
USC – Marshall School of Business
Academic Information Services – User Support
Row input cell:
A1
Column Input cell:
Click on OK
You should now have a filled in table.
6.
7.
Excel_XP_Intermediate.Doc
A2
August 28, 2002
Page 17
USC – Marshall School of Business
Academic Information Services – User Support
GOAL SEEKING
Goal seeking can be used to make an equation come out to a desired value by changing one of the cells used
to arrive at the value.
Example:
You have computed your Net Pay for the week to be $287.10 if you work 50 hours that week. You need
your Net Pay to be $300.
1
2
3
4
5
1.
2.
3.
4.
5.
A
Pay rate:
Regular Hours:
OT Hours:
Gross Pay:
Net Pay:
B
7.25
40
10
398.75 =B1*B2+B1*1.5*B3
287.1 =B4*72%
Construct the table above. (Use the formulas shown to get gross & Net pay)
From the menu, click on:
TOOLS - GOAL SEEK
Make the following entries:
Set Cell:
B5
To Value:
300
By Changing Cell:
B3
Click on OK
(OT hours in cell B3 changes to 11.64)
Click OK again to accept changes or click Cancel to discard changes.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 18
USC – Marshall School of Business
Academic Information Services – User Support
IF STATEMENTS
If statements are functions which can provide different answers based upon a user created criteria.
=IF(Condition,True,False)
What to do if the
condition is
True.
The condition.
B2>H5 for example.
What to do if the
condition is
False.
Example 1: Separating Regular from Overtime Hours.
You work at a company where everyone is hourly. If anyone works over 40 hours per week, they get paid
one and a half times their normal pay rate.
1. Create the sheet below
A
B
1 Name
Total Hours
2 Jon
3 Kraig
4 Terri
5 Dana
6 David
7 Wess
8
C
Regular Hours
D
Overtime Hours
E
60
25
20
54
42
45
2.
To get the Regular Hours for Jon, click in cell C2.
3.
Type the following:
=if(B2>40,40,B2)
You should get 40. The statement B2 > 40 is true (60 is greater than 40). Therefore, the True section
of the If Statement is carried out. If B2 were less than 40, (25 for example) then the false section
would have been carried out and what was in cell B2 would have been displayed in cell C2.
4.
Copy the formula down to get the rest of the Regular Hours.
A
1
2
3
4
5
6
7
Name
Jon
Kraig
Terri
Dana
David
Wess
Excel_XP_Intermediate.Doc
B
Total Hours
60
25
20
54
42
45
C
Regular Hours
=if(B2>40,40,B2)
August 28, 2002
D
Overtime Hours
=If(B2>40,B2-40,0)
Page 19
USC – Marshall School of Business
Academic Information Services – User Support
8
To get Overtime Hours, we could simply subtract Regular Hours from the Total Hours but that would
be too easy.
5.
Click in cell D2 and type the following:
=If(B2>40,B2-40,0)
You should get 20 in cell D2. This is because the statement is true. The contents of cell B2 is greater
than 40 so the True section is carried out. (B2-40 or 60-40). If B2 was less than 40, (25 for
example) then the false section would have been carried out and a 0 would have been placed in cell
D2.
6.
Copy cell D2 down to get the other Overtime hours.
A
1
2
3
4
5
6
7
B
Total Hours
60
25
20
54
42
45
Name
Jon
Kraig
Terri
Dana
David
Wess
C
Regular Hours
40
25
20
40
40
40
D
Overtime Hours
20
0
0
14
2
5
Allowable operators
=
equal to
>
greater than
<
less than
>=
greater or
equal to
<=
less than or
equal to
<>
not equal to
Text in If Statements
If text (other than a cell address) is going to be used in any part of an If statement, the text must be enclosed in
quotes " ".
Example:
=if(B2>40,B2-40,"Zero")
Would place the word Zero in the cell instead of the number 0 if B2 was less than 40.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 20
USC – Marshall School of Business
Academic Information Services – User Support
Example 2: Nesting If Statements
A "nested" if statement is when an if statement contains another if statement. This is done whenever
there are more than two possible outcomes. The nested if statement can go in either the true or false
section.
In the example below we wish to assign a letter grade of A, B, C, D or F to each score using the
standard of 100 through 90=A, 80 through 89.9 = B, etc.
1.
2.
Click in cell B2 and type the equation below.
Double click the autofill handle to copy it down.
A
1
2
3
4
5
6
7
Score
62
99
85
74
100
51
B
Grade
=IF(A4<60,"F",IF(A4<70,"D",IF(A4<80,"C",IF(A4<90,"B","A"))))
•
•
The nested "If Statements" are placed in the false section of the previous "If Statements". The key to understanding this "If Statement" is
knowing that "If Statements" are read from left to right and as soon as a condition it true, Excel
A
B
stops reading the rest of the statement.
1 Score
Grade
For example, 74 is less than both 80 and 90 but because the condition that checks to see if it is
2 62
D
less the 80 is to the left of the condition checking to see if it is less than 90 and the condition is
3 99
A
true, Excel never checks to see if it is less than 90.
4 85
B
5 74
C
The if statement must end with 4 closing ) because it has 4 opening ).
6 100
A
7 51
F
Excel_XP_Intermediate.Doc
August 28, 2002
Page 21
USC – Marshall School of Business
Academic Information Services – User Support
OR Conditions
To perform an OR condition in an If Statement, there is a separate OR function which can be nested within the
IF Statement.
=OR(condition1,condition2,condition3,…)
OR returns True if any of the conditions are true. Returns False if none of the conditions are True.
OR Example: Determining if a Car is American Made or Foreign.
1.
Create the following spreadsheet.
A
1 MFG.
2
3
4
5
6
7
8
Honda
Ford
Nissan
GM
Toyota
Chrysler
Mercedes
B
Foreign/Domestic
=if(or(A2="Ford",A2="GM",A2="Chrysler"),"Domestic","Foreign")
=if(or(A2="Ford",A2="GM",A2="Chrysler"),"Domestic","Foreign")
This is the condition. If A2 contains either Ford or GM
or Chrysler, then the OR statement returns True and the
word Domestic is displayed. If A2 contains none of
these, then OR returns False and the word Foreign is
displayed.
Display Domestic if OR
returns True
Display Foreign if OR
returns False
You should get the word Foreign.
2.
Type the formula in B2 and then copy B2 down.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 22
USC – Marshall School of Business
Academic Information Services – User Support
AND Conditions
The AND function works similarly to the OR function except that all the conditions must be true for the AND
condition to return True.
=And(Condition1,Condition2,Condition3,…)
AND returns True only if all conditions are True. Otherwise, AND returns False.
AND Example
This example compares three schools to see which one is ranked the best between 1 and 10 with 1 being the
best. It also employs a nested If statement.
1.
1
2
3
4
Create the following spreadsheet:
A
School
Rank
USC
UCLA
CSULB
1
10
2
Type the formula shown in cell B6.
A
2.
1
2
3
4
5
6
B
B
School
Rank
USC
UCLA
CSULB
1
10
2
The Best
School is:
=IF(AND(B2<B3,B2<B4),"USC",IF(AND(B3<B2,B3<B4),"UCLA","CSULB"))
=IF(AND(B2<B3,B2<B4),"USC",IF(AND(B3<B2,B3<B4),"UCLA","CSULB"))
What to do if
Condition 1
is True.
Condition 1
Notes:
Excel_XP_Intermediate.Doc
What to do if
Condition 2
is True
What to do
if
Condition
2 is False.
Condition 2
What to do if Condition
1 is False.
August 28, 2002
Page 23
USC – Marshall School of Business
•
•
Academic Information Services – User Support
The function ends in )) because we are nesting If Statements and we have an opening ( for each of our If Statements.
The words "USC", "UCLA", and "CSULB" are in " " because they are text.
USING MULTIPLE SHEETS
•
•
•
•
Excel will allow you to have up to 256 separate sheets in the same file.
You can do mathematical operations between cells on separate sheets.
You can rename tabs to labels of your own choosing.
You can group sheets together so that if you change something on one sheet, it will change on all of the
other sheets in the group.
Moving Between Sheets
Using the Mouse:
• Click on a sheet's tab to make it the current sheet.
• Use the buttons shown below to view sheets that are not currently on the screen.
Go to the last sheet.
Go to the first sheet.
Move one sheet
backward.
Using the Keyboard:
• Control + Page Up
• Control + Page Down
Move one sheet
forward.
Moves toward the first sheet.
Moves toward the last sheet.
Renaming Sheets
1. To rename a sheet, double click its tab.
2. Type the new name.
3. Press ENTER on the keyboard or click on OK.
Sheet Name Rules:
• 31 characters maximum.
• Letters, numbers, or spaces are acceptable.
• Do not use:
/ \ * ? :
• You cannot give two separate sheets the same name.
Inserting a Sheet
1. Right mouse click a sheet's tab.
2. From the pop-up menu, left mouse click the word Insert .
3. Select "Worksheet" and then click OK.
The new sheet will be inserted to the left of the current sheet.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 24
USC – Marshall School of Business
Academic Information Services – User Support
Deleting a Sheet
1. Right click the tab of the sheet to be deleted.
2. Left mouse click the word "Delete" from the pop-up menu.
Moving a Sheet
•
Left click and drag the sheet by its tab.
Coping a Sheet
•
Hold down the Control key while you left click and drag the sheet by its tab.
TIP - you can also move or copy a sheet by:
• Right click the sheet to be moved or copied.
• Select "Move or Copy" from the pop-up menu.
• From the pop-up list, click where you want the current sheet to be & click OK.
Grouping Sheets
When sheets are grouped, they work as though there is carbon paper between them. Whatever you do on
any one of the sheets in the group takes place on all of the sheets in the group. This includes typing, editing,
formatting, deleting, formulas, inserting/deleting columns & rows, etc.
To group sheets: Hold down the Control key while clicking a sheet's tab.
• The sheets do not have to be adjacent to one another to be grouped.
• The tabs of grouped sheets appear white.
To ungroup sheets:
Excel_XP_Intermediate.Doc
Click on any sheet not in the group. (One of the gray tabs.)
August 28, 2002
Page 25
USC – Marshall School of Business
Academic Information Services – User Support
Mathematical Operations Between Sheets
Mathematically, anything you do on one sheet can be performed across multiple sheets. Cells on separate
sheets can be added, subtracted, multiplied, divided, etc. You can also use functions on cells from separate
sheets.
Basically, to do mathematical operations between cells from different sheets, you merely need to specify the
sheet name in front of the cell address and place an exclamation mark between them.
Syntax: Sheetname!CellAddress
Examples:
• To add cell B2 on sheet1 to cell H5 on sheet 3:
• To multiple A1 on sheet 1 with B3 on sheet 2:
=sheet1!B2+sheet3!H5
=sheet1!A1*sheet2!B3
Tip: Instead of typing the sheet name and cell address, click on it with your mouse.
Using the sum function across multiple sheets
If you are adding the same cell address but from separate sheets, you can use =sum().
Syntax: =Sum(Sheetname:Sheetname!CellAddress)
Example: You want to add all the B6's together from Sheet1 through Sheet4:
=sum(Sheet1:Sheet4!b6)
Tip:
Instead of typing the sheet name and cell address, click on the cell with your mouse.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 26
USC – Marshall School of Business
Academic Information Services – User Support
LINKING TO SEPARATE FILES
Just as you can link to cells on separate sheets in the same file, you can link to cell in completely separate files.
Syntax:
='Path [Filename ]Sheetname '!CellAddress
Example 1:
To link to cell A2 on Sheet1 in a file called "Budget 2000.xls" that exists
in "C:\Program Files", the equation would be:
='C:\Program Files[Budget 2000.xls]Sheet1'!A2
Example 2:
To perform calculations using cells from linked files, simply specify the full address when referencing any cell.
For example, the equation below subtracts a cell in one file from a cell in another.
'
[
]
'! '
[
]
'!
= C:\Program Files Budget 2000.xls Sheet1 A2- C:\Old Files Budget 1999.xls Sheet3 b6
Updating Links
•
•
•
•
When the both the source file and the linking file are both open when the changes are made, the linking
file will update automatically.
When changes are
made and saved in the
source file while the
linking file is not open,
the next time the linking
file is opened, Excel
will prompt you to
decide if you wish to
update the links or not.
To update the links at any time, from the menu, click: EDIT - LINKS. Use the "UPDATE NOW"
button to update the selected links.
If the source file is renamed, moved, or deleted, Excel will prompt you to find the file in its new
location. If you do not specify the new location, the value for the cell will remain in the linking file as
does the equation.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 27
USC – Marshall School of Business
Academic Information Services – User Support
SOLVER
Solver can be used to set a “target” cell to its minimum value, maximum value, or to a specific value, by
changing “adjustable” cell(s) which determine its value. Further, constraints can be set up which force the
“Adjustable” cell(s) or “target” cell to stay with a range of values.
Target Cell:
Adjustable Cell(s):
Constraints:
This is the cell you are attempting to maximize, minimize or set to a specific value.
Note that the target cell must contain a formula.
When you change the “Adjustable” cell(s), the contents of the “Target” cell is either
directly or indirectly changed. The adjustable cell(s) may contain either values or
formulas but Solver will replace any formulas in the adjustable cells will values.
These are limits you can place on either the “Adjustable” cells or the “Target” cell.
Allowable operators are: =, <=, >=, int (integer) , and bin (as in bin numbers.)
Loading the Solver Add-In
Solver may not be loading on your computer. This procedure will tell Excel to make the Solver available for
use. Once you configure it to load, it will be available in all future Excel sessions.
Step 1: Verify Solver
1. From the menu, click on: “Tools” and look for “Solver”
2. If Solver is present, it as already being loaded and you can skip step 2.
Step 2:
Loading Solver
If Solver was not under “Tools”:
1. From the menu, click on: TOOLS – ADD-INS
2.
From the list, click on the box next to “Solver Add-in” to check it.
3.
Click on OK.
Note that if Solver was not on the list or “Add-Ins” was not under tools, then you must install the Add-Ins from your Office
97 CD. Note that having add-ins “installed” and “loaded” are two different things. “Installed” means that the software is on
your harddrive. “Loaded” means that the add-in software is installed and Excel is loading it into memory.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 28
USC – Marshall School of Business
Academic Information Services – User Support
Solver Problem
Par Inc. manufactures two types of golf bags: Standard and Deluxe. Profit for the Standard bag is $9 and
profit for the Deluxe bag is $15. Each bag must go through the four departments shown below. The table
also shows the number of hours it takes to process a bag for each department and the maximum hours each
department can work per month.
Assuming an unlimited demand, how many bags of each type should Par Inc. produce per month to maximize
profit?
Standard Bag - Hours Per Dept:
Deluxe Bag - Hours Per Dept:
Max Hours Per Dept Per Month:
Cutting
and Dying
0.70
2.00
630
Sewing
0.50
0.83
600
Finishing
1.00
0.67
708
Inspection &
Packaging
0.10
0.25
135
Solver Solution:
Solving this problem begins with understanding the relationship between bags produced and profit.
Total Profit = (# of Standard Bags * 9) + (# of Deluxe Bags * 15)
Because of time constraints, each department can only produce a limited number of bags per month.
Therefore, the total number of bags produced is limited by the department which reaches its maximum
production hours for a particular type of bag first.
This equation shows how many hours a department spends per month on a given number of Standard bags
and a given number of Deluxe bags:
Hours Per Dept = (# of Deluxe Bags * Hrs. Per Deluxe bag) + (# of Std. Bags * Hrs. Per Std. bag)
Constraints:
Monthly Cutting & Dying Hours <=630
Monthly Sewing Hours <=600
or
Monthly Finishing Hours <= 708
Monthly Inspection & Packaging <= 135
or
.7S + 2.0D <= 630
.5S + .83D <= 600
or
1S + .67D <= 708
or
.1S + .25D <= 135
Where S is the number of Standard bags and D is the number of Deluxe bags.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 29
USC – Marshall School of Business
Academic Information Services – User Support
Step 1: Create the Spreadsheet shown below
A
B
D
E
F
G
Cutting &
Dying
Hrs. Per
Month
Sewing
Hrs. Per
Month
Finishing
Hrs. Per
Month
Inspection &
Packaging
Hrs. Per
Month
630
600
708
135
C
Number
of Bags
Per Month
1
2
3
4
5
6
Standard:
Deluxe:
Monthly Totals:
Max Hours Per
Month:
Total Profit:
Profit Per
Month
Step 2: Setting Up Hours Per Department
Our limitation on profit is the maximum hours a single department can work (which is determined by how
many bags are being produced) therefore, we need to setup a relationship which shows how the number of
bags produced determines the total hours for each department.
1.
2.
In cell B2 and B3 type a 10. (This is so our formulas will not have zeros. We will use
solver to change these numbers later.)
Multiply the number of bags by how long it takes to produce 1 bag for each department.
A
B
D
E
F
G
C
Number
of Bags
Per Month
1
2
3
4
5
6
Standard:
Deluxe:
Monthly Totals:
Max Hours Per
Month:
Total Profit:
Excel_XP_Intermediate.Doc
10
10
Cutting &
Dying
Hrs. Per
Month
=b2*0.70
=b3*2.00
Sewing
Hrs. Per
Month
Finishing
Hrs. Per
Month
=b2*0.50
=b3*0.83
=b2*1.00
=b3*0.67
Inspection &
Packaging
Hrs. Per
Month
=b2*0.10
=b3*0.25
630
600
708
135
August 28, 2002
Profit Per
Month
Page 30
USC – Marshall School of Business
Academic Information Services – User Support
Step 3: Find the Totals: Hours & Profit
A
6
C
D
E
Number
of Bags
Per Month
1
2
3
4
5
B
Standard:
Deluxe:
Monthly Totals:
Max Hours Per
Month:
Total Profit:
Cutting &
Sewing
Dying
Hrs. Per
Hrs. Per
Month
Month
10 =b2*0.70 =b2*0.50
10 =b3*2.00 =b3*8.83
=B2+B3
=C2+C3
=D2+D3
630
600
F
Finishing
Hrs. Per
Month
=b2*1.00
=b3*0.67
=E2+E3
708
Inspection &
Packaging
Hrs. Per
Month
=b2*0.10
=b3*0.25
=F2+F3
135
G
Profit Per
Month
=B2*9
=B3*15
=G2+G3
At this point, your spreadsheet should look like the one shown below:
A
6
C
Number
of Bags
Per Month
1
2
3
4
5
B
Standard:
Deluxe:
Monthly Totals:
Max Hours Per
Month:
Total Profit:
10
10
20
D
Cutting &
Dying
Hrs. Per
Month
7.0
20.0
27.0
630
E
F
Sewing
Hrs. Per
Month
Finishing
Hrs. Per
Month
5.0
8.3
13.3
600
10.0
6.7
16.7
708
Inspection &
Packaging
Hrs. Per
Month
1.0
2.5
3.5
135
G
Profit Per
Month
90.00
150.00
240.00
Step 4: Using Solver
At this point, our total profit is $240 per month and no department is exceeding its maximum output; however,
maximum profit is not being attained. You could make guesses at what the number of Standard & Deluxe
bags produced but Solver will be much quicker. Our goal will be to maximize profit (Cell G6) by changing the
number of Standard & Deluxe bags produced (Cells B2 & B3), subject to the constraints given.
1.
2.
Click in cell G6 (Total Profit and our “Target”
cell.)
From the menu, click on:
TOOLS - SOLVER
Excel_XP_Intermediate.Doc
August 28, 2002
Page 31
USC – Marshall School of Business
Academic Information Services – User Support
Set the Target & Changing Cells
3.
Set the “Target” cell to: G6
4.
Set the “Changing Cells” to: B2:B3
5.
Set “Equal To”: Max
Creating the Constraints
6.
Click on the “ADD” button.
7.
Create the following constraints:
7a. Specify cells and click ADD.
7b. Specify cells and click ADD.
7c. Specify cells and click ADD.
7d. Specify cells and click OK
Solving the Problem
Solver should look like the picture shown here.
1.
Click on “SOLVE”.
2.
3.
Select “Keep Solver Solution”.
Click all three reports to tell
Solver to produce them.
Click on “OK”.
4.
Excel_XP_Intermediate.Doc
August 28, 2002
Page 32
USC – Marshall School of Business
Academic Information Services – User Support
The Answer
§ The Maximum profit will be: 7,160.87.
§ The number of Standard bags is: 650
§ The number of Deluxe bags is: 88
The Reports
If you selected them, Excel will generate three reports on separate sheets:
Answer Report:
Specifies the “Target” and “Adjustable” cell’s original value and its final value.
Specifies the constraining cell’s value, whether it contains a formula or not, whether it is a binding cell
or not, and what the slack is if any.
Sensitivity Report:
Specifies the “Adjustable” cell’s final value and reduced gradient.
Specifies the “Constraining” cell’s final value and multi-range multiplier.
Limits Report:
Specifies the “Target” result.
Specifies the “Adjustable” cell’s upper limit, lower limit, and target result (where applicable.)
NOTE
At first glance it may seem that you will make the most profit if you make just the Deluxe bag ($15 profit per
bag) rather than the Standard bag ($9 profit per bag). However, because the Deluxe bag takes longer to
make than the Standard bag, this is not the case.
The table below shows what total profit would be if we made JUST Deluxe bags or JUST Standard bags.
§
§
The Max # of bags for each department was arrived at by dividing the Max number of hours per
department by the time it takes to produce either the Standard or Deluxe bag.
Total Profit for each type of bag was arrived at by multiplying the profit per bag ($9 or $15) by the
department whose number of bags which is the smallest. (i.e. $9*708 and $15*315) This is because a
bag must go through all four departments to be completed and you are therefore constrained by the least
productive department.
Max # Bags Standard per Month
per Dept.:
Max # Bags Deluxe per Month
per Dept.:
Excel_XP_Intermediate.Doc
Cutting
& Dying
900
Sewing
Finishing
Max Bags
Per Month
708
Total Profit
708
Inspection &
Packaging
1350
1200
315
720
1062
540
315
$ 4,725.00
August 28, 2002
$ 6,372.00
Page 33
Download