Professional Documents
Culture Documents
Excel 2007
Advanced
Excel 2007 Advanced
Table of Contents
Importing Data from Access ................................................................................................................ 4
Importing Data into an Existing Workbook ....................................................................................... 4
Opening Access Databases ............................................................................................................. 6
Importing Data from the Web ............................................................................................................... 6
Importing Web Data .......................................................................................................................... 6
Saving a Web Query ........................................................................................................................ 7
Importing Text Files .............................................................................................................................. 9
Importing from Other Data Sources ..................................................................................................10
Importing Data ................................................................................................................................10
Viewing Existing Connections ........................................................................................................12
Sorting Data .........................................................................................................................................13
Sorting Data ....................................................................................................................................13
Sorting by Colour ............................................................................................................................15
Sorting on Multiple Fields ...............................................................................................................15
Filtering Data .......................................................................................................................................16
AutoFilter ........................................................................................................................................16
Text AutoFilter ................................................................................................................................ 17
Number AutoFilter .......................................................................................................................... 18
Top 10 AutoFilter ........................................................................................................................... 19
Advanced Filter ...............................................................................................................................20
Adding Subtotals ................................................................................................................................21
Grouping and Ungrouping Data ........................................................................................................23
Creating Pivot Tables .........................................................................................................................24
Creating a PivotTable .....................................................................................................................24
Hiding Entries .................................................................................................................................26
Drilling Down...................................................................................................................................27
Table Options .................................................................................................................................27
PivotTable Formatting ....................................................................................................................29
Creating Pivot Charts .........................................................................................................................30
Creating a PivotChart .....................................................................................................................30
Hiding Entries .................................................................................................................................32
Freezing Panes ....................................................................................................................................32
Database Functions ............................................................................................................................33
The Names Manager ...........................................................................................................................35
Displaying the Name Manager .......................................................................................................35
Adding Range Names ....................................................................................................................35
Removing Range Names ...............................................................................................................36
Amending Range Names ...............................................................................................................36
The Scenario Manager ........................................................................................................................37
Creating Scenarios .........................................................................................................................37
Displaying Scenarios ......................................................................................................................39
Summary Reports ...........................................................................................................................39
Goal Seek .............................................................................................................................................40
Using the Goal Seeker ...................................................................................................................40
If the data you wish to use exists in an Access database, it can be imported into Excel as follows:
Click in the first cell you wish to populate with the imported data
Click on the Data ribbon
Click on the From Access option in the Get External group
Locate the folder that contains the database you wish to open
Select the file you wish to open
Click on Open
If your database contains more than one object (table or query), you will be given a choice of the object to
open. Choose the object and click on OK.
The Import Data window will display. Click on OK to insert the data as a table in the selected cell.
Click on OK
Click on OK again to import the data
If the Access database changes, you can update the workbook by clicking on the Refresh All button on the
Data ribbon.
You can also import an Access database by opening the file directly:
If your database contains more than one object (table or query), you will be given a choice of the object to
open. Choose the object and click on OK.
Click in the first cell you wish to populate with the imported data
Click on the Data ribbon
Click on the From Web option in the Get External group
Your browser home page will be shown by default. Locate the page containing the data you wish
to import, by typing the URL in the Address box and clicking on Go
Click on Import
The Import Data window will display. Click on OK to insert the data as a table in the selected cell.
To update the data in a web query, click on the Refresh All button on the Data ribbon.
You can save a web query, to allow you to import the data into another worksheet quickly and easily.
Click in the first cell you wish to populate with the imported data
Click on the Data ribbon
Click on the From Web option in the Get External group
Locate the page containing the data you wish to import, by typing the URL in the Address box
and clicking on Go
Click on the yellow arrow next to the table you want to import - you can select as many tables as
required
Click on the Save Query button along the top of the Web Query window
Locate the folder that contains the text file you wish to open
Select the file you wish to open
Click on Import
The Text Import Wizard will be displayed. This helps you to arrange the data into appropriate
columns, rather than all data appearing in a single column separated by commas.
Choose Delimited if the columns should be separated at a set symbol e.g. a comma or tab
Click on Next
Choose the delimiter character e.g. Comma
Ensure the sample displays correctly and click on Finish
You can also open a text file directly by clicking on the Office button and the Open commands.
Choose to show Text Files then locate the file you wish to open.
If your data comes from a source other than Access, the Internet or a text file, you may be able to import
the data using the From Other Sources option.
Click in the first cell you wish to populate with the imported data
Click on the Data ribbon
Click on the From Other Sources option in the Get External group
Choose the kind of data connection you wish to make, then click on Next
Choose the file or server that contains the data you wish to import, then click on Next
If prompted, choose the table or object you wish to import, then click on Next
In the final step of the wizard, enter a file name for the connection, as well as a Friendly Name
that can be used to identify the connection again at a later stage
Click on Finish when the data wizard is complete
The Import Data window will display. Click on OK to insert the data as a table in the selected cell.
To view all of the external data connections in the current workbook, click on the Existing Connections
button on the Data ribbon.
Open a previously used connection by clicking on the name in the Connection Files on this
Computer list and clicking on Open
Edit a connection already in the workbook by right-clicking on the name in the Connections in
this Workbook list and choosing Edit Connection Properties
Sorting Data
Sorting Data
The menu options will differ depending on the type of data your column contains:
If sorting a column containing text, choose Sort A-Z or Sort Z-A as required
If sorting a column containing values, choose Sort Smallest to Largest or Sort Largest to
Smallest as required
If sorting a column containing dates, choose Sort Oldest to Newest or Sort Newest to Oldest as
required
The field names will remain at the top of the list and all records will be sorted in order of the column
containing the active cell.
Note: Even if you select a specific range in the table, all rows will be sorted when you choose the Sort
command.
You can also sort the table by clicking on the drop-down arrow next to the heading of the column you wish
to sort, then choosing the required sort option from the top of the menu:
Sorting by Colour
You can also sort a table by colour, so that cells with a specific text or fill colour will appear together at the
top of the table.
The sort buttons can also be used to sort in order of more than one field. For example, to sort the following
list in descending order of Airport, with the same airports grouped in descending order of Price:
First click anywhere in the Airport column and use the Sort Z-A command
Next, click in the Price column and use the Sort Largest to Smallest command
You can also use the Sort button on the Data ribbon to sort by multiple levels:
Click on the drop-down arrow of the Sort By field and choose the first field to sort by
Change the Order if required
Click on the Add Level button
Click on the drop-down arrow of the Then By field and choose the second field to sort by
Again, change the Order if required
Repeat the above 3 steps for each level you wish to add
Click on OK to sort the data
Filtering Data
AutoFilter
To use AutoFilter:
If the list does not show arrows next to each heading, turn AutoFilter on by clicking on the Data
ribbon, then on the Filter button in the Sort & Filter group
Click on the drop-down arrow in the heading of the column you wish to filter
A list will display all values currently in the column - uncheck all values you want to hide from the
list
Click on OK
Text AutoFilter
If the column you are filtering contains text, you can use the Text Filters option to apply custom filtering to
the list. Custom filters allow you set specific criteria to be matched e.g. all entries containing a specific
word, or all entries that end in specific characters.
Click on the drop-down arrow in the heading of the column you wish to filter
Click on Text Filters
Choose the type of comparison you wish to make e.g. Contains or Ends With
Click in the empty box in the top right of the dialog box and enter the text you wish to match
To add a further condition, click on And if both conditions must be met, or click on Or if either
condition can be met
Click on the drop-down arrow in the second line and choose the next comparison you wish to
make
Click in the box next to this and enter the text you wish to match
Click on OK when complete
For example: The following would show all records that had the word "London" in this field, but only if they
also started with "North".
Number AutoFilter
If the column you are filtering contains values, you can use the Number Filters option to apply custom
filtering to the list e.g. to find all entries greater than 100, or between 50 and 75.
Click on the drop-down arrow in the heading of the column you wish to filter
Click on Number Filters
Choose the type of comparison you wish to make e.g. Greater Than or Between
Click in the empty box in the top right of the dialog box and enter the value you wish to match
To add a further condition, click on And if both conditions must be met, or click on Or if either
condition can be met
Click on the drop-down arrow in the second line and choose the next comparison you wish to
make
Click in the box next to this and enter the value you wish to match
Click on OK when complete
Top 10 AutoFilter
The Top 10 option allows you to choose the top or bottom number of records in a field - you could use it to
find the top 10 sales or the bottom 5% of salaries.
In the first box, choose whether to show the top or bottom items from the list
Choose the number of items to display
Choose whether to show the specific number of Items or the specified Percent
Click on OK
The Above Average and Below Average commands require no further input. These will work out the
average value in the column, then show all records that have a value above or below this.
Advanced Filter
Advanced filtering is used with more complex criteria or if you wish to copy the filtered list to another
location in the workbook. There are three ranges that are needed to perform an Advanced Filter:
Range Description
List Range This is the entire data list that you wish to filter - all matching records will be
found in this range
Criteria Range This is the area of the worksheet in which you specify what data you want to
find in the data list e.g. all clients in London or all accounts with a balance
exceeding £1000.
Copy To Range All records of the database range that match the specified criteria will be copied
here
Before filtering the list, set up the Criteria range. This should contain the relevant column headings in the
first row and the criteria itself on the following lines. Multiple lines of criteria can be entered, but care should
be taken that conditions are placed on the correct line:
If both conditions must be met, these should be placed on the same line. The following criteria will
only show Excel courses if they had a level of Advanced:
If either condition can be met they should be placed on separate lines. The following criteria will
find all Excel courses, regardless of their level, as well as all Advanced courses, regardless of
their subject:
Click in the Criteria box, then select the range you have set your criteria in, including the field
names
Click in the Copy To box, then click on the cell you wish the matching data to be extracted to
Click on OK
To filter records to a different worksheet, click on the cell you wish to filter to, then click on the Advanced
button on the Data ribbon. Choose Copy to Another Location, then enter the data list and criteria ranges.
Enter the cell on the current sheet you wish to filter to, then click on OK.
Adding Subtotals
This feature automatically calculates totals in the specified column. If the data is sorted correctly,
subtotals will be given for each group of records, with a grand total at the end.
Sort the data list in the required order and click anywhere in the list
Click on the Data ribbon
Click on the Subtotal button in the Outline group
In the At each change in box, specify the field to be grouped for subtotals
In the Use Function box, choose the function you want to use the summarise the data in each
group
In the Add subtotal to list, check each numeric field that you wish to show a total for
Click on OK
Click on the - symbol next to a group to collapse that group, showing on its total
Click on the + symbol next to a hidden group to show all data again
To remove subtotals from a list, click on the Subtotals button on the Data ribbon, then on
Remove All.
Grouping will read the summary columns and rows in the worksheet i.e. those containing totals, and
place these into the highest level of the outline. Detail columns and rows i.e. those containing the
numbers to be summed, are placed into the lowest level.
Create the worksheet in the normal way, ensuring all formula are entered correctly and either
below or to the right of the detail
Click on the Data ribbon
Create an outline by clicking on the Group button in the Outline group
Choose Auto Outline
In the following example, rows 5 and 10 contain subtotals, with row 12 containing the sum of these
sub totals. Column E contains a total for each row. When an Auto Outline is applied, these totals are
put into levels as follows:
Creating a PivotTable
A blank PivotTable is created in the location specified, with a task bar on the right-hand side where the
PivotTable is built:
To add a field to the PivotTable, drag the field from the field list to the relevant area of the task pane.
Choose the field you wish to summarise by column, and drag this to the Column Labels box
Choose the field you wish to summarise by row and drag this to the Row Labels box
Choose the field that contains the values you wish to summarise for each column and row
heading and drag this to the Values box
As you add fields to the task pane, the PivotTable will build automatically on the worksheet.
Hiding Entries
The PivotTable need not include all data from the underlying list - it is possible to hide specific categories or
entries.
Click on the drop-down arrow of the field used to summarise by row or column - all entries in that
field will be displayed
Click on the check box of each item you wish to exclude
Click on OK when complete
Drilling Down
Drill Down allows you to double click on any of the summary figures of a PivotTable to view the details that
make up this figure. Double clicking on a sum, for example, would show all figures (and the records) that
make up the sum.
For example, double-clicking on the Heathrow total in the example given at the top of this page would show
the following detail sheet:
The sheet can be deleted if no longer required. Right-click over the sheet tab and choose Delete from the
shortcut menu to do this.
Table Options
Click on the Options button in the PivotTable group of the Design ribbon
To enter a default value into empty cells, or cells containing errors, enter the appropriate values in
the Format boxes
Click on the Totals & Filters tab and choose whether to show grand totals for columns and/or
rows
Click on the Data tab and choose whether to refresh the PivotTable automatically each time it's
opened
Click on OK when all options have been set
If the original data in the worksheet is changed, the PivotTable will NOT automatically update. To update the
PivotTable, select any cell in the table and click in the Refresh button on the Options ribbon.
PivotTable Formatting
The Layout ribbon can be used to format the PivotTable once it's been created.
Creating a PivotChart
A blank PivotTable and PivotChart is created, with a task bar on the right-hand side where the PivotChart is
built:
To add a field to the PivotChart, drag the field from the field
list to the relevant area of the task pane.
Hiding Entries
The PivotChart need not include all data from the underlying list - it is possible to hide specific categories or
entries.
On the PivotChart Filter Pane, click on the drop-down arrow of the Axis Field or Legend Field -
whichever you wish to hide entries from
Click on the check box of each item you wish to exclude
Click on OK when complete
Freezing Panes
If your data list contains more records than will fit on a single screen, you will have to scroll down to
view records that appear towards the end of your list. As you scroll down, you will lose the headings
at the top of the list.
To solve this problem, you can freeze your headings on screen so that they always show along
the top.
Click on the View ribbon
Click on the drop-down arrow of the Freeze Panes button
Choose Freeze Panes to freeze all rows above the active cell, and all columns to the left of the
active cell or
Choose Freeze Top Row to freeze the top row of the data list or
Choose Freeze Left Column to freeze the left column of the data list
Unfreeze the titles by clicking on the drop-down arrow of the Freeze Panes button and choose the Unfreeze
Panes option.
Database Functions
Database functions are used to analyse relevant records in a data list. Only the records that match
the specified criteria will be analysed - any records that don't match this criteria will be ignored.
In the following example, the area shaded in yellow is the database range, while the area shaded in
blue is the criteria. The DSum command is used in the pink shaded area to calculate the total balance
of all customers in London:
When using database functions, range names can be used to save time and make the formulas
easier to create.
Press [Return]
Select the criteria range
Click in the name box above the column headings and type a name for the range e.g. criteria
Press [Return]
Once the names have been applied, they can be used in the formula as required. The following
formula would calculate the average balance of all records in the range named data that match
the criteria in the range named criteria:
=DSUM(database,"balance",criteria)
You can show the Name Manager on any sheet to see the values in the named ranges in your worksheet.
This will remove the name from the cell, but leave the cell as is on the worksheet.
This worksheet shows a best-case scenario for profit, with high revenue and comparatively low cost. Cells
B1 and B2 could be saved as a scenario called Best.
This version of the same worksheet shows a worst-case scenario, with low revenue and high cost. Cells B1
and B2 could be saved as a scenario called Worst.
You could switch between the scenarios easily, to see how each impacts all formulas on the worksheet.
Creating Scenarios
To create a scenario:
The Scenario Manager will display - click on the Add button to add a new scenario
Enter a name for the scenario in the Scenario Name box
Ensure the Changing Cells box refers to the correct range in the worksheet
Click on OK
The Scenario Values box will display. Enter the values you want to store in the selected cells for this
scenario
Displaying Scenarios
You can remove a scenario in the Scenario Manager window by clicking on the name of the scenario, then on
the Delete button.
Summary Reports
The Summary button in the Scenario Manager window can be used to print summary reports about the
scenarios in the worksheet and their associated values.
Report Description
Summary Select this option to create an outlined summary report on a separate sheet of the
workbook. The summary report will show the current values in the changing cells,
the values in each scenario and any cells that are affected by the scenarios
PivotTable Select this option to create a pivot table on a separate worksheet. This pivot table
will contain a page field listing all users that have created scenarios in the
worksheet
Goal Seek
The Goal Seek command is used to change the result of a formula by changing the value of a cell that
the formula is dependent on.
Imagine you know the required profit to be made in a certain month, and would like to know the
sales needed to make that profit.
Cell B1 contains the sales figure as a normal value
Cell B2 calculates the cost of sales at 35% of the sales figure using the formula =B1*35%
Cell B3 calculates the profit as sales less cost using the formula =B1-B2
The goal seek command could be used to change the profit (B3) to a particular result by
increasing or decreasing the sales, and therefore also changing the cost.
Click in the To Value box and type the desired result for the selected formula
Click in the By Changing Cell box and either type or select the cell that should change to update
the formula result
Click on OK to show the proposed result
The Goal Seek command allows you to change only one value to reach your desired goal.
Data Tables
Data tables can supply several answers to a calculation by substituting different values into a formula.
A one-way data table is used to substitute only one value of the formula, while a two-way data table is
used to substitute two values.
One way data tables are used when we have only one value that differs in each formula. In the following
example, we want to work out multiple prices, each based on a different discount percentage.
In this example, the formula in cell B4 calculates the price multiplied by the discount using the formula
=B1*B2. B2 will become the input cell that all values in the first column of the data table range (A4:B11) will
be substituted into in turn.
Enter the range of substitute values into a single column (as we have in cells A5 to A11 above)
In the row above and one column to the right of this column, enter the first formula to be
calculated. At the place in the formula where the value should be substituted, use the address of
any cell outside the data table area. This is known as the input cell, and our input cell in the above
example is B2
Type any other formula to be calculated to the right of the first. Use the same input cell in each
formula
Select the range of cells containing the substitute values and formulas but not the input cell
(A4:B11 in the above example)
Click on the Data ribbon
Click on the What-if Analysis button in the Data Tools group
Click in the Column Input Cell box and type the reference of the input cell
Click on OK to calculate all results
Two way data tables are used when we have two values that differ in each formula. In the following
example, we want to work out multiple prices, each based on a different discount percentages and different
starting prices.
In this example, the formula in cell A4 calculates the price multiplied by the discount using the formula
=B1*B2. Both B1 and B2 will become input cells. The first row of values (B4:F4) will be substituted into cell
B1, while the first column of values (A5:A11) will be substituted into B2.
Enter the first set of substitute values in a single row (as we have in cells B4:F4 above)
Enter the second set of substitute values in a single column (as we have in cells A5:A11 above)
In the corner cell type the formula to be calculated. At the place in the formula where the value
from the first or second set should be substituted, use the address of any cells outside the data
table area. Different input cells must be used for each set of values
Select the range of cells containing the substitute values and formulas but not the input cells
(A4:F11 in the above example)
Click on the Data ribbon
Click on the What-if Analysis button in the Data Tools group
Choose Data Table
Click in the Row Input Cell box and type the reference of the first input cell (B1 in our example)
Click in the Column Input Cell box and type the reference of the second input cell (B2 in our
example)
Click on OK to calculate all results
Creating If Statements
Basic If Statements
The =IF function performs a conditional calculation. The function tests a condition to see whether it is true
or false. One result is displayed if the condition is true, another if it is false.
Operator Meaning
= Equal to
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
<> Not equal to
To enter an IF statement:
For example:
If the figure in cell A1 is greater than 2000, the current cell should calculate 5% of the figure in A1. If not,
the current cell should contain zero.
The And( ) and Or( ) functions are used to test more than one condition at the same time. The And()
function is used to test multiple conditions when ALL conditions must be met for the condition to be true.
The syntax of the AND statement is: =IF(AND(Condition 1, Condition 2), Result if True, Result if False)
The OR() function is used to test multiple conditions when only ONE of the conditions must be met for the
condition to be true.
The syntax of the OR statement is: =IF(OR(Condition 1, Condition 2), Result if True, Result if False)
For example:
If both figures in cell A1 and A2 are greater than 2000, the current cell should calculate 5% of the sum of
these figures. If either is less than 2000, the current cell should contain zero.
Nested If Statements
Nested =IF statements are used when more than one result can be given depending on the criteria met.
Instead of a single result if true or false, another IF statement is started and another condition tested.
For example:
If the figures in cell A1 is greater than 2000, 200 is returned. If not, it is tested again. If it is greater than
1000, 100 is returned. If not, 0 is returned.
VLOOKUP Functions
VLOOKUP is used when the lookup table is entered in columns (i.e. vertical).
The following example will look up the value of B1 in the table stored in D2:F6. The result in the third
column of the corresponding row will be displayed.
If the function cannot find an exact match for the lookup value, it finds the largest value that is less than the
lookup value.
Using the above example, if cell B1 contained 8, the value 2700 would be returned, even though there is no
application with a code of 8. As 5 is the closest match, the value of this application is given.
This default can be changed by adding FALSE to the end of the lookup statement. Instead of returning the
closest match, an error message will be returned if an exact match is not found.
Using the above example, the function could be updated to: =VLOOKUP(B1,D2:F6,3,FALSE)
HLOOKUP Functions
HLOOKUP is used when the lookup table is entered in rows (i.e. horizontal).
The following example will look up the value of B1 in the table stored in D2:F6. The result in the third
column of the corresponding row will be displayed.
Error Trapping
Excel has a number of functions that can be used to find errors and other types of values in cells. Each
function returns TRUE or FALSE depending on whether the error or value is found in the cell.
Available functions:
Function Description
=ISBLANK(cell) Returns TRUE if the specified cell is blank
=ISERROR(cell) Returns TRUE if the specified cell contains an error
=ISERR(cell) Returns TRUE if the specified cell contains an error other than #N/A
=ISTEXT(cell) Returns TRUE if the specified cell contains text
=ISNUMBER(cell) Returns TRUE if the specified cell contains a number
For example:
Cell B1 contains the =ISERROR(A1) function and returns true as there is an error in cell A1
Cell B2 contains the same function and returns false as there is no error in cell A2
Cell B3 contains the =ISNUMBER(A3) function and returns true as there is a number in cell A3
Cell B4 contains the same function and returns false as there is no number in cell A4
Error functions are often combined with IF statements to give different results in a cell depending on
whether a condition is true or false.
For example:
The following example attempts to divide cell A1 by B1. If the division would return an error, the cell will
remain blank. If the division will not return an error, the result will be displayed. This formula has been
copied to the next row, which is blank as an error has occurred when attempting to divide by 0.
Error Meaning
#### This is not actually an error message but simply means that the column is not wide
enough to display the result of the formula - widening the column will fix the error
#DIV/01 The formula is trying to divide by 0. This error can also occur if you are dividing
text rather than values
#N/A No value is available. This error commonly occurs in Lookups when the lookup cell
does not yet contain a value
#NAME? This formula is either referencing a range name that does not exist or is using a
function which is misspelled e.g. =SUMM instead of =SUM
#NUM! There is a problem with a number in the formula. This is often caused by a function
using an unacceptable argument e.g. using a negative number in a function that
will only accept positive numbers
#REF! The formula refers to a cell that is not valid. This can be caused by deleting cells
that other formulas refer to or pasting moved cells over cells that other formulas
refer to
#VALUE! An incorrect argument has been used. This can be caused by referencing a range
of cells when a single cell is required or referencing text when a number is required
The following functions can be used to insert dates and times into the worksheet:
Function Description
=today() Returns the current date which will update each time the file is opened
=now() Returns the current date and time which will update each time the file is
opened
Remember you can find out the number of days between two dates by subtracting the earlier date from the later
date.
Text Functions
As well as manipulating values in a spreadsheet, it is also possible to create formula to manipulate text. For
example, two or more cells can be concatenated using the & operator. In the following spreadsheet, the
name and surname have been concatenated to return the full name:
Whenever text or spaces are added to the formula, be sure to enclose these in quotation marks. Quotation
marks are never needed for cell references or range names.
The following text functions can also be used to manipulate text in cells.
Auditing Workbooks
The Formula Auditing group on the Formulas ribbon is used to trace cells and errors in a worksheet.
To trace precedents, the cells that the selected formula refers to, click on a formula and then on
the Trace Precedents button on the Formulas ribbon
To trace dependents, cells that contain formulas that refer to the active cell, click on any cell and
then on the Trace Dependents button on the Formulas ribbon
Arrows will show the cells that the formula refers to, which should allow you to see where the error
lies:
Use the Show Formulas button on the Formulas ribbon to replace formula results with the formulas
themselves, for evaluation and checking purposes.
You can move the watch window by dragging the title bar of the window to a new position.
To add a cell to the watch window, so that you can always see the value in that cell:
You will be able to see the workbook name, sheet name, any range names applied to the cell, the
current value and any formula entered in the cell:
To remove a cell from the watch window, click on the cell reference, then on the Delete Watch
button.
Close the watch window using the X in the top-right corner of the window.
Accessing Add-Ins
An Add in is a small program that allows you to add additional features and custom commands to Excel
2007.
Some standard Add-ins are available with Excel but you will need to install them after you have installed
the Excel program. In order to access the Excel Add-ins you will need to have the original Microsoft Office
disks, or have access to the Internet to obtain the add-ins from Microsoft's web site.
Add-In Description
Analysis ToolPak Adds, Financial, statistical and analysis tools and functions
Analysis ToolPak Allows developers to use the analysis ToolPak features in their macros and
VBA solutions
Conditional Sum Creates a formula that sums data in a list if it matches your specified criteria
Wizard
Euro Currency Formats values in Euros and allows the EUROCONVERT function to work
Tools
Internet Assistant Allows developers to publish Excel VBA code and programs to the Web
VBA
Lookup Wizard Creates a formula to look up data in a list by using another known value in that
list
Solver Add-In Allows users to add in complex business scenarios and work out solutions,
based on adjustable cells and constraints
Additional Add-Ins are available from the Microsoft Web site at www.microsoft.com
You will be asked to confirm that you wish to install each add in - click on Yes to continue:
Calculation Options
Excel 2007 will automatically update all calculations in your workbook each time it is opened. The
workbook will also recalculate each time you enter a new formula, to ensure all other formulas in the
worksheet are up-to-date.
If your spreadsheet is large and contains many formulas, this can result in waiting time while Excel
updates all formulas. If you prefer, you can set the Excel to manual calculation - all formulas will only
update when you specify they should.
Once the calculation has been set to manual, you can choose to re-calculate when it suits you.
To recalculate and update all formulas, either:
Click on the Calculate Now button on the Formulas ribbon to recalculate the entire workbook
Click on the Calculate Sheet button on the Formulas ribbon to recalculate the current worksheet
only
Keystroke Action
F9 Calculate workbook
Shift F9 Calculate current worksheet only
Additional calculation options can be set by clicking on the Office button, then on the Excel Options button.
Click on the Formulas menu on the left-hand side of the window.
Linking Formulas
Linking Formulas
For example, the formula =A3-B3 refers to these cells on the current sheet but can be changed to
=Sheet1!A3-Sheet2!B3 to refer to cells on sheets 1 and 2, regardless of the sheet in which the formula is
typed.
It is also possible to refer to a range of cells spanning several sheets. The following formula will sum the
values in cell A3 of all sheets, from the sheet named January to the sheet named June:
A link to another workbook can also be created by entering a reference to the target range using the
syntax: =[file.xls]sheet!cell. In the following example, the formula refers to cell A10 on the sheet named
Jan in the sales.xlsx file stored in the same directory as the current workbook.
Paste Link
Data can be linked from one worksheet to another, even if the sheets are not in the same workbook.
The original data is known as the source while the copy is known as the target or destination. Whenever
the source changes, the target will be updated accordingly.
The data will be copied and linked to the original workbook. If the original changes, the target will update when it
is next opened.
Maintaining Links
Worksheet links are updated each time the target file is opened or recalculated. If the source file's location
changes, it can be edited so further updates can be made:
If the file has moved, click on the Change Source button and locate the moved file. Click on OK
To check the status of the link, click on the Check Status button. You will be told if the source is
OK or cannot be found
To stop linking to a file, click on the link, then on the Break Link button. Click on Break Links to
confirm this
Click on Close to return to the worksheet
Adding Comments
Comments can be attached to any cells in the worksheet to add explanations about formula,
worksheet layout, etc.
By default, comments will display the name of the user that inserted the comment. Ensure the correct user
name is set before inserting a comment.
Adding Comments
To insert a comment:
A new comment will be created containing your User Name which can be selected and deleted or
edited as required
Type the comment text
Click on any cell in the worksheet to secure the comment
Viewing Comments
A red triangle will display in the corner of a cell that contains a comment:
The comment will display when the mouse is positioned over the cell:
By default, comments are only displayed when the mouse is positioned over the cell. A single comment can
be displayed permanently as follows:
Alternatively, display all comments in the workbook by clicking on the Show All Comments button on the
Review ribbon.
To edit a comment:
To remove a comment:
You can also right-click over a cell containing a comment to see options to delete and edit the comment:
Printing Comments
Comments can be printed as they appear in the worksheet or listed together at the end of the printout.
Click on OK
Print or preview the worksheet as normal
If you wish to print comments as they appear, ensure all comments are displayed before the Print command is
used.
Sharing a Workbook
Opening Workbooks Already in Use
By default, if you open a workbook stored on a shared drive that is currently open on another user's
computer, a message similar to the following will display:
Click on Read Only to open a read-only version of the file - you will not be allowed to save any
changes you make to the workbook.
Click on Notify to open a read-only version of the file. When the original user has closed the
workbook, you will be given the chance to switch to read/write mode so that any changes can be
saved
Sharing Workbooks
It is possible for more than one user to work on an Excel file at the same time, provided it has been set up
as a shared workbook. Some features are not available when a workbook is shared:
When a workbook has been set to shared, a new indicator will appear in the Title Bar:
Sharing Conflicts
Conflicts will occur when two or more users make different changes to the same cell and attempt to save
the file.
The Resolve Conflicts dialog box will display when you attempt to save a change that conflicts with another
change saved in the current session:
Click on Accept Mine to keep the change that you made in the sheet
Click on Accept Other to use the change made by the other user, discarding your own change
Click on Accept All Mine to keep all changes made by yourself, with no further prompts
Click on Accept All Others to keep all changes made by other users, with no further prompts
To make the workbook exclusive again, click on the Share Workbook button and uncheck the Allow
changes box. Any users currently accessing the file will not be allowed to save their changes.
Tracking Changes
In a shared workbook you can have Excel highlight any changes that you, or any other user who has
access to the spreadsheet makes. Excel will track additions, deletions and cell changes and allow you
to review the changes and decide which ones you would like to accept.
Click on the Track Changes checkbox, to start tracking changes and share your workbook
Click on the drop-down arrow of the Who box to specify the users whose changes you want to
track - leave on Everyone to track all changes
Click in the Where box and specify the range you want to track changes in - leave blank to track
changes to the entire workbook
Click on the Highlight Changes on Screen option to have the changes displayed on your
worksheet
Click on OK
Once you have enabled the tracking option, any additions, deletions or edits made to the
spreadsheet will be tracked by date and user. Amended cells will be highlighted by a blue border
and corner triangle - position the mouse over a highlighted cell to view details of the change:
Choose the changes you want to review - keep to the default options to see all changes you
haven't yet reviewed, made by all users
Click on OK
You will be asked to accept or reject each change made in the workbook:
Click on Accept to accept this change and place the new value in the cell
Click on Reject to reject this change and keep the original value in the cell
Click on Accept All to make all changes without further prompts
Click on Reject All to lose all changes and keep all values as they were
Click on Close when complete
To stop highlighting changed cells in the workbook, click on the Track Changes button on the
Review ribbon and choose Highlight Changes. Uncheck the Track Changes box and click on OK.
Click on Yes to confirm you wish to unshare the workbook again.
Inspecting Workbooks
Before sharing a workbook with colleagues or customers, you may want to remove any personal or
hidden information, to ensure the person you pass the workbook onto will not be able to view this.
Item Description
Comments and Comments you have inserted via the Review ribbon, or ink annotations you
annotations have created via your tablet PC
Properties Document properties such as status, keywords, etc.
Custom XML Data Any XML data stored in the workbook
Headers and Footers Headers and footers you have set via Page Setup or the Insert ribbon
Hidden rows or Rows or columns you have hidden by right-clicking on the row or column
columns heading and choosing the Hide command
Hidden worksheets Worksheets you have hidden by right-clicking on the sheet tab and
choosing the Hide command
Invisible content Objects you have formatted as invisible
By default, Excel will search for all hidden and personal content - uncheck any items you do not
wish to locate
Click on Inspect
Excel will alert you of any content that has been found. You can remove any items by clicking on the
Remove All button next to the item that has been found.
Click on Reinspect to ensure all hidden and personal information has been removed
Click on Inspect
When all items are ticked, click on Close
Note: Take care when using the Inspect command as you may end up losing data. If you remove a hidden
column or row, for example, the data in this column or row will be deleted and you will not be able to undo the
command.
Restricting Permissions
You can restrict permission on a workbook that you store on a shared drive to specify exactly which
users can view or edit the workbook. In order to be able to set restrictions, your organisation will need
to have a rights management server in place.
Enter the email address of each person you wish to be able to make changes to the workbook.
Anyone not listed in this or the Read box will not be able to open the file
Click on the Check Name button to ensure the email addresses have been entered correctly
Click on More Options
To set an expiry date for the file, on which all permissions will end, click on the This workbook
expires on check box, then on the drop-down arrow under this. Choose the date on which the file
will expire
Click on OK
A banner will display above the formula bar, showing that the workbook has restricted permission.
When you open a file that has permissions set, you will be prompted that your credentials will be checked.
Click on OK to see if you have permission to view the file.
If you have permission to view or open the file, the workbook will be displayed with a banner showing it has
restricted access:
To see your permissions for the file, click on the View Permission button:
Click on the Request Additional Permissions link to send an email message to the owner of the file. In the
email message, specify why you need full permission, then send the message as normal.
Protecting Worksheets
By protecting a worksheet you are protecting the data stored in the worksheet.
When a worksheet is protected, no numbers, text or formulas can be typed or edited in the cells of the
sheet. In addition, you can specify other content and formatting to be protected, for example:
To protect a worksheet:
Choose each task that users will be able to perform after protection - by default they will only be
able to select cells
If you wish to add a password, click in the Password box and type this. This will mean that the
sheet can only be unprotected if the password is given
Click on OK
Before protecting the sheet, any number of worksheet ranges can be unlocked so that they remain
unprotected when sheet protection is applied.
Repeat the above 4 steps for each range you wish users to be able to edit
Click on Protect Sheet to protect the worksheet when all edit ranges have been set
You can also specify a range to be unlocked after protection by selecting the range and pressing [Ctrl 1] to show
the Format Cells window. Click on the Protection tab, then remove the check from the Locked box. Click on
OK.
Unprotecting Worksheets
If you entered a password during protection, type this password in the dialog box displayed
Click on OK
Protecting Workbooks
Workbook protection is used to stop the workbook's structure from being changed. Once a workbook
has been protected, users will not be able to:
To protect a worksheet:
Unprotect the workbook by clicking on the Protect Workbook button on the Review ribbon and
choosing Protect Structure and Windows again. If you entered a password during protection, type
this password in the dialog box displayed and click on OK.
The document workspace task pane will display, with the name of the workbook set as the Document
Workspace name by default.
Click in the Document Workspace Name box and edit the name of the workspace if required
Click in the Location for new workspace and type the URL of the Sharepoint site you wish to
create the workspace in
Click on Create
Excel will create the new document workspace, showing progress of the operation:
When the workspace is created, the Document Management task pane will show the number of
users, tasks, related documents and links in the document workspace.
Click on the Open Site in Browser link in the Document Management task pane to open the
document workspace in Sharepoint in your browser.
To save the local copy of the workbook, click on the Save button on the Quick Access Toolbar
Choose the Document Management Information option to show the Document Management
task pane
On the task pane, click on the Update Workspace Copy link
The file will be uploaded to the server and the task pane will show that the document is up-to-date.
Data Consolidation
Data that is typed in more than one sheet or workbook can be consolidated to form a single summary.
The data can be consolidated by position or by category. This means that data can be consolidated
regardless of how it is arranged in the individual sheets.
Option Description
By Position This is used if all ranges to be consolidated are laid out in exactly the same way,
and all contain the same amount of data
By Category This is used if the ranges have the same headings but different amounts of data in
different orders
For example:
To consolidate data:
Add all ranges in this way. If the data in each range is not arranged in an identical way, choose
the category by which you wish to consolidate:
Choose Top Row if the first row of each range contains the same labels, even if these are typed
in a different order
Choose Left Column if the first column of each range contains the same labels
To link to original data, so that any changes are reflected in the summary, check Create Links to
Source Data. This makes the summary file larger as each individual figure is copied and linked,
rather than the totals only
Choose OK to insert the summary on the current sheet
For the example above, the left-hand column contains the same labels in each sheet, so the
consolidate will be carried out using these.
Data Validation
Data validation allows you to specify the values or text that can be entered into specific cells. Error
messages will appear if invalid data is entered.
Setting Validation
Setting Description
Whole Allow only values without decimal places. A minimum and maximum allowed value
Number can be specified.
Decimal Allow any values with or without decimal places. A minimum and maximum allowed
value can be specified.
List Allow one of a specified list of values to be selected. The list of values should be
entered in a column of the same worksheet, this range is specified in the Source
box.
Date Allow only a date be entered. A minimum and maximum allowed date can be
specified
Time Allow only a time to be entered. A minimum and maximum allowed date can be
specified
Setting Description
Text Allow letters, numbers and symbols to be entered with a minimum and maximum
Length length if required
Custom Enter a formula that must be true for the data to be allowed e.g.
=A1>AVERAGE(C1:C5) to ensure the value in A1 is greater than the average of the
values in C1:C5
The following settings would only allow the values North, South, East or West to be entered in the cell.
When the cell is clicked, a drop-down arrow will display from which a value can be selected:
Error Messages
There are two types of error messages that can be specified for cells that have validation applied.
The Input Message will appear any time a validation cell is selected, even before data is
entered into the cell
Error Alert messages appear when data is typed that does not meet the criteria
Example Description
Stop If data is typed that does not meet the validation criteria, it will not be entered into
the cell. A message will display with a Retry button that can be used to enter new
data into the cell, or a Cancel button to stop the operation
Warning If data is typed that does not meet the validation criteria, a message will display
with Yes and No buttons. If the user clicks on Yes, the data will be entered even
though it is invalid. Clicking on No will stop the operation
Information If data is typed that does not meet the validation criteria, a message will display
with OK and Cancel buttons. Clicking on OK will enter the value into the cell,
clicking on Cancel will stop the operation
To disable the input or error message, remove the check from the Show box on the appropriate tab.
For Example:
Would show as follows when an invalid entry is typed into the cell:
If you apply validation to your cells, you can use the circle invalid data option to see if any existing cells are
invalid.
Click on the drop-down arrow of the Data Validation button on the Data ribbon
Click on the Circle Invalid Data command
To remove validation circles from the worksheet, click on the Data Validation button on the Data ribbon, then
on the Clear Validation Circles command.
Excel 2007 uses a Web feature called "round tripping". Files saved in HTML format can be re-opened
in Excel without losing any of the original formatting of the workbook.
To allow for this feature, each file saved in HTML format will have an accompanying folder of the
same name, containing related HTML pages. It is important to remember that moving the HTML file
without the related folder could result in errors in the web pages - always keep the file and folder
together in the same location.
To change the page title, which will appear in the browser's title bar, click on Change Title and
amend as required. Click on OK
You can now view the HTML file in any web browser e.g. Internet Explorer. Double-click on the HTML file to
launch your default web browser and display the page.
Creating Themes
You can customise Excel's default themes to hold your own choice of colours, fonts and effects.
Themes can be customised if they don't follow the exact format that you require.
To change the colours of the theme:
Click on the drop-down arrow of the Colors box and choose a colour scheme for the theme
To create a new colour scheme, click on the Create New Theme Colours option
Type a name for the new colour scheme in the Name box
Click on the drop-down arrow next to each theme colour and choose a new colour for that
element. To enter a custom colour using RGB values, choose More Colours then the Custom
tab. Enter the RGB values in the Red, Green and Blue boxes, then click on OK
Click on Save when all colours have been entered
Click on the drop-down arrow of the Fonts box and choose a font set to use
To choose non-standard fonts, choose the Create New Theme Fonts option
Type a name for the font set in the Name box
Click on the Heading Font drop-down arrow and choose the font to use for headings in the
worksheet
Click on the Body Font drop-down arrow and choose the font to use for standard text in the
worksheet
Click on Save
When all theme elements have been changed, save the theme as follows:
Click on the drop-down arrow of the Themes button and choose Save Current Theme
Enter a name for the theme in the File Name box
Themes are stored in the Document Themes subfolder of your AppData folder by default - click
on Save to save the theme
When you apply a theme, it will be applied to all sheets in the current workbook, regardless of the sheet you are
on when you choose the command.
If your saved theme is listed at the top of the themes list, click on this now to apply the theme to the
workbook
If your saved theme is not listed, click on the Browse for Themes option
The theme will be applied automatically and will now be listed in the Custom section of the theme list for further
use.
Click on the drop-down arrow at the end of the Quick Access toolbar
Choose More Commands
Choose the category you wish to see commands from e.g. Popular Commands or Commands
not in the Ribbon
Scroll down the list of commands to find the one you wish to add to the Quick Access toolbar
Select the command you wish to add
Click on the Add button
To move the command up - towards the left of the Quick Access toolbar - click on the Up arrow
To move the command down - towards the right of the Quick Access toolbar - click on the Down
arrow
Continue adding commands as required
Click on OK when complete
Recording Macros
A macro is a collection of Excel commands that can be run automatically by clicking on a button or
pressing a keystroke. Macros are used to automate tasks and should be used whenever a series of
commands will be executed repeatedly over a period of time.
The workbook in which the macro will be run. This workbook must be open for the macro to
be available for use
The Personal Macro Workbook - a library of global macros that can be run from any
workbook. This file is named personal.xlsb and is stored in the xlstart subdirectory under
\appdata\roaming\microsoft\excel in your user folder
In order to record and work with macros in Excel, you need to enable the advanced settings by showing the
Developer ribbon. To do this:
Recording Macros
The easiest way to create a macro is by recording it. Macros can be recorded by manually carrying out the
steps you wish the macro to hold.
First, ensure correct cell is the active cell - you may not want to record the selection of a cell. Before
recording macros, it is a good idea to ensure the option to move the cell down on [Enter] is switched off.
This ensures unnecessary selection commands are not recorded unintentionally.
To do this, click on the Office button, then on the Excel Options button. Click on the Advanced menu on the
left-hand side, then uncheck the After pressing Enter, move selection box.
Type a name for the macro - this should contain no spaces but can be up to 255 characters in
length
Click in the Shortcut Key box and enter a shortcut key that can be used to run the macro - this is
useful even if just for testing purposes. To avoid overwriting any of Excel's standard shortcuts,
type a capital letter in this box. This will mean the macro will run when [Shift], [Ctrl] and that letter
is pressed
Click on the drop-down arrow of the Store Macro In box and choose the location for the macro
Type a Description of the macro and its purpose
Click on OK to start recording the macro
The status bar will indicate that Excel is now recording all of your actions:
Relative Recording
The default macro recording method uses absolute referencing. This means that when cells are
selected during recording, the actual cell references are recorded and the macro will always operate
on those fixed cells.
If a macro is recorded using relative references, cell references are recorded relative to the
previous active cell.
For Example:
Cell A1 is active when the macro recording is started. During recording, cell C3 is clicked.
There are 2 ways in which this macro could be recorded - using absolute or relative recording.
Depending on the method used, a different result will be given when the macro is executed.
Method Result
Absolute recording Whatever the active cell when the macro is executed, cell C3 will always
be selected. If the macro is executed from cell A200, for example, cell
C3 will still be selected during the macro.
Relative recording Whenever the macro is executed, the cell 2 columns across and 2 rows
down from the active cell will be selected. If the macro is executed from
cell A200, for example, cell C203 will be selected during the macro.
As the default recording method uses absolute references, you need to switch manually to relative
recording if this method is required. It is possible to toggle between the two recording methods during
macro recording.
Click on the Use Relative References button on the Developer ribbon to turn relative recording on
Click on the button again to return to absolute recording
Running Macros
Before a macro is assigned to a button, object or keystroke, it can be run in the following way:
Click on the Macros In drop-down list and choose the location where your macro is stored
Choose the required macro name from the list displayed
Click on Run
Press [Alt F8] at any time to display the list of macros available to be executed.
Click on the drop-down arrow at the end of the Quick Access toolbar
Choose More Commands
Click on the drop-down arrow of the Choose commands from list and choose Macros
Choose the macro you wish to add to the toolbar
Click on the Add button
To move the command up - towards the left of the Quick Access toolbar - click on the Up arrow
To move the command down - towards the right of the Quick Access toolbar - click on the Down
arrow
To choose a new image for the button on the toolbar, click on macro in the list of commands
added to the toolbar, then click on Modify
You can now click once on the button on the Quick Access toolbar each time you wish to run the macro.
Click on the Macros In drop-down list and choose the location where your macro is stored
Choose the required macro name from the list displayed
Click on Options
Click in the Shortcut Key box and type a letter to combine with [Ctrl] to run the macro. Enter an
upper case letter to combine this with [Ctrl] and [Shift] to run the macro
Click on OK
Creating Forms
You can add form elements to any workbook to add form functionality e.g. buttons, text boxes, radio
buttons and check boxes.
You can link form controls to the cells of your worksheet, to record the values entered and perform
calculations based on the user's choices.
Type the values in a separate range of the workbook, away from the form or on another sheet
Hold [Ctrl] and click on the list or drop-down list to select it
Click on the Developer ribbon
Click on the Properties button in the Controls group
Click in the Input Range box then drag over the list of values to make up the list
Click on OK
When you select an option from a form control e.g. a value from a drop-down list, the corresponding values
will be shown in the linked cells. If you'd rather show the selected value to its number, you can do this by
entering a formula into a cell.
You can do this by adding the corresponding value next to each option in the drop-down list value range. If
the range showed town names, for example, add a value to each town name as follows:
You can now use the VLOOKUP function to find the corresponding value in the list.
In the following example, cell A1 is the linked cell for the form control, while the values displayed in the
drop-down list are in cells B3:B7.
Saving Templates
Templates are master copies of workbooks that contain standard text and formatting. These standard
elements are applied automatically whenever a new workbook is created from that template.
Creating Templates
A new template can be created by adding all of the required elements to a new workbook e.g. standard
text, page setup and other formatting.
Ensure all standard text has been typed and any formatting options to be saved in the template
have been applied
Click on the Office button and choose Save As
Click in the File Name box and enter a name for the template
Change Save As Type to Excel Template - the default template folder will be displayed
Click on Save
If your template contains macros, change the Save as Type box to Excel Macro-Enabled Template when
saving.
Using Templates
There are two default templates that can be created in Excel 2007:
Name Description
Book The default template to be used each time a new workbook is created
Sheet The default template to be used each time a new worksheet is inserted into the current
workbook
Create a new workbook and add any features to be saved with the default template
Add or remove worksheets as required. If you are creating the worksheet template, this should
contain only a single sheet.
Click on the Office button and choose Save As
Click in the Save as Type box and choose Excel Template
The default Template folder will be selected automatically - use the navigation trail to locate the
default startup folder which is usually AppData\Roaming\Microsoft\Excel\XLSTART in your user
folder
Click in the File Name box and type the name for the template - Book for the default workbook or
Sheet for the default worksheet
Click on Save
Ensure the sheet template only contains a single sheet. If it contains 3 sheets, three sheets will be added each
time the Insert Worksheet command is used.
Macro Security
A macro virus is a virus stored within a macro in a workbook or template. When you open the workbook
and execute the macro, either knowingly or by accident, the virus will be activated and stored in your main
Excel template. After this has occurred, each workbook you open is in danger of being infected by the virus
- and it is possible for you to transfer the virus to other user's computers by emailing workbooks or saving
files on shared network drives.
For this reason, Word Excel offers a number of security levels for the treatment of files containing macros.
Level Description
Very High Unsigned macros are disabled, and signed macros are only enabled if installed in a
trusted location
High Unsigned macros are disabled while signed macros are enabled
Medium If the macro is unsigned, the user will be prompted as to whether they wish to enable
or disable the macro. Signed macros are automatically enabled
Low All macros, signed or unsigned, are enabled
If you have virus scanning software installed on your computer that is compatible with Office 2007, all macros
will be scanned for viruses before they are enabled. For this reason, it is always recommended to work only on
a computer that has an active up-to-date virus scanning application.
Choose the macro to be assigned to the button from the list displayed
Click on OK
Before clicking away from the button, drag the mouse over the default button text and enter new
text to appear on the button
Click away from the button when complete