Академический Документы
Профессиональный Документы
Культура Документы
Practical Workbook
Document information
If you are working in the training room the files you need are in C:\User\Excel.
If you want to work through the practical tasks shown in this document on your own system,
obtain the necessary files from:
www.bristol.ac.uk/is/learning/documentation/docs-current.html#excelxp-t4
You will see a link to Practice files. This contains the files you need to work through the course
notes. In Internet Explorer you extract the files as follows:
• Click on Practice files;
• Choose Save.
• Browse to where you want to save the file and click on Save (the practice files are grouped
together, and you need to extract them to be able to use the individual files);
• Go to the file you have just saved, and Open or Run it to show the Self-extracting Archive
box;
• Select where to extract (save) the files on your system using the browse button (as
shown opposite);
• Click Start to save the files.
Related documentation
Contents
Related documentation
Introduction
Excel is the University's recommended spreadsheet product for Windows on PCs.
This document contains illustrative examples. These examples can be worked through
exactly according to the notes or you can vary them. Remember that the examples have
been devised to show various aspects of Excel and you do not need to work through them
all.
Data used in these example spreadsheets is fictitious. We remind you that if you store
personal information relating to individuals on a spreadsheet, you must comply with the
requirements of the Data Protection Act. Further information about the Data Protection Act
can be obtained from the Registrar's Office.
Prerequisites
This document assumes that you have some previous experience of using spreadsheets,
particularly to create formulas covered in the notes Getting started with Excel (document
excelxp-t1). You should also have experience of using charts, range names and functions,
which are covered in the notes Further Excel (document excelxp-t3).
See the Related Documentation section in the inside front cover for the location of these
documents.
Excel: scientific examples (excelxp-t4)
1.1 Open the workbook C:\User\Excel\Scentific.xls and use the sheet Series.
1.2 With no data selected, click the Chart Wizard, select the chart type XY
(Scatter) and the fourth subtype (scatter with data points
connected by lines).
1.3 Click Next and click the Series tab.
1.4 Click the Add button to define Series 1.
In the Name box type Site 1.
Click in the X Values box then select the range B3:B6.
Click in the Y Values box then select the range C3:C6.
1.5 Click the Add button to define Series 2.
In the Name box type Site 2.
Click in the X Values box then select the range B10:B13.
Click in the Y Values box then select the range C10:C13.
1.6 Click the Add button to define Series 3.
In the Name box type Site 3.
Click in the X Values box then select the range B17:B21.
Click in the Y Values box then select the range C17:C21.
1.7 Click Next and add the titles shown in Figure 1.
1.8 Click Next then Finish.
1
Excel: scientific examples (excelxp-t4)
2.2 Use the method from to create an XY (Scatter) chart for the two series of data:
Series Name X Values Y Values
Patient 1 B4:B11 C4:C11
Patient 2 B18:B27 C18:C27
It should look like Figure 2.
Warning! In Figure 2, any times beyond midnight on Day 1 (i.e. Day 2, etc) are plotted as
though they are actually on Day 1. The next section solves this problem in
various ways.
2
Excel: scientific examples (excelxp-t4)
Patients' Readings
70
60
50
Reading
40 Patient 1
30 Patient 2
20
10
0
00:00 12:00 00:00 12:00 00:00 12:00
Time
3
Excel: scientific examples (excelxp-t4)
3.1 Open the file C:\User\Excel\Scentific.xls. You will use the sheet Loads.
3.2 Select the range A4:B9.
3.3 Use the Chart Wizard to produce a chart similar to that shown in Figure 4,
choosing an XY (Scatter) chart of Type 1 and insert the headings and labels as
shown:
4
Excel: scientific examples (excelxp-t4)
3.6 Drag the box containing the Equation and the R-squared value to a suitable
position on the chart.
3.7 Save the file.
As can be seen in Figure 6, the results accord very well with the theory (an R-
squared value of 1 would represent a perfect fit).
5
Excel: scientific examples (excelxp-t4)
An array formula can perform multiple calculations at once and then return either
a single result or multiple results. Array formulas act on two or more sets of
values known as array arguments. Each array argument must have the same
number of rows and columns. You create array formulas in the same way that
you create other formulas, except you press <Ctrl> + <Shift> + <Enter> to
enter the formula.
For example, given a series of known spring lengths (in column B) for a series of
known loads (in column A), the TREND function can predict the spring lengths for
some new loads (see Figure 7). To do so, it determines the straight line values
that would be plotted on a graph like that produced in .
In the worksheet used in , enter in A10:A14 the new values shown in Figure 7 to
represent the new loads for which the length of the spring will be predicted.
4.1 Highlight the range B10:B14, which will be used to hold the predicted values.
4.2 Click the Insert Function icon , select Statistical and then TREND.
4.3 Click OK.
4.4 In the resulting dialog box, enter the data values as shown in Figure 8, either by
typing them or by clicking each box in turn and highlighting the range of cells in
question.
Hint: you may need to 'collapse' the dialog box by clicking on the button to the
right of the value.
6
Excel: scientific examples (excelxp-t4)
The set of numbers in the range B10:B14 represent the predicted length of the
spring for the corresponding loads.
4.7 Format the numbers to 2 decimal places.
4.8 These new values can easily be added to the chart created in Task 1 by selecting
the range A10:B14 and dragging and dropping the selection into the chart area.
Note In the TREND function, the parameter const determines whether or not the line
is to pass through the origin; if omitted, or if the value is TRUE, the constant will
be evaluated. If the value is FALSE, the line will be forced to pass through the
origin. For the purposes of this example, leave Const blank.
7
Excel: scientific examples (excelxp-t4)
At the end of this task, the Excel worksheet should look similar to that in Figure 9.
5.5 Select the data range A9:AW9 and click on the Chart Wizard icon to plot
the selected data:
Select the chart type Line and the second subtype (Stacked Line).
From Step 3 select Titles to add a chart title.
Select Gridlines and Legend to remove these 2 features.
Insert the chart as an object in Data1 (immediately below the data).
5.6 Close the file, saving it as an Excel file called Task3.xls
8
Excel: scientific examples (excelxp-t4)
6.1 To see what the data we are going to use looks like, open the text editor Notepad
as follows:
From the Start menu, choose Programs then Accessories and Notepad.
From the File menu, choose Open.
From the Files of Type box, select All Files.
Find the file C:\User\Excel\data1.csv and click on Open.
You will see 4 lines of data separated by commas; the data is known as comma
delimited.
Close Notepad.
6.2 In Excel, open a blank worksheet and click on cell A1.
6.3 From the Data menu, select Import External Data/Import Data (in Excel
2000, select Get External Data/Import Text File).
6.4 From the Files of type dropdown menu, select All Files. Select
C:\User\Excel\Data1.csv and click on Open.
6.5 Use the Text Import Wizard as follows:
In Step 1, to accept Delimited as the file type, click on Next.
In Step 2, under Delimiters, untick Tab and tick Comma to determine how the
data is separated then click on Next.
In Step 3, leave the Column data format as General then click on Next.
Click on Finish.
6.6 Click on OK to place the data in cell A1 of your current spreadsheet.
6.7 Work with the data in the same way as in steps - from Task 5.
6.8 Save the file as a spreadsheet (Task4.xls).
6.9 In NotePad, open the file C:\User\Excel\data1.csv.
Make an obvious change to the data (for example, change the first entry from
10.36503 to 5).
Save the file.
6.10 Switch back to Excel and click on the worksheet, within the range A3:AW6.
6.11 From the Data menu select Refresh Data. Locate the file data1.csv and click
on Import.
Note Care should be taken when the original data file is extended rather than simply
modified as new data sets will not automatically be included in the range used by
the chart. In this example, additional rows of data will be included in the average
9
Excel: scientific examples (excelxp-t4)
value calculations, but values added after the 49th on each row will not. Any
extra data should be dragged into the chart, and any necessary formulae
extended, to update the chart.
6.12 To change the settings you made in the Text Import Wizard, click Edit Text
Import on the External Data toolbar. Select the text file and click Import.
If you want to import only part of the data in a text file as a refreshable data
range, you can create a query to retrieve the data (see the Office Assistant for
more information).
Note To obtain data from Microsoft Access, start from Access, select a table or query
and from the File menu, choose Export. Save the data as a workbook in the
Microsoft Excel 97-2002 format. There are choices to save the existing
formatting (column widths) and to automatically start Excel opening the newly
created file.
10
Excel: scientific examples (excelxp-t4)
7.1 Open the file C:\User\Excel\Scentific.xls. You will use the sheet Function.
In this example, we wish to explore the function
Ax 3 + Bx 2 + Cx + D + E(sin(3x)) 2 .
In order to make the worksheet flexible, it is necessary to be able to change the
parameters A, B, C, D and E and also change the plotting increment.
Note The final worksheet (at the end of the next task) will look similar to that on page
13. The parameters and the plotting increment can be changed by simply typing
the value required in the appropriate cell.
7.2 Typical values for parameters A to E have been entered in cells C4:C8. These
cells have been named (A, B, CC, D and E) for ease of use in the formula you
will create. Note that C is not a valid name so CC has been used. See Figure 10.
Click in the Name Box and check that the names A, B, CC, D and E apply to
cells C4, C5, C6, C7 and C8.
7.3 The values for x will start at 0 and be increased successively by the value in cell
I3, the typical plotting increment (0.04). I3 has been named Inc for ease of use
in the formula you will create. See Figure 10.
Click in the Name Box and check that the name Inc applies to cell I3.
7.4 Now set up the X plotting range. To get a smooth curve, we need at least 50
points.
11
Excel: scientific examples (excelxp-t4)
Cell B10 has the starting value, of 0. In cell C10 enter the formula:
=B10+Inc.
Copy this formula to the range D10:AZ10.
7.5 Enter the formula to calculate the Y values produced by the function as follows:
Select cell B11 and enter the formula:
=A*B10^3+B*B10^2+CC*B10+D+E*(SIN(3*B10))^2.
Copy this formula from B11 to the range C11:AZ11.
You can now see the nature of the function. The parameters A, B, C, D and E
and also the plotting increment, Inc, can be easily changed and the effects
observed. This ability to explore the nature of complex functions is one of the key
features of a spreadsheet.
7.6 Save the file. In the next task you will plot a chart of the function.
12
Excel: scientific examples (excelxp-t4)
13
Excel: scientific examples (excelxp-t4)
9.1 Use the file C:\User\Excel\Scentific.xls. Click the Errors sheet. This
worksheet contains approximately 100 data points and their errors.
15
Excel: scientific examples (excelxp-t4)
10.1 Using the spreadsheet created in , click the chart to activate it.
10.2 To save a custom chart type:
From the Chart menu, choose Chart Type.
Select the Custom Types tab.
Click the User Defined option button.
Click Add.
In the Add Custom Chart Type dialog box, type a name and a description.
Click OK.
10.3 To try it out:
In new worksheet, enter the data shown in Figure 15.
Select A1:B7.
Click on the Chart Wizard icon.
At step 1, choose the Custom Types tab.
Click the User Defined button.
Select the chart type you created.
Click Finish (or Next to choose further options).
The graph should appear with all the preferences (default title, axis labelling, etc.)
as applied to the original graph.
Warning! When Excel constructs the error bars for the new set of data; it gets them wrong
(it uses the old ones). If you are using error bars, remember to update this field
when using new data. You can do this by double-clicking either a data point or an
error bar and clicking on the Y Error Bars tab. Enter your error bar information in
the same way as before (Task 7).
Note You can also set a custom chart as the default chart type.
16