Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2...

98
Spreadsheets: Creating professional spreadsheets

Transcript of Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2...

Page 1: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional

spreadsheets

Page 2: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets TMSE2

IT Learning Programme ii

Page 3: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

TMSE2 Spreadsheets: Creating professional spreadsheets

iii IT Learning Programme

How to Use this User Guide This handbook accompanies the taught sessions for the course. Each section contains a brief overview of a topic for your reference and then one or more exercises.

Exercises are arranged as follows:

A title and brief overview of the tasks to be carried out;

A numbered set of tasks, together with a brief description of each;

A numbered set of detailed steps that will achieve each task.

Some exercises, particularly those within the same section, assume that you have completed earlier exercises. Your teacher will direct you to the location of files that are needed for the exercises. If you have any problems with the text or the exercises, please ask the teacher or one of the demonstrators for help.

This book includes plenty of exercise activities – more than can usually be completed during the hands-on sessions of the course. You should select some to try during the course, while the teacher and demonstrator(s) are around to guide you. Later, you may attend Course Clinics at the IT Learning Programme, where you can continue work on the exercises, with some support from IT teachers. Other exercises are for you to try on your own, as a reminder or an extension of the work done during the course.

Text Conventions A number of conventions are used to help you to be clear about what you need to do in each step of a task.

In general, the word press indicates you need to press a key on the keyboard. Click, choose or select refer to using the mouse and clicking on items on the screen. If you have more than one mouse button, click usually refers to the left button unless stated otherwise.

Names of keys on the keyboard, for example the Enter (or Return) key are shown like this: ENTER.

Multiple key names linked by a + (for example, CTRL+Z) indicate that the first key should be held down while the remaining keys are pressed; all keys can then be released together.

Words and commands typed in by the user are shown like this.

Labels and titles on the screen are shown l ike th is .

Drop-down menu options are indicated by the name of the options separated by a vertical bar, for example Fi le|Pr int . In this example you need to select the option Print from the Fi le menu or tab. To do this, click when the mouse pointer is on the Fi le menu or tab name; move the pointer to Print ; when Print is highlighted, click the mouse button again.

A button to be clicked will look l ike th is .

The names of software packages are identified like this, and the names of files to be used l ike th is .

Page 4: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets TMSE2

IT Learning Programme iv

Software Used Excel 2013

Files Used Budget .x lsx Budget part ia l1, 2 and 3.x lsx Cars .x lsx Cars part ial1 and 2.x lsx FlashFi l l .x lsx funct ions .x lsx funct ions part ia l1, 2 and 3.x lsx overv iew .xlsx overv iew part ia l1, 2, 3 and 4.x lsx pr int ing .x lsx ranking .x lsx resi t t ing .x lsx resi t t ing part ia l1, 2, 3 and 4.x lsx resul ts .x lsx results part ia l1, 2 and 3.x lsx

Revision Information

Version Date Author Changes made

1.0 July 2014 Pamela Stanworth Created

2.0 June 2015 Pamela Stanworth Revised for Office 2013

Copyright

Pamela Stanworth makes this document and the accompanying PowerPoint presentation available under a Creative Commons licence: Attribution-NonCommercial-ShareAlike CC BY-NC-SA

Individual resources are subject to their own licencing conditions as listed.

Screenshots in this document are copyright of Microsoft.

The Oxford University logo and crest is copyright of Oxford University and may only be used by Oxford University members in accordance with the University’s branding guidelines.

Page 5: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

TMSE2 Spreadsheets: Creating professional spreadsheets

v IT Learning Programme

Contents 1 Introduction .................................................................................................. 1 

1.1 What You Should Already Know .............................................................................. 1 

1.2 What Will You Learn? .............................................................................................. 1 

1.3 Using Office 2013 .................................................................................................... 2 

1.4 What is Excel? ......................................................................................................... 2 

1.5 Where Can I Get A Copy? ....................................................................................... 3 

2 Finding Your Way Around (Optional Revision) ......................................... 4 

2.1 Working with Excel ................................................................................................. 4 

2.2 Keyboard Shortcuts ................................................................................................ 5 

2.3 Features of the Excel Window ............................................................................... 5 

2.4 The Active Cell ........................................................................................................ 6 

3 Working with Formulae .............................................................................. 8 

3.1 Creating a Formula (Optional Revision) ................................................................ 8 

3.2 Cell Contents and Results ....................................................................................... 8 

3.3 Brackets in Formulae ............................................................................................. 9 

3.4 Copying a Formula ................................................................................................. 9 

3.5 Cell References Adjust When A Formula is Copied ............................................. 10 

3.6 For Fixed Locations, Use Absolute References .................................................... 10 

3.7 Absolute References Compared with Relative References .................................. 10 

3.8 Mixed References .................................................................................................. 12 

3.9 Ways of Changing a Reference to be Absolute ...................................................... 12 

3.10 Flash Fill for Data that Follows a Pattern ........................................................... 12 

4 Names ........................................................................................................ 14 

4.1 Why Set Up Names in a Worksheet? ..................................................................... 14 

4.2 Defining a Name for a Cell or Range ..................................................................... 14 

4.3 Create Name Tool for a Cell or Range ................................................................... 15 

4.4 Using Names for Navigating Around a Workbook ............................................... 15 

4.5 Using Names in Formulae ..................................................................................... 16 

4.6 Applying Names .................................................................................................... 17 

4.7 Pasting a List of Names ........................................................................................ 18 

4.8 Name Manager ...................................................................................................... 19 

4.9 Effect of Inserting Data Cells in a Named Range ................................................. 19 

4.10 Using a Named Constant ..................................................................................... 19 

Page 6: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets TMSE2

IT Learning Programme vi

5 Functions ................................................................................................... 21 

5.1 The SUM Function ................................................................................................. 21 

5.2 The AVERAGE Function ...................................................................................... 22 

5.3 The Insert Function Dialog .................................................................................. 22 

5.4 Some More Popular Functions ............................................................................. 23 

5.5 Generating Random Numbers to Test a Workbook ............................................ 23 

5.6 Nesting and Combining Functions in Formulae .................................................. 24 

6 Formatting Spreadsheet Data ................................................................... 25 

6.1 Percentages ........................................................................................................... 25 

6.2 Currency ............................................................................................................... 25 

6.3 Increasing and Decreasing Decimal Places ......................................................... 25 

6.4 More Number Formats ........................................................................................ 26 

7 Dates and Times ........................................................................................ 28 

7.1 Date Formats ......................................................................................................... 28 

7.2 Dates and Times as Numbers in Calculations ...................................................... 28 

7.3 Date functions ....................................................................................................... 28 

7.4 Flash Fill for Dates and Times .............................................................................. 29 

8 Logic Functions ......................................................................................... 30 

8.1 OR ......................................................................................................................... 30 

8.2 AND ...................................................................................................................... 30 

8.3 IF ........................................................................................................................... 30 

8.4 Formulae that Combine AND and OR and IF ...................................................... 31 

9 Large Worksheets ...................................................................................... 32 

9.1 Split Screen and Freeze Panes .............................................................................. 32 

9.2 Printing Part of a Worksheet ................................................................................ 32 

9.3 Print Area .............................................................................................................. 33 

9.4 Print Titles ............................................................................................................ 34 

10 A Workbook with Multiple Worksheets .................................................. 37 

10.1 Workbooks with Multiple Sheets ........................................................................ 37 

10.2 Switching Between Sheets .................................................................................. 37 

10.3 Renaming a Worksheet ...................................................................................... 37 

10.4 Adding and Deleting Sheets ............................................................................... 37 

10.5 Rearranging Worksheets .................................................................................... 38 

10.6 Group Editing – Working on Multiple Sheets Together .................................... 38 

11 Calculations Across Many Worksheets .................................................... 40 

Page 7: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

TMSE2 Spreadsheets: Creating professional spreadsheets

vii IT Learning Programme

11.1 Formula That Takes Data From Another Sheet .................................................. 40 

11.2 Entering a 3-D Reference in a Formula .............................................................. 40 

11.3 Functions Which Can Use a 3-D Range ............................................................... 41 

11.4 Names and 3-D Ranges ........................................................................................ 41 

12 What Next? ............................................................................................... 43 

12.1 Course Which Precedes This ............................................................................... 43 

12.2 Other Courses in Spreadsheets and Statistical Analysis .................................... 43 

12.3 Courses in Programming Languages .................................................................. 43 

12.4 Course Clinics ..................................................................................................... 43 

12.5 Downloadable Course Materials and More – the ITLP Portfolio ...................... 43 

12.6 Further Help ....................................................................................................... 44 

Appendix: Student Exercises ........................................................................ 45 

Page 8: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets TMSE2

IT Learning Programme viii

Exercises Exercise 1  Creating a formula (Optional revision) ............................. 45 

Exercise 2  Copying formulae ............................................................... 47 

Exercise 3  Copying a formula with an absolute reference .................. 48 

Exercise 4  Entering data using Flash Fill ............................................ 49 

Exercise 5  Naming a cell or range ....................................................... 50 

Exercise 6  Naming a range using the Create Name tool ..................... 52 

Exercise 7  Using a name in a formula ................................................. 53 

Exercise 8  Applying names .................................................................. 53 

Exercise 9  Paste Names (Optional) ..................................................... 54 

Exercise 10  Creating a named constant (Optional) .............................. 55 

Exercise 11  Using a formula to sum a column (Optional revision) ..... 57 

Exercise 12  Using functions to calculate averages and counts ............. 58 

Exercise 13  Using random numbers to populate a worksheet ............. 59 

Exercise 14  Percentages ......................................................................... 61 

Exercise 15  Currency ............................................................................. 62 

Exercise 16  Displaying numbers with decimal places .......................... 63 

Exercise 17  Working with date formats ................................................ 64 

Exercise 18  Calculating with dates ........................................................ 65 

Exercise 19  Functions for working with dates ...................................... 66 

Exercise 20  Using OR and AND functions ............................................ 68 

Exercise 21  Using IF for a logical test ................................................... 69 

Exercise 22  More formulae using IF ...................................................... 71 

Exercise 23  Printing part of a worksheet .............................................. 72 

Exercise 24  Setting print titles ............................................................... 73 

Exercise 25  Organising multiple sheets in a workbook ........................ 75 

Exercise 26  Managing sheets in a workbook ......................................... 76 

Exercise 27  Editing grouped worksheets .............................................. 77 

Exercise 28  Using a 3-D reference in a formula .................................... 78 

Exercise 29  Using names for multi-sheet ranges .................................. 80 

Page 9: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

1 IT Learning Programme

1 Introduction Welcome to the Spreadsheets: Creating professional spreadsheets course.

This booklet accompanies the course delivered by Oxford University’s IT Learning Programme. Although the exercises are clearly explained so that you can work through them independently, you will find that it will help if you also attend the taught session where you can get advice from the teacher, demonstrator(s) and even each other!

If at any time you are not clear about any aspect of the course, please make sure you ask your teacher or demonstrator for some help. If you are away from the class, you can get help by email from your teacher or from [email protected].

1.1 What You Should Already Know We expect you to have a level of experience in Excel that would be gained from the Excel part of the course Office: Fundamentals. You should be able to open and navigate around a workbook using the mouse and scrollbars, use the help function, add data to cells, and select and amend such data. You should also be able to create a formula that calculates using values found in other cells.

We will also assume that you are familiar with opening files from particular folders and saving them, perhaps with a different name, back to the same or a different folder.

The computer network in our teaching rooms may differ slightly from that which you are used to in your College or Department; if you are confused by the differences please ask for help from the teacher or demonstrator(s).

1.2 What Will You Learn? This course will help you learn to use a spreadsheet such as Excel to arrange data and calculations that are efficient and clear to work on. You will work with large workbooks and those with multiple layers (3 dimensions).

In this session we will cover the following topics:

Working with formulae

Calculating using functions as well as operators

Flash Fill

Formatting the results to make them understandable

Naming cells, ranges and constants

Functions for logic

Dates and times

Large worksheets

Working with multiple sheets

Consolidation (3-D) calculations

These notes deal with Excel 2013 using Windows. Having worked through these notes, you should also be able to adapt to other versions including Excel for Mac, since most of the principles hold true regardless of the version of the software.

Page 10: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 2

Getting to grips with a package as sophisticated and powerful as Excel can be time-consuming, so allow yourself plenty of time for practice. To increase your understanding of Excel, make use of its built-in Help.

In these notes, topics marked Optional are additional material which may not necessarily be covered by your lecturer in the taught course. Depending on the work you need to use Excel for, you may find some of these extra topics helpful. For further information on these, consult Excel’s Help.

1.3 Using Office 2013 If you have previously used another version of Office, you may find Office 2013 looks rather unfamiliar. “Office 2010: What’s New” is a self-study guide covering the ribbon, Quick Access Toolbar and so on. This can be downloaded from the ITLP Portfolio at http://portfolio.it.ox.ac.uk.

For anyone who prefers not to use the mouse to control software, or who finds a keyboard method more convenient, it is possible to control Office applications without using a mouse. Pressing ALT once displays a black box with a letter or character next to each visible item on the ribbon and title bar (shown in Figure 1).

Figure 1 Keystrokes to Control Ribbon Tabs and Title Bar (Press ALT to Show These)

After you have typed one of the letters/characters shown, the relevant ribbon tab or detail appears, with further letters/characters for operating the buttons and controls.

The elements of a dialog can be controlled, as usual with Windows applications, by using TAB to navigate between items or typing the underlined character shown beside an item.

1.4 What is Excel? Excel 2013 is part of the Microsoft Office 2013 package. Spreadsheets allow you to present and analyse data in a wide variety of ways and Microsoft Excel is perhaps the world’s most popular spreadsheet application.

Page 11: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

3 IT Learning Programme

1.5 Where Can I Get A Copy? If you have a copy of Microsoft Office, then you already have a copy of Excel. If you are unable to find it on your computer, it may not have been installed and you should talk to your IT support contact (or the IT Services Help Centre).

If you are a member of staff, you can obtain a copy of Microsoft Office from the IT Services on-line shop. Students can obtain a Microsoft Student Licence, but this must be bought through a Microsoft Authorised Education Reseller; the IT Services shop can direct you to a suitable reseller.

Page 12: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 4

2 Finding Your Way Around (Optional Revision) Excel shares many features which are common to Windows applications. These may already be familiar:

The title bar at the top of the Excel window

Window control buttons at the right edge of the title bar, for minimizing, restoring (or maximizing as appropriate) and closing the Excel window

The ribbon with tabs such as Fi le , Home , Insert , Formulas and Data : each ribbon tab contains buttons to perform different functionalities

Shortcut menus that appear when you right-click in an area on the screen or on an object

The Quick Access Toolbar, also known as the QAT, is a small toolbar that appears at the top left-hand corner of the Excel window. It provides access to the commands you use frequently, such as Save, and includes by default the Undo and Redo buttons.

Scroll bars for moving sideways or up/down where the work is too large to see on the screen all at once

The status bar - at the bottom of the Excel window.

2.1 Working with Excel

Alternative Methods of Choosing Commands As with any Windows application, there are several methods available for communicating with Excel. Commands may be given in the following ways:

Choose a command from the ribbon (e.g Home tab then Copy button). The ribbon tabs offer a comprehensive list of the commands and options available in Excel.

Choose a command from a context menu (e.g. click the right mouse button and select Copy.) Note that the options available from the context menu vary according to the position of the mouse pointer.

Press the appropriate keystrokes (e.g. CTRL+C to copy).

Which Method to Use? These methods are equivalent, and you should use whichever is convenient to you. In these notes, we will give the ribbon buttons or commands needed for the exercises, without listing all the alternatives.

Customising the Quick Access Toolbar Appearing immediately to the right of the Quick Access Toolbar , the Customise Quick Access Toolbar tool displays a list of commonly-used commands that you can add to the toolbar. You can select the items that you want to add. The ticks that appear to the left of the menu options show you that an option is already displayed. See Figure 2.

Page 13: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

5 IT Learning Programme

Figure 2 Customising the Quick Access Toolbar

You can add any command tool you like to the toolbar by selecting More Commands to display the Excel Opt ions dialog. From here you can choose commands or tabs to add to the ribbon. You can even move the Quick Access Toolbar below the ribbon if this suits the way you work.

2.2 Keyboard Shortcuts For information on keyboard functions and which key combinations perform which function, type Function Keys in the Help text box and choose Keyboard Shortcuts .

2.3 Features of the Excel Window A typical workbook screen that appears when you start Excel is shown in Figure 3. Please try to familiarise yourself with the labelled parts of the screen and their function. Use the Help facility.

Page 14: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 6

Figure 3 The Excel workbook screen

2.4 The Active Cell The cell where you are currently positioned in the worksheet is known as the act ive cel l . This is identified by its thickened borders. This is the cell that is altered if you type in data or give a command. Cell B3 is the active cell Figure 4.

Formula Bar

File tab

Name Box

horizontal scrollbar

ribbon

vertical scrollbar

Page 15: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

7 IT Learning Programme

Figure 4 Active cell

Page 16: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 8

3 Working with Formulae

3.1 Creating a Formula (Optional Revision) A formula is used to calculate results. It may be entered in much the same way as data are entered, by a combination of typing and point-and-click.

Arithmetic operators used in Excel are:

+ add

- subtract

* multiply

/ divide

^ power for example =3^2 will calculate 3 to the power of 2, or 3 squared, which is 9

Pairs of brackets (like these) can clarify which parts of a complicated formula should be calculated first: it is a good practice to use plenty of brackets when entering a formula, and Excel will drop any pairs that are redundant. As you are building the formula the bracket symbols glow with colours to clarify which ones go together in a pair.

3.2 Cell Contents and Results Cell contents, which may be a formula, are shown in the Formula Bar when the cell is selected, and the result is shown in the cell.

Cell results recalculate immediately after a cell is edited.

Figure 5 Entering a formula

Page 17: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

9 IT Learning Programme

Exercise 1: Creating a formula (Optional revision) Now look at this exercise (page 45).

3.3 Brackets in Formulae For all but the simplest formulae, it is worth using brackets to clarify the order to carry out the parts of the calculation.

Using a number example may clarify this: consider the formula =6+9/3. Do we expect Excel to add the 6 and the 9, then divide the answer by 3 (making 15/3 which gives the answer 5), or do we expect Excel to divide 9 by 3 and then add the result to 6 (making 6+3, giving 9)? With a more complicated formula made up with cell references, range names and functions, it is easy to lose track. For safety, include plenty of pairs of brackets to clarify which parts belong together: if any brackets turn out to be unnecessary then Excel will finally omit them.

While the formula is being created, Excel uses colours to emphasise which brackets are paired together. Watch out for this while you are creating a formula.

3.4 Copying a Formula Worksheets are most useful when arranged to analyse and compare values by performing the same calculation on a whole set of data. For this, you may need a series of formulae which act in the same way on a whole row or column of data.

Using Excel, you only have to provide one instance of the formula. To replicate it to work on a range of data, you have only to copy the original to all the cells where it is needed. A formula can be copied from one cell (or range) to another in various ways, which are equivalent:

Using the Fi l l button on the Home tab of the ribbon (Figure 6)

Or using the Fill Handle (Figure 7)

Or Copy & Paste

Or drag & drop with CTRL

Figure 6 Using the Fill button on the Home tab of the ribbon

Figure 7 Copying a formula using the fill handle

Page 18: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 10

Exercise 2: Copying formulae Now look at this exercise (page 47).

3.5 Cell References Adjust When A Formula is Copied In Figure 7, the formula in the active cell F5 calculates the average of data from other cells in the same row: it contains the formula =(C5+D5+E5)/3 . When that formula is copied down to rows 6, 7 and onwards, notice that any references in the formula to other cells had to be adjusted:

cell F5 F6 F7 F8

formula =(C5+D5+E5)/3 =(C6+D6+E6)/3 =(C7+D7+E7)/3 =(C8+D8+E8)/3

By default, references in a formula are relative, so when the formula is copied the references will all be adjusted. The relative position is maintained between a cell containing the formula and the cells referenced in the formula. Depending on the meaning of the calculations, this may or may not be your intended result.

A relative reference tells Excel how to find another cell, starting from the cell with the formula. So, in the table shown above, Excel will register that starting from the active cell F5 the data it needs will be found in the 3 columns to its left, on the same row.

When the formula from cell F5 is copied into cell F6, the adjusted formula points to cells C6 D6 and E6, and when the formula is copied further into F9, the new formula points to cells C9, D9 and E9, and so on.

3.6 For Fixed Locations, Use Absolute References An absolute reference is one that tells Excel how to find another cell, specifying its exact location in the worksheet grid.

A reference in a formula is made absolute by including $ symbols before the column letter and the row number. If a formula is copied, the absolute references will not be adjusted.

3.7 Absolute References Compared with Relative References A further formula might be devised to express the mean score across the class of students as a percentage of the maximum mark available (suppose these exams were marked out of 120, and this value 120 is found in cell K7):

Page 19: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

11 IT Learning Programme

Figure 8 A formula to calculate mean score as a %

The formula in cell B22 is =B20/K7 , and the calculated result is shown as 42% .

It is tempting to fill or copy this formula across from B22 to C22, D22 etc, to see the results for Exam2, Exam3 and Exam4 as a % of the max mark. However, all the references in the formula would be adjusted: K7 would become L7 or M7 or N7, giving the wrong results.

So before copying the formula from cell B22, we must fix some of the cell references so that they will not be adjusted on copying. This is done by inserting one or more $ symbols in a reference that is not to be adjusted. In other words, edit the relative reference to be an absolute reference. The absolute version of the reference K7 would be $K$7 .

Now when the formula in cell B22 is copied across to columns C D and E, the K7 reference is unchanged (although the B20 reference is correctly changed).

This means that the result of filling across the formula with an absolute reference in cell B22 is:

Figure 9 Using Absolute References in Formulae

Page 20: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 12

Before copying a formula (either across or up/down), it is important to edit some of the cell references so they are not adjusted on copying. $ symbols in front of the column letter and the row number will make the reference absolute: an absolute reference is not adjusted on copying.

3.8 Mixed References In a formula, a mixed reference is one with the dollar sign $ before either the row number or the column letter. For example, $A1 specifies that the column-letter part of the reference is fixed when the formula is copied, whereas A$1 specifies that the row-number part of the reference is fixed when the formula is copied. When such a formula is copied, only the relative part of the reference will change.

3.9 Ways of Changing a Reference to be Absolute $ symbols may be typed as needed, when the formula is being created. Alternatively, use the F4 key: as you type the cell reference into the formula, pressing F4 will change the type of reference. Each time you press F4, the reference type changes in the following order: relative (A1), absolute ($A$1), mixed (A$1), and mixed ($A1).

Exercise 3: Copying a formula with an absolute reference Now look at this exercise (page 48).

3.10 Flash Fill for Data that Follows a Pattern If you need to enter a set of data that follows a regular pattern, Excel may be able to copy the pattern in your data.

This is known as Flash Fi l l , and it may be offered automatically. Alternatively, the command is found from the Home tab:

Figure 10 Flash Fill on the Home tab

Excel detects the pattern as you are entering your data, and offers to fill the next few cells downwards.

Suggested data will be based on the contents of adjacent cells, and appears in grey. If the suggested data is as you require, press ENTER. If not, press DELETE and continue entering data as you do require.

Page 21: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

13 IT Learning Programme

Figure 11 Flash Fill Completes Data Based on a Pattern

In Figure 11, Excel has detected that the address name in column C is made up from the first letter of the text in column B, followed by a full stop and a space, followed by the surname in column A differently capitalized. Flash Fill offers to complete cells C3:C12.

Beware that Flash Fill is a quick way to enter data – text and numbers – into cells, it does not create formulae. If a person’s Surname was edited in column A in Figure 11, the Address Name in column C would not be updated.

Exercise 4: Entering data using Flash Fill Now look at this exercise (page 49).

Page 22: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 14

4 Names

4.1 Why Set Up Names in a Worksheet? You are already familiar with the concept of using names. For example, a filename is used to identify your workbook file when it is saved to disk. A worksheet can be given a name to indicate its contents.

Names are useful because they help to identify a ‘thing’ and, provided a meaningful name has been chosen, help to describe what the ‘thing’ is for. In Excel, as well as giving names to your files and worksheets, you can use names to identify cells and ranges.

Giving names to a cell, or range of cells, is a very useful spreadsheet technique. Once a cell is named, you can refer to it by its name rather than the cell reference. This makes your formulae easier to understand and read: rather than use cell references in your formulae, you can refer to names instead.

The example below illustrates the use of names to complete a worksheet. For help as you progress through this task, press F1 on the keyboard for the appropriate Help dialog box to be displayed.

4.2 Defining a Name for a Cell or Range A name in Excel can have up to 255 characters with no spaces. Names are not case-sensitive. A name can be used once in each workbook.

With the cell or range selected, a name can be defined by simply typing in the Name Box.

Figure 12 Naming a cell

A name cannot be used twice on the same worksheet: two ranges on a worksheet cannot have the same name. Ranges on different worksheets within the same workbook can have the same name, although you may find it less confusing to use different names.

Exercise 5: Naming a cell or range Now look at this exercise (page 50).

Page 23: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

15 IT Learning Programme

4.3 Create Name Tool for a Cell or Range With the Create Name tool, you can identify an area of your worksheet by creating a name based on row or column headings that have already been set up.

Figure 13 The Create Names from Selection dialog

Exercise 6: Naming a range using the Create Name tool Now look at this exercise (page 52).

4.4 Using Names for Navigating Around a Workbook The Name Box (at the left end of the Formula Bar, see Figure 14) displays a list of named areas that have been set up in the workbook. Selecting one of those names moves the active cell to that position and highlights the named area.

This is a useful method of navigation, because it takes you to the named range even if it is on a different worksheet, within the current workbook.

Page 24: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 16

Figure 14 The Name Box

4.5 Using Names in Formulae Once a name has been created, it can be used in a formula instead of the cell reference, to calculate results. The name is entered into the formula either by typing the name from the keyboard or by using (found on the Formulas tab of the ribbon) where you can choose the appropriate name from the list.

For example, =SUM(Winter) totals the contents of all cells in the range called Winter .

Page 25: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

17 IT Learning Programme

Figure 15 Using a cell name in a formula

Exercise 7: Using a name in a formula Now look at this exercise (page 53).

4.6 Applying Names The Apply Names tool is useful if you wish to make use of range names in a formula that has already been created. Apply Names replaces each cell reference in the formula with its defined name.

In our example, the sub-totals in row 11 have already been calculated with formulae that use cell references. For instance, the sub-total of weekly outgoings (cell B11) was calculated by the following formula: =SUM(B4:B10). This formula would be easier to read if it used a name for the range B4:B10.

Once this name has been assigned, the Apply Names tool replaces the cell reference in that formula with the appropriate name. For example:

=SUM(WeeklyCosts)

Figure 16 Using the Apply Names button

Page 26: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 18

Figure 17 The Apply Names dialog

Exercise 8: Applying names Now look at this exercise (page 53).

4.7 Pasting a List of Names Paste Names allows you to paste into your workbook a list of the names that have been defined. The list also shows what range of cells each name refers to. This is very useful for documenting a large, complicated worksheet.

It would be good practice to set up a sheet in each workbook, where you document the work done, explaining any formulae and identifying any assumptions made. This would be a good place to paste a list of the names used.

Figure 18 The pasted list of names with their ranges

Page 27: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

19 IT Learning Programme

Exercise 9: Paste Names (Optional) Now look at this exercise (page 54).

4.8 Name Manager The Name Manager is used to add, edit or delete names. It is found in the Defined Names group of the Formulas tab.

Figure 19 Name Manager dialog

If you want to remove a name which has been defined or created, this is the dialog to use. Once deleted, the name is no longer available for navigating or for using in formulae. The contents of the cell it refers to are unchanged. Any cell with a formula that uses the name now shows an error message.

4.9 Effect of Inserting Data Cells in a Named Range When a worksheet is rearranged, any named ranges will adjust to use the revised range. For example, if rows are inserted partway down a named range, the definition of the name extends accordingly. This is very useful if names have been used in formulae, as the formulae automatically include the augmented range.

4.10 Using a Named Constant Another useful way of using naming is to define a named constant: a constant is a numerical value such as 17.5 or 9.81, and if you are going to use that value frequently it will be worth assigning it a name (eg. VATPercent or Gravity). Then you can use the name in formulae, making them easier for people to understand and edit.

The procedure for creating a named constant is similar to that for creating a named range using , but typing the value for the constant into the Refers to box, instead of giving a cell range. Note: Defining a new name can also be done via the Name Manager (see Part 4.8 above).

Page 28: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 20

Then if the value of the constant does need to change (for example if the VAT rate changes), you can edit the value set for this constant, and all formulae that use the name are immediately updated. It would be tiresome and risky to find every formula in the workbook that uses 17.5 and decide whether or not to edit each one to the new value.

a

Figure 20 Editing an existing named constant

Exercise 10: Creating a named constant (Optional) Now look at this exercise (page 55).

Page 29: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

21 IT Learning Programme

5 Functions Funct ions are pre-defined formulae. Because equations for well-known quantities such as Average and Standard Deviation have already been created as functions in Excel, you do not need to construct the equations, merely include the name of the function in your formula.

A function is used to perform calculations using values that you specify, called arguments : these must be given in a particular order and enclosed in brackets. For example, the SUM function adds a list of values (or ranges of cells containing values).

5.1 The SUM Function

Figure 21 Building a SUM formula

A Formula with SUM by Typing The syntax is =SUM(list of arguments)

The arguments may be actual numbers, or cell references, or ranges, or further formulae that are themselves to be calculated, or a mixture of these. The separator between the arguments in the list is a comma ,

The formula can be typed directly, or cell references can be included by pointing and clicking with the mouse.

When the formula is complete, click the tick on (to the left of the Formula Bar below the ribbon) or press ENTER to accept it.

Page 30: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 22

A Formula with SUM Using the Σ Sigma Tool A typical worksheet layout has a block of cells containing numbers, with totals set out at the bottom of columns and/or at the right-hand end of rows. The Autosum button or on the Home tab inserts a SUM formula conveniently.

Place the active cell where the total is to appear.

Click or on the Home tab of the ribbon.

A formula appears in the current cell, of the form =SUM(A1:A8).

Excel has guessed the range to be summed, a contiguous range of cells that contain values, either above or to the left.

If the suggested range is acceptable, click the tick on (to the left of the Formula Bar below the ribbon) or press ENTER to accept the formula.

Otherwise, click and drag on the worksheet as necessary to edit the range, using CTRL for non-contiguous ranges, then accept the formula.

Exercise 11: Using a formula to sum a column (Optional revision) Now look at this exercise (page 57).

5.2 The AVERAGE Function It is common to calculate the mean of a set of numbers, and a function has been defined for this in Excel. The function name is AVERAGE.

An average formula could be created entirely by typing, or by typing part and indicating the cell ranges by pointing and clicking.

The syntax is =AVERAGE(list of arguments) and items in the list are separated by commas.

5.3 The Insert Function Dialog If you suspect that a suitable function has been pre-defined in Excel, but are unsure of its exact name or syntax, the Insert Funct ion dialog can help with constructing a formula.

First, make active the cell where you want the result of your formula to appear. Choose the Insert Function button from the Formulas tab of the ribbon, or click the fx button on . The Insert Function dialog appears. You can type what you want to do in words, and Excel will search for a suitable function. Alternatively you can choose a category of functions from the drop-down list. One category option is the most-recent ly used functions. You can also find out more about a particular function by clicking on the Help link at the bottom left of the dialog box.

When you have found the function that you need to build your formula, click on it. The next dialog will help you to build your formula, by inserting suitable arguments by typing or by pointing and clicking cells.

Page 31: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

23 IT Learning Programme

Figure 22 Insert Function dialog with Help

5.4 Some More Popular Functions Excel has a large library of ready-made functions. You can explore these using the Insert Function dialog.

=COUNT(range of cel ls) is useful as it reports the number of cells which contain a number. This can provide a good cross-check to reassure you that all the cells which you intended to contain data do indeed contain numbers (as against gaps, punctuation or accidental text such as o instead of 0).

=INT(number or cel l ) reports the integer part of a number. That means the “whole number” part, neglecting any decimal part. So =INT(22.35) would give 22.

Beware that the INT function does not round numbers up: =INT(22.899) would still give 22, even though 22.899 is really closer to 23.

The ROUND function is more flexible: with the extra argument 0 it will round a number to the nearest whole number: =ROUND(22.1,0) would give 22, but =ROUND(22.9,0) would give 23. If you need to round to a certain number of decimal places, give a negative number as the second argument after the comma.

=CONVERT(number or cel l , f rom-uni t , to-uni t ) converts a measurement made in one unit into another unit. Help lists the units that can be converted, including inches to mm or light-years, degrees C to degrees F and plenty more.

Exercise 12: Using functions to calculate averages and counts Now look at this exercise (page 58).

5.5 Generating Random Numbers to Test a Workbook The RAND function provides a useful way of checking and testing your spreadsheet. Use this to populate the workbook with numbers that are plausible,

Page 32: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 24

even when the real data is not yet available. It is good practice to test the formulae and the way the data is managed.

The RAND function is unusual in not requiring any arguments, but it still needs brackets. Entering =RAND() in an empty cell will display a number between 0 and 1.

If the data in your work is likely to be in a different range, you can scale the random numbers by multiplying, or shift them all up (or down) by adding (or subtracting). So the formula =60*RAND() will display a number between 0 and 60, and the formula =40+60*RAND() will display a number between 40 and 100.

Paste Values to stop the test data recalculating Every time a change is made anywhere in the workbook, all cells are recalculated. In the case of the RAND functions, a fresh random number is generated. If this is distracting, a version of Copy and Paste can help: select the cells containing random data and Copy , then use the Paste Values option from the Paste button to paste the values back into the same cells. Now the number values replace the formulae, and they will not recalculate in future when the workbook is edited.

Exercise 13: Using random numbers to populate a worksheet Now look at this exercise (page 59).

5.6 Nesting and Combining Functions in Formulae Several functions or other formula elements can be combined to create a more complex formula. A function can be used as an argument within another function – this is known as nesting.

Although Excel keeps track of the order in which the separate parts of the formula will be performed, this may not always be the order that you intended. So it is good practice to use plenty of pairs of brackets to keep together the parts that need to be together: if you use more brackets than are logically necessary, Excel simply omits the ones that are redundant. Watch out while you are creating a formula for the way that Excel displays brackets that belong together in the same colour.

Page 33: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

25 IT Learning Programme

6 Formatting Spreadsheet Data Excel offers a variety of formatting options - these change the appearance of the worksheet or individual cells, they do not affect the contents or results. Whenever the format of a cell is to be changed, start by first selecting the cell or range to be formatted.

Some basic formatting has been covered in an earlier course (see part 12.2, and try the buttons on the Home tab of the ribbon). It is worth using a moderate amount of formatting to make the worksheet easy to read, so a reader can immediately find their way around and see how the figures relate to one another.

Pre-defined number formats are available in several categories.

Changing the number format changes the way numbers appear in the worksheet. For example, a comma is sometimes used as the separator after the thousands digit, but this is not recognised in all countries and may lead to confusion. Importantly, a change to the format of a cell only affects the way that this cell’s contents are displayed: the value itself is stored in full and there is no loss of precision.

6.1 Percentages A decimal number may be easier to visualise if it is presented as a percentage. For example ¾ is the same thing as 75%. Excel has a button for this format: .

Exercise 14: Percentages Now look at this exercise (page 61).

6.2 Currency is used to apply currency format to selected cells. Sterling is usually

presented with a £ symbol in front, a comma to separate thousands, and 2 decimal places for the pence. Other popular currency formats are found from the button’s menu; for further options use the More Account ing Formats .

Note that by using these formats you are changing the way a number is shown, not converting the value of the currency!

provides a quick way to extract parts of currency figures. Once a column of currencies is in place, Flash Fill can follow a pattern that you set up, such as finding just the whole pounds or just the pence. Note that Flash Fill enters plain data into an adjacent column, it does not set up a formula, so if the data is edited the filled values will not update to match.

Read more about Flash Fill in part 3.10 above.

Exercise 15: Currency Now look at this exercise (page 62).

6.3 Increasing and Decreasing Decimal Places The result of a calculation may appear with many digits after the decimal point. This may be distracting to the reader, so you might choose to format the data with more or fewer decimals. For example, 48.914458 could be rounded to 48.91 or even to 49. You must decide what precision can validly be taken from your raw data.

Page 34: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 26

and provide a quick way to increase or decrease the decimal places displayed. Notice that Excel does not simply omit the last few digits, it correctly rounds the data up or down.

Bear in mind that even if a number is displayed rounded to just a few decimal places, the value is stored in the cell with full precision. The “extra” digits are not lost, they are simply not displayed.

These changes are formats: you are changing the way that data is displayed. This is different from using functions to round data – with a function you are carrying out a calculation (see Part 5.4 above).

6.4 More Number Formats The control in the Home tab of the ribbon offers other categories of number formatting, which you should explore as appropriate for your work:

The Number format dialog is displayed by clicking the launcher in the corner of the Number group on the Home tab. Here you can set variations on the popular number formats, such as an alternative separator for thousands:

Figure 23 Dialog for Number formatting

Page 35: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

27 IT Learning Programme

Exercise 16: Displaying numbers with decimal places Now look at this exercise (page 63).

Page 36: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 28

7 Dates and Times A date in an Excel worksheet is an ordinary number which has been formatted with a special date format.

7.1 Date Formats When a date is typed into a cell, Excel is likely to recognise it and format the cell accordingly. Formats such as 23/12/2014 or 2-Feb-2008 are recognised. As the date is entered into a cell, Excel changes the number format of the cell to one of the date formats, and the cell continues with that format unless you re-format it specifically.

A range of date formats are available among the number formats (click the launcher in the corner of the Number group on the Home tab). If none of the date or time formats provided are suitable, you can build your own custom format by typing characters – simply base your new format on the patterns that are shown in the ready-made formats.

Exercise 17: Working with date formats Now look at this exercise (page 64).

7.2 Dates and Times as Numbers in Calculations Because a date is simply an ordinary number that has been formatted as a date, this means that you can calculate using dates, for example finding how many days between one date and another by subtracting. The date is the number of days since the start of January 1900 (or January 1904 with some older versions of Excel for Mac).

A time is a fraction of a day, for example 6am is a quarter of the way through the 24 hours of a day, so it is equivalent to 0.25.

Exercise 18: Calculating with dates Now look at this exercise (page 65).

7.3 Date functions Excel has a wide range of functions for working with dates.

TODAY() simply reports today’s date (according to the computer clock), and NOW() is the function that reports the current day and time. Note that these are functions which will update, so if you re-open this workbook next week it will report the current date or time on that day. This is different from inserting today’s date as a static date, for example using the keystroke CTRL + ; which once entered does not change.

Other date functions can be found in the Insert Function dialog, in the Date & Time category.

Page 37: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

29 IT Learning Programme

Figure 24 The Insert Function dialog (date category)

7.4 Flash Fill for Dates and Times

Flash Fill can extract parts of a date, such as the year part or the month, if you set up the first row or two in a list of dates. Read more about Flash Fill in part 3.10 above.

Note that Flash Fill simply enters data (numbers and text) not formulae, so if the original data is changed the filled data will not update.

Exercise 19: Functions for working with dates Now look at this exercise (page 66).

Page 38: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 30

8 Logic Functions Logic functions are all about statements being true or false. For example the statement 4>9 is false. The statement D5<20 may or may not be true, depending on what value is in cell D5.

Like other functions, logic functions such as AND, OR, IF require arguments inside brackets. So an expression with a logic function may be unfamiliar to read, as it does not match the word order we usually use in natural speech.

Note that formulae using functions should not usually include spaces – we use spaces in ordinary text, but not in formulae.

8.1 OR The OR function looks at a collection of statements that you specify (inside the brackets, separated by commas) and returns True if any one or more of the statements are true, but False if none of the statements is true.

The syntax is OR(logical1, logical2,. . . ) up to 30 conditions.

For example, the formula =OR(D5<20,Age>18,Status=”Full member”) would give the result True if any or all of the 3 statements inside the brackets is true.

8.2 AND The AND function looks at a collection of statements that you specify (inside the brackets, separated by commas), and returns True if all of the statements are true, but False if any of the statements is untrue.

The syntax is AND(logical1, logical2, . . . ) up to 30 conditions.

For example, the formula =AND(D5<20,Age>18,Status=”Full member”) would give the result True if all 3 of the statements inside the brackets is true, but otherwise would give the result False .

Exercise 20: Using OR and AND functions Now look at this exercise (page 68).

8.3 IF IF is a logic function that displays different results in the cell, dependent on conditions that you set. It will return one value (or text) if a condition you specify evaluates to True and another value (or text) if it evaluates to False .

The syntax is: =IF(test, text if true, text if false)

test an expression that Excel can evaluate, which gives the outcome True or False

text i f t rue text that is displayed in the cell, if the test gave a True outcome

text i f fa lse text that will be displayed in the cell, if the test gave a False outcome

Exercise 21: Using IF for a logical test Now look at this exercise (page 69).

Page 39: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

31 IT Learning Programme

8.4 Formulae that Combine AND and OR and IF One advantage of the IF function is that you can specify the text that will be displayed depending on the outcome (whereas AND and OR display True and False).

Further, several IF functions can be combined or “nested” inside each other. This is useful if there are several possible outcomes.

Be aware there is a limit of seven functions in such a “nest”.

IF , AND and OR can all be used to apply tests to your data, and report on the outcomes. In many situations, you could achieve the same effect using them in various combinations.

It is possible to use the AND and OR functions with the IF function to look at more than one logical test, and to display helpful text results (rather than True and False).

For example, in the car-buying exercises, the formulae given below could be useful. Read carefully through each formula, and see if you agree with them – will each one give a sensible result? It may be helpful to test them with some typical values for the cell D2, such as price=4000, price=5500, price=8000.

=IF(OR(D2<5000,D2>6500),"Outside Price Range","Within Price Range")

=IF(AND(D2>=5000,D2<=6500),"Within Price Range","Outside Price Range")

When both the arguments D2>=5000 and D2<=6500 are t rue , the display is “Within Price Range”. If either of the argument results is fa lse then “Outside Price Range” is displayed.

Exercise 22: More formulae using IF Now look at this exercise (page 71).

Page 40: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 32

9 Large Worksheets

9.1 Split Screen and Freeze Panes A worksheet can easily become too large to fit on the computer screen. Scrolling up & down or left & right may not be convenient and can lead to mistakes.

The Excel window can be split, so that two separate parts are visible side by side. will split the current window into 4 panes, which can be scrolled

independently.

Figure 25 Excel window split into 4 panes

If the split is not in the best place, the grey split bars can be dragged up/down or sideways.

A common problem arises when the top row/s and leftmost column/s contain labels, and it would be best for those to be always visible while the data is

scrolled. For this situation, gives options of freezing the top row or left column or both.

9.2 Printing Part of a Worksheet To print part of a worksheet, you can select a range of cells, and then choose Pr int Select ion in the Print dialog. Only the selected range of cells will be printed – you can confirm this by looking at the Print Preview.

Page 41: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

33 IT Learning Programme

Figure 26 Print Selection

9.3 Print Area Alternatively, you can set a pr int area for each worksheet. Then when you print (or preview) the work, only the range within the print area appears.

Print areas, as well as print titles (below), remain valid for a worksheet until they are removed or changed. Print area definitions are saved with the workbook.

Start by selecting the range to be printed, and then choose Page Layout tab of the ribbon then click on Print Area button and choose Set Pr int Area . Print areas can also be set on the Sheet tab of the Page Setup dialog, mentioned below.

Page 42: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 34

Figure 27 Setting a Print Area

Creating a print area defines part of your worksheet with the name Print Area. To view a print area that has previously been set, click in the Name Box and select the name Print_Area. That part of the worksheet is highlighted accordingly.

A print area can be removed from a worksheet using the same Pr int Area button (choose Clear Pr int Area).

Exercise 23: Printing part of a worksheet Now look at this exercise (page 72).

9.4 Print Titles When a large worksheet is printed, second and subsequent pages may be difficult to interpret, because the labels at the tops of columns and at the starts of rows only appear on page 1.

Page 43: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

35 IT Learning Programme

Figure 28 Print Titles set for row and column headers

These problems can be tackled by setting print titles, so that a specified group of rows and/or columns will be printed on every page. This is very useful, as in the example above it would make a lot of sense to have the invoice numbers and column headings printed at the edges every page, so that we know which number belongs to which invoice.

Print titles have to be set for each individual worksheet. They remain valid for a worksheet until they are removed or changed.

Figure 29 Setting Print Titles

Creating print titles defines a named range: part of the worksheet has the name Print_Ti t les

Page 44: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 36

To view this marked area, click in the Name Box and select the name Print_Ti t les . To unset the titles, clear the Print t i t les boxes in the Page Setup dialog (Sheet tab).

Exercise 24: Setting print titles Now look at this exercise (page 73).

Page 45: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

37 IT Learning Programme

10 A Workbook with Multiple Worksheets

10.1 Workbooks with Multiple Sheets This section focuses on working with multiple worksheets within a single workbook. You will be adding, deleting, renaming worksheets, copying data between worksheets, formatting cells and building formulae in multiple worksheets.

You may find it helpful to make use of the context menus by positioning the mouse pointer over a worksheet tab and clicking the right mouse button. The context menu appears, offering a short list of commands. Then use either mouse button to choose a command.

10.2 Switching Between Sheets Click a worksheet tab to switch to see that worksheet. Keyboard alternatives are CTRL + PAGEDOWN and CTRL + PAGEUP.

10.3 Renaming a Worksheet Giving each worksheet a name is useful: recognisable names help you to quickly identify each worksheet.

Double-click the text on a sheet tab and you will see that the name of the sheet becomes shaded (see Figure 30). This means that the sheet tab has become a text box and you can now overtype with a new name.

The new name appears on the worksheet tab. Worksheet tab names may be up to 31 characters long (including spaces and upper or lower case characters).

Note that although it is possible to include spaces in a sheet name, that can make the formulae difficult later. Good practice is to concatenate text (for example NewResults) or use the underscore character (e.g. N_Ireland).

Figure 30 Renaming a worksheet

Exercise 25: Organising multiple sheets in a workbook Now look at this exercise (page 75).

10.4 Adding and Deleting Sheets By default, a new workbook has one worksheet, but it is easy to add more. To the right of the right-most sheet tab is a New Sheet tab .

Page 46: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 38

in the Cells group on the Home tab of the ribbon has a command to insert a worksheet. The new worksheet appears before the current worksheet.

Figure 31 Inserting a new worksheet

To delete a worksheet, select the sheet and choose the Home tab of the ribbon then choose Delete | Delete Sheet . If you have a number of sheets to delete, group them together first (group editing is discussed in part 10.6 below).

Please note: deleting a sheet removes it permanently from the workbook. The Delete Sheet operation cannot be undone.

10.5 Rearranging Worksheets If worksheets are not in the most convenient order, rearrange them by dragging and dropping a worksheet tab. A small black arrow indicates where the worksheet that is being dragged is likely to be dropped.

Exercise 26: Managing sheets in a workbook Now look at this exercise (page 76).

10.6 Group Editing – Working on Multiple Sheets Together Several worksheets can be selected at the same time, so then any edits will affect all the selected sheets. This is known as grouping.

With one sheet showing, hold SHIFT and click on another sheet tab: both sheets and any that lie between them are all selected.

When more than one worksheet is selected in this way, the word [Group] appears in the title bar and the tabs of all the grouped worksheets appear highlighted. Table 1 summarises the commands that can be used when working with multiple worksheets.

Page 47: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

39 IT Learning Programme

Key Movement

Click on worksheet tab button Select a worksheet

Hold down CTRL and click other worksheet tabs

Select two or more non-adjacent worksheets

Hold down SHIFT and click the first and last worksheet tabs in your selection

Select two or more adjacent worksheets

Hold down CTRL and click on a worksheet tab (not the worksheet that is currently active)

Deselect a worksheet from the group selection

CTRL + PAGEDOWN Move to next worksheet

CTRL + PAGEUP Move to previous worksheet

Table 1 Commands for group editing

When worksheets are grouped, they can all be manipulated simultaneously:

entering data in cells

editing data in cells

formatting cells

creating functions

Entering data into grouped worksheets is very useful if you are entering common titles and formulae in several sheets at once.

Exercise 27: Editing grouped worksheets Now look at this exercise (page 77).

Page 48: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 40

11 Calculations Across Many Worksheets A formula or function may refer to cells in several worksheets within a workbook. A 3-dimensional (3-D) reference is a reference in a formula or function to a range of cells which span two or more worksheets in the workbook. For example, the formula =SUM(Sheet1:Sheet3!A4) would add up the contents of the A4 cells on the worksheets Sheet1 to Sheet3 .

This sort of formula is easiest to use if the set of sheets are all laid out in the same way, with corresponding data in corresponding cells running through the sheets.

It is common to provide an additional sheet in a workbook which collects summary information from the other sheets, and calculates overview values such as overall averages and totals – these are sometimes known as consolidation calculations.

11.1 Formula That Takes Data From Another Sheet A reference to a range from multiple worksheets includes these elements:

the sheet name/s

followed by !

followed by the cell reference/s

multiple sheet names are separated by a colon :

multiple cell references are separated by a colon :

Example reference Refers to

sheet1!B7 one cell

sheet2!F4:H10 flat rectangle range

sheet2:sheet4!M13 cell M13 in sheet2 to sheet4

Summer:Winter!F4 cell F4 in named sheets

Summer:Autumn!D3:H10 3-D block

Table 2 Examples of references across multiple sheets

A formula on one worksheet may use data values from in a cell on another sheet. In this case, it is not sufficient to refer to the cell by its reference such as T23: the sheet name is also needed, and is separated using a ! .

Examples of such references are Sheet3!T23 or South!B12:C15 , and formulae might be =South!B12*North!K2 or =SUM(Sheet2!F2:F10).

11.2 Entering a 3-D Reference in a Formula In a formula, a 3-D reference can of course be entered by simply typing.

Alternatively, it can be entered by pointing and clicking along the following lines (keep an eye on the formula that is being built up in the Formula Bar, for reassurance):

In the cell where the calculation is to appear, start creating the formula

Page 49: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

41 IT Learning Programme

When you are ready for the 3-D range, click a cell that lies in the top-left corner of the desired 3-D block, on the sheet at the front

Hold SHIFT

Click the sheet tab of the sheet at the back

The display does not change – do not worry, notice that the included sheet tabs are shown highlighted and the formula now includes the sheet range similar to FirstSheet:LastSheet

Click the cell that lies in the bottom-right corner of the desired 3-D block

Notice that the range is being built up in the Formula Bar, of the form F irstSheet:LastSheet!A3:G8

If the range is correct, complete the formula

If there has been a mistake, it is probably easiest to abandon the formula and try again, rather than rectify it

11.3 Functions Which Can Use a 3-D Range Some Excel functions can operate on a 3-D range. Functions accepting 3-D references include these:

Function Example

SUM =SUM(Sheet2:Sheet13!A2:A10)

AVERAGE =AVERAGE(Sheet2:Sheet13!A2:A10)

MAX =MAX(Sheet2:Sheet13!A2:A10)

MIN =MIN(Sheet2:Sheet13!A2:A10)

STDEV =STDEV(Sheet2:Sheet13!A2:A10)

VAR =VAR(Sheet2:Sheet13!A2:A10)

COUNT =COUNT(Sheet2:Sheet13!A2:A10)

COUNTA =COUNTA(Sheet2:Sheet13!A2:A10)

Table 3: Functions which can use a 3-D range

Exercise 28: Using a 3-D reference Now look at this exercise (page 78).

11.4 Names and 3-D Ranges A name may be assigned to a 3-D range. This makes formulae very much easier to read and understand.

For example, the name January might be defined as =Scotland:N_Ireland!B4:B7 where B4:B7 on each sheet contains the test results, between and including Scotland and N_Ireland. The formula =AVERAGE(January) would calculate the average value for the month of January across all those worksheets.

Page 50: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 42

A 3-D range name is created using (it cannot be created by typing in the Name Box, as 2-D ranges can be).

Exercise 29: Using names for multi-sheet ranges Now look at this exercise (page 78).

Page 51: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

43 IT Learning Programme

12 What Next? Now that you have some useful spreadsheet skills you may want to develop them further. IT Learning Programme offers a range of resources for study and teaching.

In all cases, please refer to the IT Learning Programme web page (via www.it.ox.ac.uk/courses/) for further details.

12.1 Course Which Precedes This Office: Fundamentals workshop there is an Excel component

12.2 Other Courses in Spreadsheets and Statistical Analysis Spreadsheets: Techniques for managing and checking data

Spreadsheets: Organising and displaying data

Spreadsheets: Summarising data using pivot tables

Spreadsheets: Advanced data analysis

Statistics: Concepts of statistics for researchers

Statistics: Designing clinical research and biostatistics

… and various courses on using MATLAB, NVivo, R, SPSS and Stata.

12.3 Courses in Programming Languages For those who need to process large amounts of data, knowledge of a programming language such as C, C++ or VB may be useful.

These are easily accessed with a simple program. A range of courses are available, so see the IT Learning Programme catalogue for further details: www.it.ox.ac.uk/courses/ .

12.4 Course Clinics We encourage everyone to work at their own pace. This may mean that you don’t manage to finish all of the exercises during this session. If this is the case, and you would like to complete the exercises while someone is on hand to help you, come along to one of the Course Clinics that run during term time.

More details are available from www.it.ox.ac.uk/courses/

12.5 Downloadable Course Materials and More – the ITLP Portfolio

These course materials are available through the ITLP Portfolio, at http://portfolio.it.ox.ac.uk .

Each course pack includes the course handbook in pdf form and a zip folder of the exercise files that you need to complete the exercises. Archive versions of the course book may also be useful if you use an earlier version of the software.

Page 52: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 44

The ITLP Portfolio helps you find articles, videos, resources and weblinks for further IT study. For some resources, you will be asked for your Oxford (SSO) username and password.

12.6 Further Help It may be possible for you to use ITLP facilities in IT Services, Banbury Road to work through the exercises in this booklet after the course, or when you don’t have access to the applications on your own computer. Contact us on [email protected] for details.

The IT Services Help Centre is a good place to get advice about any aspect of using computer software or hardware. For Help Centre opening times, visit www.it.ox.ac.uk/help/gettinghelp/ and follow links to the General Helpdesk, or contact them by email on [email protected].

Page 53: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

45 IT Learning Programme

Appendix: Student Exercises Exercise 1 Creating a formula (Optional revision)

Start Excel

Open the workbook with student exam results

Enter a formula to calculate the average mark for a student

In this workbook, a group of students have taken 4 exams

You will start to analyse the results

The first step is to calculate, for the first student, his average (mean) score across the 4 exams

Task 1 Start Excel

Step 1

Click the Start button on the Taskbar at the bottom of the screen

In the All Programs menu, explore the folders and look for the Microsoft Off ice group

Click Excel

Step 2 (On your office or home computer you might start the program using an Excel icon on the Desktop)

Step 3 If you are prompted for any user information, just click

An Excel licence screen appears briefly

Step 4 If the Start screen appears, showing some recent documents and a variety of templates for new workbooks, choose to create a Blank Workbook

Step 5 A blank Excel workbook appears, with the ribbon of tools

Briefly examine the tabs of the ribbon, to see the commands available

Open the results .x lsx workbook

Choose Open from the File tab

In the Open dialog, find the folder containing the course files (usually known as drive H: otherwise your teacher will direct you)

Page 54: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 46

Select the results .x lsx file and click on Open .

Place the cursor in cell F4

You are going to create a formula in cell F4

There are a number of ways that you move to a cell (in this case cell F4):

You can place the cursor in it using the mouse

Or you can use the arrow keys to move the cursor around the current worksheet

Either of these will make the cell chosen the active cell

Then the cell’s contents (if any) can be seen in the Formula Bar, directly under the ribbon

Calculate the mean score for this student

Type the formula (no spaces in a formula)

=(B4+C4+D4+E4)/4

Then press ENTER

The result (the answer to the calculation) appears in the cell, while the formula can be read in the Formula Bar

Enter the formula again, by pointing and clicking with the mouse

Delete the formula you just typed in cell F4, by pressing the DELETE key

While you are completing the formula again, this time notice how Excel uses colour to emphasise which cells are being referenced

Type =(

Move the mouse to cell B4 and click once

The reference appears in the formula

Type +

Move the mouse to cell C4 and click

Type +

Move the mouse to cell D4 and click

Type +

Move the mouse to cell E4 and click

This time, type )/4

Page 55: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

47 IT Learning Programme

The finished formula appears in the Formula Bar

The result (the answer to the calculation) appears in the cell

Save your work

Use Save from the File tab, or the Save button on the Quick Access Toolbar if it is visible

Do this after every exercise in this book

Exercise 2 Copying formulae

Enter a variety of formulae

Copy the formulae

Try a variety of tools for copying and filling

In this workbook, a group of students have taken 4 exams

You will start to analyse the results

Continue work in results .x lsx or open resul ts part ia l1.x lsx

Copy the average mark formula from J Adams down to the other students, using the Edit menu

Cell F4 has a formula that finds the average score for J Adams, and the cells below need similar formulae for the other students

Select the range of cells F4:F15

Choose the Fi l l Down button from the Edit ing group on the Home tab of the ribbon, to copy the formula

Each student’s average marks is displayed

Inspect at least 2 of the copied formulae, to check that they calculate as desired

Use the fill handle technique to copy the Mean Score formula across the exam columns

Cell B20 contains a formula which finds the average mark of the group of students, in exam 1

Select B20, then position the mouse pointer over the fill handle (a coloured block located in the bottom right corner of the active cell)

Notice that the pointer changes to a black cross

Drag the black cross pointer across to cell E20 so that the range B20:E20 is selected

Page 56: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 48

Release the mouse button

The formula is copied across

Save your work

Use the Save from the File tab or the Save icon on the Quick Access Toolbar if it is visible

Do this after every exercise in this book

Exercise 3 Copying a formula with an absolute reference

Create a formula which compares a student’s average mark with the pass mark

Make some of the references in the formula absolute

Copy the formula and see how it is adjusted

Check the work

The pass mark for these exams is 45

It would be helpful to see the marks compared with this pass mark: a formula that divides by the pass mark would give a number greater than 1 for a pass and a number less than 1 for a fail

Continue work in results .x lsx or open resul ts part ia l2.x lsx

In K6, type 45

Create a formula that finds the class’s mean mark as a fraction of the pass mark

Set up a formula in B22:

=B20/K6

The result is similar to 1.1222

Think: what would happen if you copied the formula across to columns C D and E?

Try it and see what happens

After experimenting, delete any formulae that give wrong answers

Edit the formula so that the K6 reference is absolute

Work on the formula in cell B22, in the Formula Bar

Type a $ symbol before the K and another before the 6, so that the formula reads:

=B20/$K$6

Page 57: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

49 IT Learning Programme

Note that in this example it would be sufficient to make a mixed reference $K6

Copy the formula across the columns for Exams 2, 3 and 4

Fill across from B22 into the range C22:E22, using one of the methods described earlier

Check that the values found (the answers) are plausible

Check the effect of copying the formula

Inspect the copied formulae: check that they have adjusted correctly

The B20 should adjust to C20, D20 and E20, but the $K6 should be unchanged

Experiment by changing the pass mark set in K6, and notice which students pass or fail overall

Close the results workbook, saving if you wish

Exercise 4 Entering data using Flash Fill

Use Flash Fill to enter a column of data, following a pattern

Examine the way the Flash Fill tool has assembled the new data

Think about what this data means

A list has been provided of people who are to be contacted by email

Their email addresses are to be constructed using their personal information

It would be tedious to do this manually

Open FlashFi l l .x lsx

Look at the list of personal information given on Sheet1

Create email addresses for the first couple of people, based on the personal information provided

Let Flash Fill complete the column

In D4, type the email address for Roy Hernandez:

[email protected]

In D5, start typing the email address for Hayley Dyer, following the same pattern

When Flash Fill offers to complete the remaining cells in column D (grey text appears), press ENTER to accept

Page 58: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 50

If Flash Fill is not offered automatically, find the command on the Home tab or

Data tab

The quick keystroke is CTRL+E

Look at the email addresses that have been entered, and think about what has been done

Notice that Flash Fill has copied the pattern from row 3:

retrieving data from columns A, B and C

changing from Capitals to lower case

selecting the first character of the firstname

inserting characters @ and .ox.ac.uk

Flash Fill has followed your pattern and filled the cells with data, but not with formulae

Click on one of the email addresses that has been entered automatically, and look carefully at the Formula Bar

Notice that the email address has been entered as plain text, no formulae have been used

Edit one of the last names in column A

The email address in column D does not update

Leave FlashFi l l .x lsx open for a later exercise

Save if you wish

Exercise 5 Naming a cell or range

Enter a rate for the cost of living, and assign a name to the cell

Create a formula that uses the named cell

Test the effect of copying a formula that uses a name

Open the workbook Budget .x lsx

This spreadsheet is designed to help users calculate their monthly income and expenditures

Enter a rate for the cost of living, and assign a name to the cell C1

In cell D1, enter a value for annual inflation (cost of living increase) 5%

Notice that when you type the % symbol this cell is automatically re-formatted with Percentage format

Page 59: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

51 IT Learning Programme

Check that cell D1 is still selected

In the Name Box, type a name for that cell, such as Cost_Of_Liv ing , then press ENTER

Note that cell names cannot contain spaces

Create a formula in cell D4 which calculates next year’s mortgage or rent – use the name of the cost of living cell

Create a formula in cell C4 which calculates the increase in mortgage or rent due to the cost of living:

=B4*Cost_Of_Living

Press ENTER to see the result for next year’s increase in mortgage/rent

Create a formula in cell D4 which calculates next year’s mortgage or rent, by adding the increase onto this year’s amount:

=B4+C4

Copy the formulae down to the other household expenses

Select cell C4

Copy it down over the range C5:C11

(use any method of copying down, as discussed earlier)

Select cell D4

Copy it down over the range D5:D11

Examine the copied formulae

Look at some of the copied formulae

Notice that the named cell reference is treated as an absolute reference when the formula is copied – the named cell reference is not adjusted when you copy down

Test the formulae by changing the value of the cost of living in cell D1

Page 60: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 52

Exercise 6 Naming a range using the Create Name tool

Identify areas of your worksheet by creating names based on existing labels

The Create From Selection tool can devise a name by looking at existing labels

The existing label may be at the top or at the side of the data

Continue work in the workbook Budget .x lsx

Define This Year ’s monthly household expenditures (B4:B11) with a name based on the existing label

The intention is to define This Year ’s monthly household expenditures (B4:B11) with names

Select the range B3:B11 , the range which is to be named

Choose the Formulas tab of the ribbon and then click on the Create from Select ion button in the Defined Names group

The top row of the marked range contains the name that we wish to define, so make sure that the Top row checkbox is checked

Then choose OK

Use the Name Box to check that the name has been created successfully

Repeat the above steps for Next Year’s household expenditures (range D3:D11)

Name the cells for this year’s income, outgoings and surplus

Select the range A14:B16

Click the Create from Select ion button

Notice that the names to be used this time are in the left column of the marked range, so click on Left column checkbox in the dialog

Check that the cells have been named successfully

Page 61: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

53 IT Learning Programme

Exercise 7 Using a name in a formula

Calculate the total household expenditure

Create a formula using the name of a range or cell

Continue work in the Budget .x lsx workbook or open Budget part ia l1.x lsx

Create a formula in cell B15 to calculate the total household expenditure – use range names

Move to cell B15 and begin entering the formula by typing:

=SUM(

Choose the Formulas tab of the ribbon and then click

in the Defined Names group

Select the name This_Year

The defined name is pasted into the formula for you

Press ENTER

Your formula should look similar to this:

=SUM(This_Year)

Create a formula in cell B16 to calculate the surplus – use range names

To calculate the surplus, move to cell B16 and enter the

following formula, using

=INCOME-OUTGOINGS

Note you could have created the formula by typing the range names yourself

These formulae are written with words, which makes them easier to understand!

Exercise 8 Applying names

Create some names for cells

Then use Apply Names to replace cell references in a formula with their names

Continue work in the Budget .x lsx workbook or open Budget part ia l1.x lsx

Page 62: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 54

Create names for each of this year’s household items

Select the range A4:B11

Choose the Formulas tab of the ribbon and find the Defined Names group

Then click the Create f rom Select ion button

Make sure that the Left Column check box is marked, so that the labels on the left are used to define the names

Click OK to create a name for each individual cell

Use the Name Box to check that new names have been defined for each of this year’s household item

Use Apply Names to replace cell references in each formula in column C with their defined names

Select the range C4:C11 which contains the formulae with cell references

On the Formulas tab of the ribbon, find the Defined Names group

Click on the small downward arrow ▼next to Define Name button

Then choose

In the Apply Names dialog box, the names to be applied to your formulae are marked

Click OK

The cell references in each formula in column C are replaced by names

Examine the formulae in some of the cells of column C, to check that the formulae now use names instead of cell references, making the formulae more readable

Exercise 9 Paste Names (Optional)

Use Paste Names to generate a list of names and information about what range each name refers to

Continue work in the Budget .x lsx workbook or open Budget part ia l2.x lsx

Page 63: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

55 IT Learning Programme

Generate a list of names and information about what ranges the names refer to

Click on cell F4

On the Formulas tab of the ribbon, click on the Use in Formula button and choose Paste Names.. . (appears at the bottom of the list)

Click Paste List button

A complete list of names is pasted into the worksheet at your current position

You can format the text as you prefer

Exercise 10 Creating a named constant (Optional)

Create a named constant for the expected increase in income

Use the named constant

Edit the value of the named constant

Continue work in the Budget .x lsx workbook or open Budget part ia l2.x lsx

Create a named constant for the percent increase in income expected (7%)

Select the Formulas tab of the ribbon and then click

on

In the Name: box type IncomeIncrease (note that names cannot contain spaces)

In the Scope : choose Workbook

In the Refers to: text field at the bottom of the dialog box add =7% (note there must be an equals = before the number)

Click OK to add the named constant and close the dialog box

You have now set a named constant called IncomeIncrease which currently has the value 7%

This is not held in any particular cell or range of the worksheet

Page 64: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 56

Create a formula in cell D14 which calculates the expected income for next year, using the IncomeIncrease named constant

In cell C14, create a formula to calculate the income increase using the named constant you have set up

=Income*IncomeIncrease

In cell D14, create a formula that calculates the income for next year

=Income+C14

Create a formula in cell D15 which calculates the expected outgoings next year by adding up next year’s separate outgoings for

In cell D15, create the following formula, by typing or clicking

=D4+D5+D6+D7+D8+D9+D10+D11

Assign names to cells D14 and D15 (note these names must be different from those used in column B)

Set up a formula in D16, to calculate next year’s surplus (=income–outgoings)

Use names where possible

Change the income increase % in D1 and see how this affects the results

If the income increase needs to be changed, it is not found in any cell on the worksheet: the named constant must be edited in the Name Manager

On the Formulas tab of the ribbon, click Name Manager

Select the IncomeIncrease item in the list

Click Edit to open the Edit Name dialog

Change the income increase to 10%

See how this changes the surplus results in row 16

Close the budget planner workbook, saving if you wish

Page 65: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

57 IT Learning Programme

Exercise 11 Using a formula to sum a column (Optional revision)

Create a series of formulae to add up the marks

Use the SUM function instead of +

Open the funct ions .x lsx workbook at the EXAM sheet

In this version of the workbook, we have named many of the ranges, to make your calculations easier

In A22, type Total

Build a SUM formula in B22 to total the scores for Exam 1

Make B22 the active cell

Type =SUM(

Type in the range of cells occupied by the results of Exam 1

Alternatively, point with the mouse at the first result and drag down to the last

Alternatively, type the name of the range, which is Exam1

Finish the function with the closing round bracket )

Press ENTER

The formula is complete and the result will display in the cell

In row 22, sum the exam scores for each column for Exams 2, 3 and 4

Make C22 the active cell

Repeat the procedures described above as appropriate

Starting in cells D22 and then E22 , repeat twice more

Alternatively, bearing in mind what you know about the effect of copying a formula, think about whether you could safely copy the formula from C23 to rows D, E and F

Page 66: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 58

Exercise 12 Using functions to calculate averages and counts

Add a formula that uses a ready-made function to find the average (mean) of the marks in each exam

Use the AVERAGE function

Add a series of average formulae

Create formulae using the Insert Function dialog

Continue work in the funct ions .x lsx workbook, on the EXAM sheet

Build a formula to average the scores for Exam 1

Make B20 the active cell

Type =AVERAGE(

Type in the range of cells occupied by the scores for Exam 1

Alternatively, point with the mouse at the first result and drag down to the last

Press ENTER

The formula is complete and the result will display in the cell

Figure 32 Building an AVERAGE formula

Page 67: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

59 IT Learning Programme

Average the exam scores for Exams 2, 3 and 4

Make C20 the active cell

Repeat the procedures described above as appropriate

Starting in cells D20 and then E20 , repeat twice more

In row 17, use the Insert Function dialog to create formulae that count the number of exam results

With cell B17 active, click to display the Insert Function dialog

In the list of functions, click COUNT

(If the function required is not visible, type a description in the box at the top to see suggestions)

In the Function Arguments dialog, click then drag over the range B4:B15

Click OK to complete the formula

Check the result (12 students entered for Exam1)

Test that the COUNT function counts the number of values: suppose that student D Martin did not enter for Exam1, so delete the score in cell B10 and notice that the count in B17 decreases; then undo if you like

Exercise 13 Using random numbers to populate a worksheet

Create a new worksheet where exam results will be analysed

Generate realistic values for students’ scores at maths and history

Use the RAND function

Before the real data is available, it would be useful to fill the worksheet with made-up data, to test how well the calculations work

You will use the RAND function to generate random numbers, and a little arithmetic to make the numbers a plausible size

Continue work in funct ions .x lsx or open funct ions part ia l1.x lsx

Switch to the MathHist worksheet

Here 10 students’ results in the Maths exam and the History exam have been anonymised, using letters a, b, c etc

Page 68: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 60

The Maths exam will be marked out of 70

The students have a range of abilities, so we expect them to achieve across the whole range of scores, from 0 to 70

RAND is a function that randomly generates a value between 0 and 1

Create formulae using RAND, in cells B2:B12 to produce simulated results

In cell B2, create this formula:

=70*RAND()

Copy the formula down to cells B3:B12

Numbers between 0 and 70 should appear

The History exam will be marked out of 60

The first few questions are very easy, so we expect all the students to score above 20; some will achieve very high marks and others will be spread across the range

Create formulae in cells C2:C12 to produce suitable simulated results using RAND()

In C2, create this formula:

=20+40*RAND()

Copy the formula down to cells C3:C12

Numbers between 20 and 60 should appear

Notice that each time you edit the workbook (anywhere) the RAND formulae recalculate

Use Paste Values to replace the formulae with their results

Select cells B2:C12

Copy

Leave the same cells selected

Choose Paste Values from the menu

The results (numbers) are pasted to replace the formulae

These no longer change when the worksheet recalculates

You have created plausible data that simulates the scores that students will achieve, so this is a good basis for checking that the formulae work properly

When the real data arrives, it can be over-written to replace the random data

Page 69: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

61 IT Learning Programme

Formatting the data, to conceal the many numbers after the decimal point, will be covered in a later chapter

Close the funct ions workbook, saving if you wish

Exercise 14 Percentages

Calculate fractions for exam scores

Apply percent formats

The students’ scores would be easier to compare if each was presented as a fraction of the maximum number of marks available: Maths was marked out of 70, whereas History was marked out of 60

Open res i t t ing .x lsx on the scores worksheet

Columns D and E have been set up for you to calculate the percentage scores

In column D, calculate each Maths score as a fraction of the 70 maximum score

In cell D2, give the formula =B2/70

Copy the formula down for all the students

In column E, calculate each History score as a fraction of the 60 maximum score

In cell E2, give the formula =C2/60

Copy the formula down for all the students

Display the calculated data as percentages

Select the calculated data in cells D2:E12

Click

The scores are presented as percentages of the maximum marks available

In columns D and E it is fair to compare a student’s performance in maths with history

Page 70: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 62

Exercise 15 Currency

A student who performed poorly will re-sit the exam: a fee is charged for this

Format the prices given for resitting an exam

Apply some different currency formats

Continue work in resi t t ing .x lsx or open resi t t ing part ia l1.x lsx , on the scores worksheet

Enter the costs of resitting each exam in row 16

In cell B16, enter the cost in pounds of resitting the Maths exam: 55

In cell C16, enter the cost in pounds of resitting the History exam: 60

Format the costs in sterling

With B16:C16 selected, click

The costs of resit exams in the US are: Maths 80 dollars

History 90 dollars

Add a row with this information in row 17, formatting suitably

Hint: use the arrow part of to see more currency options

Save the resi t t ing workbook

Open FlashFi l l .x lsx

On Sheet3 , look at the prices in column A

Enter the whole pounds parts of the first couple of prices, in column B

In cell B2, enter 13

In cell B3, enter 14

Use Flash Fill to complete column B

If Flash Fill offers suitable values in column B (in grey text), press ENTER to accept them

If no Flash Fill data is offered, move to cell B4 and

choose Home|Fi l l |F lash Fi l l (or press CTRL+E)

Page 71: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

63 IT Learning Programme

This follows your pattern, filling the cells with the whole pounds part of each price

Notice that it does not round values upwards

Use Flash Fill to complete column C with the pence part of the prices

Notice that Flash Fill completes the cells with simple data (numbers and text), not formulae:

If the Price data in column A is edited, the parts in columns B and C do not update

Keep the FlashFi l l workbook open for a later exercise

Save if you wish

Exercise 16 Displaying numbers with decimal places

Format numbers to two decimal places

Change the decimal places displayed

Explore some other number formats available

Continue work in the resi t t ing .x lsx workbook or open resi t t ing part ia l1.x lsx on the scores worksheet

The results of the mean score calculations in row 14 are shown with many digits after the decimal point: this is distracting and out of proportion with the raw data used

Use buttons to format the mean Maths score with 1 decimal place

Select the mean figure for Maths, in B14

Experiment with clicking and

One button decreases the decimal places displayed, and the other increases

Notice that the numbers are correctly rounded to the nearest tenth, the extra digits are not simply omitted

Finish with 1 figure showing after the decimal point: 54.8

Page 72: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 64

Use the Number format dialog to format the mean History score with 1 decimal place

Explore the options available in the Number format dialog

Select the mean figure for History in C14

Click the launcher in the Number group on the Home tab, to display the Format Number dialog

Explore the categories available, to see which would be relevant to your own work

Finally, select the Number category

Experiment with the Decimal p laces control, finishing with choosing 1

Click OK

The History mean score appears as 39.3

You might now choose to format the costs of resits in whole pounds or dollars

Exercise 17 Working with date formats

Enter a date in a cell

Excel recognises several date formats

Apply some of the alternative date formats

Continue work in the resi t t ing .x lsx workbook or open resi t t ing part ia l2.x lsx

Switch to the Resit Dates worksheet

Here you will help the students who did not pass an exam to organise their studies, ready for resitting the exam

Enter a date when study will begin

In cell E1, enter the date the students will start work: 6 January 2015

Excel recognises this as a date, and changes the cell format from General to Date

Try some of the date formats available

Select the dates of the exam resits (cells B3:B8)

Use the number format control to compare the Short Date and Long Date formats (you may need to make the column wider to display the long dates)

Page 73: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

65 IT Learning Programme

Click the launcher in the corner of the Number group on the Home tab

In the Format Cel ls dialog, on the Number tab, select Date in the white category list on the left

Experiment with the date format Types available

Exercise 18 Calculating with dates

Calculate a date starting from a given date

Calculate the difference between two dates

Students who want to re-sit an exam must register 7 days before the study starts

Students would like to know how long they have for their revision, before the date of each exam

Continue work in the resi t t ing .x lsx workbook or open resi t t ing part ia l2.x lsx

Display the Resit Dates worksheet

Set up a label and a calculation for the registration deadline, 7 days before the start date

Define cell E1 with the name DateStar tWork

In cell F1, there is a label: Registration deadline

In cell G1, create a formula: = DateStartWork-7

You may need to change the width of column G

In column C, calculate how many days between the start date and each resit exam

In cell C3, create a formula:

=B3-DateStartWork

Adjust the number formatting of C3 as necessary

Copy the formula down column C

Page 74: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 66

Exercise 19 Functions for working with dates

Students want to know how many working days there are before the exam dates

Create a formula that uses the NETWORKDAYS function

Create a formula that uses the TODAY function

Try some of the date functions provided with Excel

Continue work in the resi t t ing .x lsx workbook or open resi t t ing part ia l3.x lsx , on the Resit Dates worksheet

Use the NETWORKDAYS function to calculate how many working days there will be until each resit exam

In cell D2, there is a label working days till resit

In cell D3, create a formula which subtracts the start of term date from the date of the Maths resit exam, as follows:

Type =

Click to display the Insert Funct ion dialog

Select the category Date & Time

In the list of functions, select NETWORKDAYS

Click OK

In the Function Arguments dialog, enter DateStartWork as the Start_date

Enter B3 as the End_date

Click OK

You may need to adjust the formatting of the cell, to General

Copy the formula down column D

This gives the students a better idea of the number of working days they have left, for exam revision before their resits

Page 75: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

67 IT Learning Programme

The Students worksheet lists some candidates for the exams

Create a formula that calculates a student’s age today, as a number of days – this data should be correct whatever date we open the workbook

Switch to the Students worksheet in resi t t ing .x lsx or resi t t ing part ia l3.x lsx

In D2, enter this formula:

=TODAY()-C2

The TODAY function has no arguments inside the brackets, but you do need the brackets in the formula

Reformat the cell to have General formatting, so the age is shown as a number of days

Optional: If interested, you could improve this formula, dividing by 365 and taking the integer part, to see each student’s age in years

Copy the formula down column D

Note that the TODAY() function used here will automatically update, each time you open the workbook

Create a formula that finds the month each student was born

In E2, enter this formula:

=MONTH(C2)

Copy the formula down column E

You might now look for a pattern of whether a student’s month of birth is related to their failing and thus resitting exams

Examine the other date and time functions

Click to display the Insert Funct ion dialog

Look at each function in the Date & Time category, noticing what else is possible with date calculations

Close the resi t t ing workbook, saving if you wish

Open FlashFi l l .x lsx

On Sheet4 , look at the dates in column A

Enter the whole year parts of the first couple of dates, in column B

In cell B2, enter 14

In cell B3, enter 12

Page 76: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 68

Use Flash Fill to complete column B

If Flash Fill offers suitable values in column B (in grey text), press ENTER to accept them

If no Flash Fill data is offered, move to cell B4 and

choose Home|Fi l l |F lash Fi l l (or press CTRL+E)

Notice that this follows your pattern, filling the cells down the column with the whole years part of each date: it does not round values upwards

Use Flash Fill to complete column C with the month part of the dates – this may be in the form 12 or December or DEC etc.

Notice that Flash Fill completes the cells with simple data (numbers and text), not formulae:

If the date value in column A is edited, the parts in columns B and C do not update

Close the FlashFi l l workbook, saving if you wish

Exercise 20 Using OR and AND functions

Suppose you want to buy a car and you have a list of the cars available

You need to identify which cars in the list fall within your price range or otherwise within your preferred mileage range

Once you have established which cars meet your requirements, you plan to contact the dealers by phone and organise a test run

Create formulae to establish which cars to inspect

Create alternative versions of the formula, using OR and AND

Open the Cars .x lsx workbook

You have £6500 to spend on buying a car

So you need to highlight one which has price<=6500

On the other hand, you might be interested in a more expensive car if it has a low mileage, say under 8000 miles

So you need to highlight a car which has price<=6500 or has mileage<8000

Page 77: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

69 IT Learning Programme

Add a formula in column F: use OR to finds cars that are cheap enough or have a low enough mileage

In cell F2, type =OR(D2<=6500,C2<8000)

Think before you copy down: should any part of this formula have $ symbols, so as to use absolute or mixed referencing?

Copy the formula down to all rows of the table

Use one of the fill down techniques mentioned earlier

Check several rows: does it give the outcomes you expect?

Any cars that are cheap as well as low-mileage would be well worth looking at first, so you will set up a formula to identify any such cars

Add a label in cell G1

In cell G1, type First look?

Add a different formula in column G: use AND to find cars that are cheap enough as well as having a low enough mileage

In cell G2, type =AND(D2<=6500,C2<8000)

Copy the formula down to all rows of the table

Check that it gives the outcomes you expect

Think: are you expecting this to return more or fewer cars than in column F?

Leave the Cars workbook open for a later exercise

Exercise 21 Using IF for a logical test

Create a formula to calculate the average of each student’s scores

Create a formula to decide whether or not a condition is fulfilled

Continue work in funct ions .x lsx or open funct ions part ia l2.x lsx at the EXAM worksheet

Use the AVERAGE function to calculate the average score for each student in column F

Make cell F4 the active cell

Delete any existing cell contents

Type =AVERAGE(

Page 78: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 70

Type in the range of cells occupied by the first student’s results B4:E4

Type the closing bracket )

Note: when building this average formula, don’t use the name that has been assigned to the range (Adams_J), because when you copy the formula down to other rows you will want the references to adjust

Press ENTER

The formula is complete and the result will display in the cell.

Set the pass mark for the exam as 40

Enter the value 40 in the cell K6

Notice in the Name Box that this cell K6 has been given the name PassMark

Enter a formula that will determine whether the student’s score is a pass or fail

Make G4 the active cell

Type =

Use the Function button and search through the list

of functions to find IF

In the Logical_test box, use the collapse button

and click in cells to set the test F4>=PassMark

In the Value_i f_true box, type Pass

In the Value_i f_false box, type Fail

Press ENTER

The formula is evaluated immediately

The result is displayed in cell G4

You may like to explore the effect of increasing Adams’s scores in each exam until G4 displays “Pass”.

Copy the formulae down for the other students

Copy the formula in F4 down as far as F15

Use Apply Names to replace the ranges in the pasted formulae with names (look back at part 4.6 above for a reminder)

Page 79: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

71 IT Learning Programme

Before copying the G4 formula down, think whether any part of the formula needs to be made absolute

(Hint: if you used a name for the PassMark, that reference is treated as absolute)

Copy the formula in G4 down as far as G15 (use any of the methods discussed above)

Close the functions workbook, saving if you wish

Exercise 22 More formulae using IF

Create formulae to establish which cars are within a given price range

The formulae must display helpful text (not True and False)

You want to buy a car and you have a list of cars available

You need to identify which cars in the list fall within your price range

You have £6500 to spend

On the other hand, you need reliability so have decided to ignore cars costing less than £5000

Continue work in the Cars .x lsx workbook or open Cars part ia l1.x lsx

In cell H2, create a formula which displays “Too expensive” or “Too cheap” or “Worth a look”

Make cell H2 the active cell

Enter the formula

=IF(D2>6500,"Too Expensive",IF(D2<5000, "Too Cheap","Worth a look"))

Press ENTER

The formula is complete and the result will display in the cell

Before copying, think whether any part of this formula should be made absolute

Fill the formula down the table

Check that it gives the outcomes you expect

Close the cars workbook, saving if you wish

Page 80: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 72

Exercise 23 Printing part of a worksheet

Print only a selected part of the worksheet

Set a print area

Check using print preview

Open the pr int ing .x lsx workbook and the West worksheet

Choose the area you want to print

In the West worksheet, select the January to March figures for all regions, cells A1:D17 .

When the cells are selected, choose Fi le | Pr int

In the Sett ings area, choose Print Select ion

In the preview window, notice that the marked range appears for the selected sheets

Click to leave print preview without printing

Set a print area

A print area may be defined as a named part of your worksheet, which has been marked for printing

Select the North worksheet only

On the Page Layout tab of the ribbon, click on the launcher arrow in the bottom right corner of the Page Setup group

In the Page Setup dialog that appears, select the Sheet tab

Then click in the Print area box

Click the range selector button

Now drag in your worksheet the area which you wish to define as a print area: for example, drag over A1:D17 (Jan to Mar figures)

Click OK

The print area has now been set

Page 81: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

73 IT Learning Programme

Check and change the print area

Choose Fi le|Pr int

Notice that only your print area appears in the print preview

When you have finished, click to leave print preview without printing

To print a different part of your worksheet data, you must either redefine the print area or remove it

On the Page Layout tab of the ribbon, click on the launcher arrow in the bottom right corner of the Page Setup group

When the Page Setup dialog appears, select the Sheet tab

Make some changes to the print area

Check your changes in the Print Preview

Finally, remove any print areas set

Exercise 24 Setting print titles

Arrange for appropriate column and row headings to be printed on each page

Check using print preview

Remove any print titles

Continue work in the pr int ing.x lsx workbook and the North worksheet

Set the row headings

Notice that headings for each column are contained in A1:N3

Row headings are contained in cells A4:A17.

Choose Page Layout tab of the ribbon and click on

the launcher arrow in the bottom right corner of the Page Setup group

In the Page Setup dialog that appears, select the Sheet tab

Page 82: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 74

Click in the Rows to repeat at top : box, and drag the mouse pointer over rows 1 to 3 in your worksheet

The appropriate reference ($l:$3) is entered

Set the column headings

Click in the Columns to repeat at lef t : box, and click the mouse pointer over column A in your worksheet

The reference ($A:$A) is entered accordingly

Click OK

You have now set the print titles

Preview your settings

Choose Fi le | Pr int

View the two pages of your worksheet in the preview window

Notice that the region numbers and months are printed on each page

This makes your worksheet data more presentable and easier to understand

When you have finished, click to leave print preview without printing

Remove print titles

Creating print titles defines part of your worksheet with the name Print_Ti t les

To view this defined area, click in the Name Box of your worksheet and select the name Print_Ti t les

To remove print titles from your worksheet, choose Page Layout tab of the ribbon and click on the launcher arrow on the bottom right corner of the Page Setup group

When the Page Setup dialog appears, select the Sheet tab

Clear any ranges set in Columns to repeat at top: or Rows to repeat at lef t : and then choose OK

The print titles are now removed (but the data in the cells are not!)

Page 83: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

75 IT Learning Programme

Close the results workbook, saving if you wish

Exercise 25 Organising multiple sheets in a workbook

Explore multiple worksheets in a workbook

Give each sheet a name

Open the overview .x lsx workbook

The overv iew workbook reports a snapshot of test results taken by students in various locations and regions, over a few months

Switch between sheets

Click the Sheet2 tab at the bottom of the Excel window

The data here is laid out in the same way as on Sheet1, but with a different set of test results

Look at the other sheets (click the tabs or use CTRL+PAGEUP and CTRL+PAGEDOWN)

Each sheet reports exam results from a geographical area

Rename the first worksheet

Work on each sheet tab of overview.x lsx in turn

Switch to the sheet that is labelled “England” in A1

Double-click the Sheet1 tab and you will see that the name of the sheet turns black

Type England

Press Enter when finished typing

An alternative to double-clicking on the sheet tab is to right-click on it to display a context menu

Rename the second and remaining sheets

Confirm that Sheet2 has the results for Midlands (look in cell A1)

Double-click the Sheet2 tab to start editing the text

The worksheet tab will turn into a text box where you can type Midlands

Page 84: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 76

Rename the remaining sheets, matching with the labels in cell A1

Exercise 26 Managing sheets in a workbook

Add extra sheets

Delete an unwanted sheet

Change the sheet order

Continue work in the overview.x lsx workbook

Delete an unwanted worksheet

It turns out that the Midlands data is already included with the England data, so the Midlands worksheet is redundant

Switch to the Midlands sheet

In the Home tab, choose and Delete Sheet

The Midlands sheet has gone – this cannot be undone

Add a sheet to the workbook, for a summary

It would be useful to make one more sheet to summarise the regional data

Choose Insert Sheet from the Home tab, or click the new sheet tab close to the other sheet tabs

A new worksheet will appear in the workbook

Rename the new sheet Summary

Set up the Summary sheet with labels

Copy/paste row 3 from the England sheet to the Summary sheet

Copy/paste column A from the England sheet to the Summary sheet

Overtype Summary in cell A1 of the new worksheet

Page 85: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

77 IT Learning Programme

Rearrange the sheets so the Summary is at the front

Click a sheet tab and drag sideways

Watch the small black arrow

When you drop the tab, the sheets are re-ordered

Bring the new Summary sheet to come first (leftmost)

Rearrange the regional sheets if you wish

Exercise 27 Editing grouped worksheets

Selecting several worksheets forms a group

This means that tasks can be performed on all of the selected worksheets

Enter text for all the worksheets at once

Create formulae on all the worksheets at once

Format cells on all the worksheets at once

Continue work in the overview.x lsx workbook or open overv iew part ial1.x lsx

Set up a group selection

Click on the England worksheet tab

Hold the SHIFT key then click on the N_Ireland worksheet tab

Notice that the sheet tabs appear highlighted

The word [Group] appears in the Excel title bar, indicating a grouped selection

Every change that you make from now on will change on all the grouped sheets

Entering text and formulae in all the sheets of the group, to calculate totals for the months and the location points

In cell A8, type Total

In B8, create a formula which adds up the scores for all the location points, during January

Repeat for C8, D8, E8

In cell F3, type Total

Page 86: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 78

In F4, create a formula which adds up the scores for the Point1’s of all months

Repeat for F5, F6, F7

If you wish, click on each individual worksheet tab to verify that data have been entered into each worksheet

Add the Summary sheet to the group

Holding CTRL, click the sheet tab for the Summary sheet

Confirm that all 5 sheets are now in the group

Format some cells in the group

Select the range from B4 to E7

Format all the selected cells with light shading

Select the range A3:F8

Format the cells to show an outside border around the data block

Ungroup the worksheets

Select a worksheet that is not grouped

Notice that the sheets are no longer grouped – in any future edits you will be editing just the sheet that is showing

Exercise 28 Using a 3-D reference in a formula

Create a SUM formula with 3-D references for the summary worksheet

Copy the 3-D formula across the summary

Create an AVERAGE formula with 3-D references

Copy the AVERAGE formula

Preview the worksheets

Continue work in the overview.x lsx workbook or open overv iew part ial2.x lsx

You will set up formulae that collect the raw data from the region sheets and calculate totals and averages, on the Summary worksheet

Switch to the Summary sheet

Page 87: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

79 IT Learning Programme

Enter a formula that sums the scores from the 4 regions

Move to cell B4, where the first 3-D formula is to be entered

Start the formula by entering =SUM(

Click on the tab of the first country worksheet (e.g. England) to begin the 3-D reference

The formula (in the Formula Bar) should look something like this:

=SUM(England!

Now hold down the SHIFT key and click the tab of the last country worksheet that you want to include

Your formula should now look something like this:

=SUM(‘England:N_Ireland’!

Now that you have specified what sheets to include in the 3-D reference, simply select the cells you wish to include:

Still holding down SHIFT, select cell B4

Type a closing bracket to finish the formula before pressing ENTER

The formula that you have typed (containing a 3-D reference) looks something like this:

=SUM(England:N_Ireland!B4)

Effectively, this formula is saying ‘. . . sum up from the England worksheet through to the N_Ireland worksheet the value contained in cell B4 of all those sheets’

Copy the formula to other cells in the shaded area

In the Summary worksheet, copy this formula to generate figures for the range B4:B7

Then copy across to columns C to E

Complete the Total row and column in the Summary worksheet, adding new formulae that use the SUM function

Page 88: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

IT Learning Programme 80

Enter a formula that averages the scores from the 4 regions

Copy and format it

In cell A9, enter the heading Average

In cell B9, type =AVERAGE and complete the formula to calculate the average test figures for Jan (Point 1 to Point 4 , England to NIreland)

Make sure your formula is averaging all the raw data across the 4 regional sheets, giving a value around 78 (not averaging the totals in the shaded area of the Summary sheet, giving a value in the 300’s)

Repeat for a formula in cell G4 to calculate the average test figures for Point 1 (Jan to Apri l , England to NIreland)

Copy these formulae to complete the row and column entries

Format the average data to two decimal places

Format and preview the workbook

Preview the entire workbook by choosing Fi le | Pr int

If a group of sheets were selected, then these sheets would be available in the preview

Otherwise, you can change the Print Act ive Sheets setting to Print Ent i re Workbook , to preview all sheets

Exercise 29 Using names for multi-sheet ranges

Create multi-sheet named ranges for each month’s total

Include all the four geographical regions

Use the Define Names dialog for this

Create formulae using the multi-sheet range names

Continue work in the overview.x lsx workbook or open overv iew part ial3.x lsx

Define names for each monthly set of score data, each spanning all the regions (through the worksheets)

Start with the active cell on England!B4 and choose Formulas | Def ine Name

In the New Name dialog, in the Name field type the range name JanScores

In the Refers to: box, click the Collapse Dialog button

Page 89: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

81 IT Learning Programme

Indicate the range that is to be named: click if necessary in England!B4

Hold SHIFT and click on the N_Ireland tab and click on B7

(When you click on the N_Ireland tab, the display does not change – this is as expected)

Click the Collapse Dialog button again

In the Define Name dialog confirm that the range =‘England:N_Ireland’!$B$4:$B$7 has been correctly entered

Then click OK

Define a series of names for FebScores, MarScores and so on, using a similar procedure

These names could be used in the Total and Average formulae on the Summary sheet

On the Summary sheet, add labels Total and Average in cells A11 and A12

In B11, create a formula that sums the January values for all the location points for all the regions, using the named range:

=SUM(JanScores)

In B12, create a formula that averages the January values for all the points for all the regions, using the named range:

=AVERAGE(JanScores)

If preferred, after typing =AVERAGE(, you can choose JanScores from the Use in Formula dropdown list on the Formulas tab of the ribbon

These formulae should give the same result as B8 and B9 – but with a named 3-D range it is easier to create the formula accurately, and the formula is easier to read

Repeat for the other months

Close the overview workbook, saving if you wish

Page 90: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use
Page 91: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

1

IT Learning Programme

Creating professional spreadsheets Today’s arrangements

Your teacher is: Pamela Stanworth

Your demonstrator:

We finish at: 12:15

Your safety and comfort are important

Where is the fire exit?The toilets are along the corridor outside the teaching roomsThe rest area is where you registered;it has vending machines and a water coolerPlease tell us if anything does not work

The course handbook

Contains notes on each topic, + slides

Tasks for you to practice during today’s courseWork at your own pace!Be selective

Follow-up workContinue with exercises after the sessionCourse Clinics

Course outline

Data and formulaeFill and Flash fillRelative & absolute referencesNamed cells, ranges etc

Using functionsSome useful functionsFormatting cells and rangesLogic functions

Viewing and printing large workbooksEditing multiple worksheetsCalculations across multiple sheets

Getting started

Today, please work in your network drive H

Page 92: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

2

Formulaeand

references

A formula in a cell (revision)

Typing a formulaFormula begins with =Type or click cell referencesUse arithmetic operators + - * / ^

Cell contents vs. Result

Effect of copying a formula

Copying a formulaUse the fill handle or Or Copy & Paste

Cell references in the formula adjustCheck: is this what you wanted?

Using an absolute cell reference(instead of a relative reference)

$ symbol before part of a cell reference means:

that part will not be adjusted when the formula is copied

Edit the formula and type $ symbolOr use <F4> to cycle around the permutations

Flash Fill

Inserts dataTakes data from adjacent columnsFollows your pattern and formatting

Not a formula – no updating

fill handle

Named ranges

Page 93: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

3

Defining a name for a cell or range

Select a cell or range of cellsType a meaningful name in the Name boxRules:

up to 255 charactersno spaces, not case-sensitive

Use a name once in each workbook

Or Create from SelectionName Manager is on Formulas tab

Why name a range?

Names can be given to a cell or a range of cells

Names make the workbook easier to navigateNames make formulae easier to build and to read

Names make a worksheet comprehensible (to you and others)

Using names in formulae

Using a name in a formulae.g. =SUM(Expenses2012) totals the contents of all cells in the range called Expenses2012

Apply Names to a pre-existing formula

A named range is absolute not relativeReferences do not adjust when cell is copied

A list of the names used

Good practice to document the spreadsheetOn an extra sheet

Paste Names

Named constants (optional)

A number you use quite oftenDoes not appear in any cell

e.g. VAT=0.2 that’s 20%

Use the name in formulaeAdjust the value when needed

Spreadsheets: Practice

Choose from the exercises up to Exercise 10(some are optional revision)

Work files are on drive H:Ask for help if needed!Demonstrator:

Restart at 10:15

Page 94: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

4

If you want to continue with the Exercises, you could …

Copy the Exercise files to a memory stick

Download the files (and more) from the ITLP Portfolio at http://portfolio.it.ox.ac.uk

Functions

Some useful functions

Formula is like =SUM(list of info)

… and more functions

Browse through the Insert Function dialog

Can combine or nest functions in a formula

CONVERTConverts between measurement units

RANDA random number between 0 and 1

Formatting

Buttons on the Home tab for popular formatsAlign Wrap text Merge

Format Cells dialog for more

Formatting numbers

How many decimal places

Percentages

Currency

Page 95: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

5

Working with dates

Numbers can be formatted as Dates and TimesDate calculations: + -

Functions that find a date: TODAY(), NOW(),

Get part of a date: YEAR, MONTH, HOUR WORKDAY, WEEKDAY

Logicfunctions

AND() and OR() are functions

=AND(a statement, another statement, more …)=OR(a statement, another statement, more …)

Outcome is TRUE or FALSE (Yes or No, 0 or 1)

Can use AND() and OR() inside other formulae

no space before the bracket

IF() function

=IF(Do a Test,outcome if True,outcome if False)

=IF(D6=20,“That’s 20”,“That’s not 20”)

For more complicated outcomes, nesting IF functions:=IF(Test, Both-True Text, IF(Other Test, True Text, Both-False Text))

Spreadsheets: Practice

Choose some exercises from 11 to 22

Restart at 11:20

If you want to continue with the Exercises, you could …

Copy the Exercise files to a memory stick

Download the files (and more) from the ITLP Portfolio at http://portfolio.it.ox.ac.uk

Page 96: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

6

Large worksheets

Titles always visible

View|Freeze panesat top or at left side or both

Printing part of a large worksheet

Printing a selectionSelect a range of cells, then File| Print| Print Selection

Setting a Print Area for repeated printingSelect the range to be printed

Page Layout| Print AreaOne print area for each worksheet

Setting Print TitlesPage Layout | Print TitlesSpecify Rows to repeat at top

Or Columns to repeat at left

Multipleworksheets

Multiple related worksheets

Insert an additional worksheet

Rename – give each sheet a memorable nameDrag tabs to re-order

Grouping several worksheets

Select a range of adjacent sheets<Shift> and click first and last tabs for required worksheets

Select non-adjacent sheets<Ctrl> and click tabs for required worksheets

[Group] appears in the title bar

Page 97: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

7

Group editing

Then manipulate all the worksheets simultaneously:

entering data in cellsediting data in cellsformatting cellscreating formulae

Calculations across worksheets

A formula can refer to cells or ranges on multiple sheets Sheet names are marked with !

Sheet1:Sheet2!F4 F4 on two sheetsSheet1:Sheet3!D3:H10 D3:H10 on three sheetsEast:South!T16 T16 on all four sheets

=SUM(Sheet2!F2:F10)=South!B12*North!K2

3-D named ranges

A named range can span more than one worksheetMuch easier to read formulae

Formulas tab

IT Learning Programme

Spreadsheets: Creating professional spreadsheets

More about Excel …

Other courses– spreadsheets and statistics

Spreadsheets: Organising and displaying dataSpreadsheets: Summarising data using pivot tablesSpreadsheets: Advanced data analysis

Spreadsheets: Techniques for managing and checking data

Statistics: Concepts of statistics for researchers

Page 98: Handbook Spreadsheets TMSE2 Creating … › access › content › group › e05e05d2...TMSE2 Spreadsheets: Creating professional spreadsheets iii IT Learning Programme How to Use

Spreadsheets: Creating professional spreadsheets

8

If you want to continue with the Exercises, you could …

Copy the Exercise files to a memory stick

Download the files (and more) from the ITLP Portfolio at http://portfolio.it.ox.ac.uk

Spreadsheets: Practice

Choose from the exercises from 23 onwards

Finish at: 12:15

[email protected]

[email protected]

This presentation is made available by Pamela Stanworthunder a Creative Commons licence:

Attribution-NonCommercial-ShareAlikeCC BY-NC-SA

[email protected]