Microsoft Excel III

Microsoft Excel III
Advanced
Massey University
Semester One 2012
Semester 1, 2012
Aidan Wood & Robert Hallam
IT Assistant
Information Commons
Massey University Library – Te Putanga ki te Ao Matauranga
Private Bag 11222
Massey University
Palmerston North
Phone: 06 356 9099, extn 2121
Email: [email protected]
http://library.massey.ac.nz/aboutus/informationcommons.htm
For information about the Massey University MS Office course see the training section
on the ITS website http://its.massey.ac.nz
To book for course see the booking form under face to face / Manawatu
Example exercise questions can be found under face to face / course files
MS Excel III
Page 1
Semester 1, 2012
Table of Contents
Using Formula ................................................................................................................................. 3
Common Functions/ Formula....................................................................................................... 3
Calculations using AutoSum ............................................................................................................ 4
Troubleshooting .......................................................................................................................... 4
AutoFill ........................................................................................................................................... 6
Absolute Cell Addressing – e.g., $B$4 .............................................................................................. 7
IF statement.................................................................................................................................... 9
Basic IF Statement ....................................................................................................................... 9
Displaying a blank cell with IF statement.................................................................................... 11
Nested IF statements .................................................................................................................... 12
Using Goal Seek ............................................................................................................................ 14
Using Data Tables .......................................................................................................................... 15
Linking cells ............................................................................................................................... 17
Linking worksheets .................................................................................................................... 17
Linking workbooks ..................................................................................................................... 18
Updating links automatically ...................................................................................................... 19
Updating links manually ............................................................................................................. 20
Finding what kinds of linking the worksheet has ........................................................................ 21
Editing the Source ...................................................................................................................... 21
3D referencing (calculation) .......................................................................................................... 22
Referencing to the same cell ...................................................................................................... 22
Inserting header and footer .......................................................................................................... 23
Displaying formula in cells ............................................................................................................. 27
Example Questions .................................................................................................................... 28
Easy ........................................................................................................................................... 28
Advanced ................................................................................................................................... 29
MS Excel III
Page 2
Semester 1, 2012
Using Formula
Formulas are equations that perform calculations on values in your worksheet. A formula starts with an equal sign (=).
To select a formula
1.
2.
3.
4.
5.
Select the cell where you would like to
put the answer
Formulas tab > Formula Library Group >
Click on Insert function button
2
Select a category
Select a function
OK
1
3
5
Common Functions/ Formula
SUM
Adds cells
=SUM(A1, B1, C1)
=SUM(A1:A6)
Adds the value in cells A1 B1 and C1
Adds the values in the cells A1 through to A6
MAX
Finds the maximum value =MAX(A1, B1, C1)
=MAX(A1:A6)
Finds the Maximum value in cells A1 B1 and C1
Finds the maximum values in the cells A1 through to A6
MIN
Finds the minimum value =MIN(A1, B1, C1)
=MIN(A1:A6)
Finds the Minimum value in cells A1 B1 and C1
Finds the minimum values in the cells A1 through to A6
PRODUCT Finds the product of cell values (ie multiplies the numbers)
= PRODUCT(A1, B1, C1) Finds the Product of cells A1 B1 and C1
= PRODUCT(A1:A6)
Finds the Product of cells A1 through to A6
MS Excel III
Page 3
Semester 1, 2012
Calculations using AutoSum
Microsoft Excel
Is this everyone’s favourite? There are a number of different ways of entering and editing formulae in
Microsoft Excel, and all formulae begin with an equal sign (=).
Auto Sum
1.
- This will automatically calculate the total value of a range of cells.
Click on the cell in which you want the result to appear
Name Box indicates that
the active cell is A5
(Column A, Row 5)
The result is going to
be in the cell A5.
2.
Click on the AutoSum button on the tool bar.
3. Excel will surround the range (eg. A1:A4) with a blinking dashed border called a running
marquee.
Double check the cells
are correct
Troubleshooting
When Excel surrounds cell references that you don’t want to include in your calculation, re-select (click and
drag) the cells range that you want to calculate. (The running marquee is still blinking at this stage.) After
that, go to step 4.
If you want to redo it from the beginning, press the Esc key to remove the running marquee.
MS Excel III
Page 4
Semester 1, 2012
4.
Click the AutoSum button on the tool bar again or press Enter.
Your result
Note: If you want to check your calculation, you can do this on the status bar.
Select the cell range that you would like to check the sum of,
and the sum will be displayed in the status bar.
Have I done
it correctly?
If you like to use shortcuts, the shortcut key for Auto
Sum is
Or, another quicker way is double click on
the AutoSum icon at step 2!
Other common functions
The AutoSum button has a drop list of the most common functions.
Click this drop-down arrow.
MS Excel III
Page 5
Semester 1, 2012
AutoFill
Microsoft Excel
Remember to use the Fill Handle if you are repeating the same function.
1.
Perform the calculation (eg. Place the result in the cell, E2)
2.
Double click on the Fill Handle at the bottom right corner of the cell (eg. E2). (When you mouse over the corner,
the cursor becomes a black cross sign.)
Double click Fill
Handle!
3.
The result appears.
(Formula view version of the below)
Note: For the horizontal result, you will need to mouse over the fill handle and drag it out to the right. Double
clicking won’t work.
MS Excel III
Page 6
Semester 1, 2012
Absolute Cell Addressing – e.g., $B$4
Microsoft Excel
An absolute address in the cell does not change when it is copied to another location on the worksheet. The “$” sign
locks the row and column, eg. $B$3. By preceding the two parts of the cell reference with the $ symbol we are making
that reference absolute.
1.
Select the cell where the result should go, eg. C4
2.
Type “=”
3.
Click the cell that you want to multiple by, eg. B4
4.
Type “*”
5.
Select the Interest Rate cell, i.e., D1
MS Excel III
Page 7
Semester 1, 2012
6.
Enter F4 key
LOCK IN!
7.
Press ENTER key to complete
Fill handle
Remember to double click on the fill
handle to copy the formula to other cells.
This time, you won’t get “0”!
Results
MS Excel III
Formula view
Page 8
Semester 1, 2012
IF statement
You need to think logically when you do an IF statement. Working on paper and pencil may help you to perform an IF
statement before you directly type your statement into the cell.
An IF statement is a conditional test on values and formulas that returns one value if a condition you specify is TRUE
and another value if it is FALSE.
IF(logical_test,value_if_true,value_if_false)
Basic IF Statement
For example, if the following sales people sold more than 45 items, in the assessment cell, it should say “PASS”,
otherwise, “FAILED”.
IF the sales > 45
say “PASS”
ELSE “FAILED”
1.
Select the cell where your result should go to, e.g., C2
Formulas tab > Formula Library Group > Logical drop list > Choose IF
MS Excel III
Page 9
Semester 1, 2012
2.
Type logical test and the value for true and false > Click OK
(1)
(2)
(3)
Tip: If the value is text such
as PASS and FAILED, put
speech marks around a
word. So Excel can
recognise that it’s text.
(in the assessment cell)
IF
Sales item is more than 45
PASS
If it’s not, FAILED
(display this!)
→
→
→
→
→
If C2 is greater than 45
If C2 is greater than or equal to 45
If C2 is less than 45
If C2 is less than or equal to 45
If C2 is equal to 45
3.
The first cell is done (C2)
4.
Use fill handle to apply the IF statement for the rest of cells.
MS Excel III
C2
Use IF statement
(1) C2 >=45
(2) “PASS”
(3) “FAILED”
C2>45
C2>=45
C2<45
C2<=45
C2=45
Page 10
Semester 1, 2012
Displaying a blank cell with IF statement
In the previous example, the assessment cell displays either “PASS” or “FAILED”. However, if the result is “FAILED”, it
would look simpler to show the cell empty.
(in the assessment cell)
IF
Sales item is more than 45
PASS
If it’s not, show empty cell.
(display this!)
→
→
→
→
→
C2
Use IF statement
(1) C2 >=45
(2) “PASS”
(3) “ ”
Use double quotations for the false argument.
Type “ ”
The result
Notice: C5 is empty because the value is less
than 45. It is “FAILED”.
MS Excel III
Page 11
Semester 1, 2012
Nested IF statements
It is possible to nest multiple IF functions within one Excel formula. You can nest up to 7 IF functions to create a
complex IF THEN ELSE statement.
The syntax for the nesting the IF function is:
IF( condition1, value_if_true1, IF( condition2, value_if_true2, value_if_false2 ))
This would be equivalent to the following IF THEN ELSE statement:
IF condition1 THEN
value_if_true1
ELSEIF condition2 THEN
value_if_true2
ELSE
value_if_false2
END IF
1.
2.
3.
Click on Insert Function
Type IF in the search box
Select the IF function
4.
5.
6.
Enter the Logical test
Enter the Value if true
Instead entering the Value if false to end the IF statement
Continue the IF statement by clicking on IF function on the
formula bar.
6. Click here to continue
the IF statement. This
will clear the “function
Arguments” window in
order to continue the IF
statement.
MS Excel III
Page 12
Semester 1, 2012
Example of a nested IF statement
Question: In Excel, I need to write a formula that works this way:
If (cell A1) is less than 20, then multiply by 1,
If it is greater than or equal to 20 but less than 50, then multiply by 2
If it is greater than or equal to 50 and less than 100, then multiply by 3
And if it is great or equal to than 100, then multiply by 4
Answer: You can write a nested IF statement to handle this. For example:
=IF(A1<20, A1*1, IF(A1<50, A1*2, IF(A1<100, A1*3, A1*4)))
MS Excel III
Page 13
Semester 1, 2012
Using Goal Seek
The Goal Seek is used within Excel to create worksheets that have a final goal in mind but do not have the input to
solve the problem. For example, if you were considering purchasing a new car and knew the maximum monthly
payment you could make, it would be possible to use “Goal Seek” to determine what size loan you could afford.
Basically, you are working backwards from an answer to determine the input values needed to achieve that answer.
1.
Select Goal Seek …(located under What If Analysis within the Data Tools selection on the Data Ribbon).
There must be a formula for Goal Seek to
calculate the result.
The Value in cell B5 is the result of the formula
=PMT(B4/12,B3,B2).
MS Excel III
Page 14
Semester 1, 2012
Using Data Tables
A Data Table in Excel 2010 lets you expand on a formula to show the different results for different values of one of the
parts within the formula. This lets you easily compare the results of a formula for different input values without having
to edit the formula over and over again.
1.
2.
Copy the cell containing formula to where you would like to create a data (i.e. payment =PMT(C4/12,C3,C2)
to F2.
Create a table around that formula with the different inputs. Interest Rates along the top Row and Loan
Amounts down the Column as shown below.
3.
Select the table
4.
Select Data Table…(located under What If Analysis within the Data Tools selection on the Data Ribbon).
MS Excel III
Page 15
Semester 1, 2012
5.
In this example Interest is on the top row so the Row input cells will be call C5
And the Loan Amount is down the column so the Column input cell is C3
6.
Click OK. The data table will be created as shown with the inputs
you created.
MS Excel III
Page 16
Semester 1, 2012
Linking cells, worksheets, and workbooks
Microsoft Excel allows you to link cells dynamically, worksheets and workbooks (files) to
consolidate data from several worksheets and workbooks. When data is linked, the linked
immediately reflects any changes you make to the original data.
data
Linking is useful when creating summary sheets or pulling required information from different
locations without re-typing and re-calculating everything once again. Linking also helps to ensure data accuracy by
utilising Excel's automatic updating and recalculation features.
All cases, i.e., linking cells, worksheets and workbooks, are done the very same way. Only the source value is
different.
Linking cells
1.
Click the cell where you wish to pull the value into
2.
Press the “=” (equal sign) key
3.
Click the cell where the source is. (running marquee appears - blinking lines)
4.
Press ENTER key
5.
Done!
Notice: The name box displays C1 which is
the active cell. Also, check the formula
bar. It indicates “=A1” for the active cell
C1. These two cells are linked.
Linking worksheets
1.
Click the cell where you wish to pull the value into
2.
Press the “=” (equal sign) key
3.
Click the worksheet that contains the source information
4.
Click the cell that contains the source information
Notice: The formula bar
indicates what the source
cell is.
MS Excel III
Page 17
Semester 1, 2012
5.
Press ENTER key
6.
Done!
Linking workbooks
Tip: Arranging windows to view all related workbooks
Before you start, you may wish to arrange your workbooks, i.e., both source and dependent workbooks.
Then you can view all worksheets at the same time. This will be easier to link them.
1.
2.
Open all workbooks
View > Arrange All >
3.
4.
Choose Tiled and then drag the windows to suit.
Choose Vertival, Horozoltal or cascade to automatically arrange all Excel windows..
However, you still have to be careful with which workbook you are on. Check the title bar to see what the
workbook name is.
Otherwise, switch between files by clicking on Excel on the taskbar at the bottome of the screen and select
the work book ypu require.
Worksheets currently open
1.
Open all related workbooks (.xls)
2.
Select the cell where you wish to pull the value into (dependent workbook)
3.
Press “=” (equal sign) key
4.
Go to the workbook that contains the source information (source workbook) > select the cell that you want to
show on the dependent worksheet
MS Excel III
Page 18
Semester 1, 2012
5.
Press ENTER key
It is a good idea to check how the cell linking is done in the formula bar. Click the cell that has a link to
another workbook and look at the formula bar.
='[Auckland.xls]Budget Summary 2007'!$E$10
Source workbook
name
Source worksheet
name
Source cell address
It is important to know that when linking different worksheets from within the same workbook the link
will be made without absolute cell referencing and when linking different workbooks the link will be
made with absolute cell referencing.
Updating links automatically
When you open the linked workbook, the following warning message might appear.
If you wish to update links automatically without the warning message; Please:
1.
Open the linked workbook
2.
Data tab > Edit Links
3.
Click Startup Prompt
MS Excel III
Page 19
Semester 1, 2012
4.
Click Don’t display the alert and update links > Click OK and Close to return to your workbook
If you wish to update links manually, and without seeing the message every time you open the workbook, choose the
middle option.
Updating links manually
1.
Open a linked workbook
2.
Edit > Links
3.
Select the source workbook > Click Update Values
Source workbook
If you see OK for the status, it’s updated successfully. However, if the source workbook has been deleted,
moved to a different location, or renamed, links will not be updated.
This source workbook
cannot be found. The
dependent workbook
cannot be updated
with the source.
MS Excel III
Page 20
Semester 1, 2012
Finding what kinds of linking the worksheet has
1.
Open your linked worksheet
2.
Edit > Links
Select source
workbooks > click
Open Source to open
source workbooks
Tip: SHIFT key
Holding SHIFT key let
you select source
workbooks
sequentially.
3.
Click Close to return to the dependant worksheet/workbook
Source workbook
location.
Editing the Source
If you change the source file directory, you should update the link on the dependent workbook. Then it will not fail
updating values.
1.
Open your dependant workbooks
2.
Edit > Links
3.
Select the source workbook > Click Change Source
4.
Select the new location of the source workbook > Click OK until you return to the dependent workbook
Note:
If you made any changes to the value in any of the supporting workbooks, that will be reflected in the
workbook that contains linked data.
MS Excel III
Page 21
Semester 1, 2012
3D referencing (calculation)
Creating three-dimensional formula is similar to linking multiple worksheets. You can calculate over multiple
worksheets and also use a range of cell.
The following formulas are 3D-enabled:
AVERAGE, AVERAGEA, COUNT, COUNTA, MAX, MAXA, MIN, MINA, PRODUCT, STDEV,
STDEVA, STDEVP, STDEVPA, VAR, VARA, VARP, VARPA, SMALL, LARGE, RANK, MEDIAN,
PERCENTILE, QUARTILE, TRIMMEAN, SKEW, AND, OR, AVEDEV, DEVSQ, SUMSQ
Referencing to the same cell
This is an example of adding all data on multiple worksheets. All data on the spreadsheets are located in the same
cell name, i.e., all worksheets have to have the same structure.
1.
Select the cell where the result should go on the dependent worksheet, eg. D4
Result cell
2.
Perform the formula, e.g., click on the AutoSum on the tool bar
AutoSum button
3.
Select all required worksheets by holding SHIFT or CTRL key depends which worksheets you wish to select
Tip: Selecting worksheets
Selecting sequentially
1. Click the first worksheet you wish to include in the 3D reference
2. Hold the SHIFT key > Click the last worksheet you wish to include in the 3D reference
Selecting non-sequentially
1. Hold the CTRL key
2. Click worksheets you wish to include in the 3D reference
MS Excel III
Page 22
Semester 1, 2012
4.
Select the cell (e.g., D4) to be referenced from any of selected worksheets
Click the cell to be
added.
5.
Press Enter key to complete 3D calculation
If you are unsure how the 3D reference is done, check with the formula bar.
=SUM('2003:2005'!D4)
Source worksheets name
‘2003 through to 2005’
Cell reference address
Inserting header and footer
Microsoft Excel
Header and footer texts live inside of the top and bottom margins.
1.
Header
Header
Footer
Footer
Insert > Header & Footer
MS Excel III
Page 23
Semester 1, 2012
2.
The Header & Footer Tools > Design Tab appears, allowing you to type in a header and footer
3.
For custom header and footer options click Page Layout > Page Setup > Header/Footer
Header preview
Header and footer templates are here
by clicking the drop lists.
Footer preview
Click Custom Header and Footer to
customise your own header and footer
MS Excel III
Page 24
Semester 1, 2012
4.
Click Customer Header or Custom Footer button > fill out the appropriate information > Click OK when
finished.
Three different
alignments.
Button
Code
Function
---
Changing font style, size,
&[Page]
Inserts page number
&[Pages]
Inserts the total number of pages
&[Date]
Inserts the date
&[Time]
Inserts the time
&[Path]&[File]
Inserts the file name and its name
&[File]
Inserts workbook name
&[Tab]
Inserts the current worksheet name
Displays the Format Picture dialog box to insert a picture, e.g. company
logo
&[Picture]
---
5.
Displays the Format Picture dialog box so you can modify picture
Perform Print Preview (File > Print >)Print Preview is on the left to see the finished result
MS Excel III
Page 25
Semester 1, 2012
Note: In order to
show the header
and footer in the
print preview you
must have some
data in the
worksheet.
Print preview in footer
MS Excel III
Page 26
Semester 1, 2012
Displaying formula in cells
Microsoft Excel
You may wish to display the script of a formula contained in a particular cell to show how you performed your
calculation.
e.g.) Sample data – TOTAL cells contain formulas (cells are greyed).
1.
Formulas > Show Formulas
2.
The formulas are now shown.
Tip
A shortcut key for showing formulae is:
When you finish, perform the same shortcut key to go back to the normal data view.
MS Excel III
Page 27
Semester 1, 2012
Example Questions
Questions can be found on the ITS Training website face to face / course files
http://www.massey.ac.nz/massey/staffroom/national-shared-services/information-technology-services/training/faceto-face/course-files/course-files_home.cfm
Easy
Question 1
Q1.1
 Open InterestRate.xlsx
 Calculate the interest rate for each month using absolute cell addressing
Q1.2




Open affordability.xlsx
Select the Auckland Affordability worksheet
Fill out the Auckland Median Price (link to the Median Price Worksheet)
Fill out the Average annual household income (link to the annual household income spreadsheet)
Question 2
Q2.1


Using IF statements, complete the Affordability column on the Auckland Affordability worksheet
Using IF statements, complete the Affordability column on the Regional Affordability worksheet
Question 3
Q3.1



Open 3D referencing.xlsx
Select the Monthly Report worksheet
Use 3D Referencing to complete the total statistics for the month
MS Excel III
Page 28
Semester 1, 2012
Advanced
Question 1
Q1.1
 Open InterestRate.xlsx
 Calculate the interest rate for each month using absolute cell addressing
Q1.2


Open Times Table.xlsx
Complete the Times Table by using auto fill and absolute cell referencing.
Q1.3




Open affordability.xlsx
Select the Auckland Affordability worksheet
Fill out the Auckland Median Price (link to the Median Price Worksheet)
Fill out the Average annual household income (link to the annual household income spreadsheet)
Question 2
Q2.1


Using IF statements, complete the Affordability column on the Auckland Affordability worksheet
Using IF statements, complete the Affordability column on the Regional Affordability worksheet
*note - Annual Income multiplied by 4
Q2.2
 Open Nested IF.xlsx
 Create a nested IF Statement in cell U3
 The IF statement needs to return the following text strings.
If T3 < = to
Then display
0.088554
1st Quarter
If T3 < = to
Then
display
0.126612
2nd Quarter
If T3 < = to
Then
display
0.183064
3rd Quarter
 Use auto fill and absolute cell addressing to copy the same formula to all cells in the row.
If T3 < = to
Then display
6.098426
4th Quarter
Question 3
Q3.1



Open 3D referencing.xlsx
Select the Monthly Report worksheet
Use 3D Referencing to complete the total statistics for the month
Q3.2



Open Goal Seek.xlsx
Select the Loan worksheet
Use Goal Seek to calculate the maximum loan you can afford.
Q3.3


Open Data Tables.xlsx
Create a Data Table with different Interest Rates and Loan amounts as shown on page 15
MS Excel III
Page 29