Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
55 views

Excel 2007 Tutorial

Excel can be used to analyze experimental data more efficiently. An example uses distance and time data from measurements of a car's velocity calculated using the formula velocity = distance/time. The data is entered into a worksheet with column headings and formulas are used to calculate the velocity for each measurement and the average velocity. Formatting options are used to display values to appropriate significant figures.

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Excel 2007 Tutorial

Excel can be used to analyze experimental data more efficiently. An example uses distance and time data from measurements of a car's velocity calculated using the formula velocity = distance/time. The data is entered into a worksheet with column headings and formulas are used to calculate the velocity for each measurement and the average velocity. Formatting options are used to display values to appropriate significant figures.

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

INTRODUCTION TO EXCEL 2007

Welcome to Excel! This reading will walk you through a simple physics example and how you can use
Excel to do data analysis more efficiently and easily. This section will be a valuable reference as you go
through the semester doing your analyses.

Starting Microsoft Excel

If there is no desktop icon to open Excel, click the Start button and open the All Programs menu. Excel will
show up as a separate icon or will be found in the Microsoft Office folder.

Opening a Workbook

The workbook is the normal document or file type in Microsoft Excel. A workbook is the electronic
equivalent of a three-ring binder. Inside workbooks you'll find sheets, such as worksheets and chart sheets.
Each sheet's name appears on a tab at the bottom of the workbook. You can move or copy sheets between
workbooks, and you can rearrange sheets within a workbook.

In this tour, you'll make a new workbook in which you will be calculating the velocity and its uncertainty
from a set of data values for distance and time.

What's on the Screen

When you create or open a workbook, Microsoft Excel displays it in a window. There are a few
areas of the Excel window which you should note.

} Ribbon
}

Tab Formula Bar


Active Cell Group (within
the Ribbon)
Office Button

Most of the work you do in Microsoft Excel will be on a worksheet. A worksheet is a grid of rows and
columns. Each cell is the intersection of a row and a column and has a unique address, or reference. For
example, the cell where column B and row 5 intersect is cell B5. You use cell references when you write
formulas or refer to cells.

Generally, you first select the cell or cells you want to work with, and then you enter data or choose a
command. Selected cells appear highlighted on your screen. The active cell is the cell in which data is
entered when you start typing. Only one cell is active at a time. The active cell is shown by a heavy border.
In the preceding illustration, cell A1 is the active cell.
◗To change the active cell

Move the mouse pointer into cell B4 and click the left mouse button.
Notice that the cell's reference ("B4") and its value (blank, so far) appear in the formula bar.

◗To scroll through the worksheet

1. Move the pointer to the down arrow in the vertical scroll bar on the right edge of the window, and then
click.
The worksheet scrolls down one row.

2. Click the scroll bar area below the scroll box.


The worksheet scrolls down one screen.

3. Move the pointer into the scroll box. Hold the left mouse button down, move the pointer back to the
top of the vertical scroll bar, and then release the mouse button. This is called dragging.
The worksheet scrolls back up to the first row.

Entering and Editing Data

Imagine wanting to find the velocity of a car. From basic physics, you know that the velocity is related to
the distance and time traveled in the following way (assuming constant v):
d
v= where v is the velocity, d is distance and t is time.
t
So, a simple experiment would be for the experimenter (you!) to use a stop watch to test the amount of time
it takes the car a known distance and from this, calculate the velocity using the above equation. Let’s try
this.

First, we need to enter the data. Let’s have three columns: distance, time and velocity. It’s useful to give
each column a heading. Select cell A1 and type: Time (s). This simply indicates that the column of data
following cell A1 will be of times measured in seconds. Select cell B1 and type: Distance (m) and press
ENTER. Since the entire word does not fit into the cell, you will need to adjust the column width. Move the
pointer between the B and C column headings until it changes into a double arrow, and then double click
(always use the left mouse button). Finally, select cell C1 and enter: Velocity (m/s). Go back and select
cell A1. Notice in the formula bar appears “Time (s)”. If you wanted to change the heading, you could
click the mouse cursor up in the formula bar and retype.

You should periodically save your worksheet. Generally, Excel files are given the extension .xls (e.g.
vel.xls). Initially, click on the Office Button, choose Save As. A suggested file name will appear under
File Name: To change it, click on the File Name: box and edit it as desired. As you proceed,
occasionally save your worksheet by typing CTRL-S.

Now we can enter our data. Let’s assume that this measurement was performed three times at three
different distances of 500m, 1000m, 250m, and the times were found to be 20s, 42s, 9s respectively.
Highlight cells A2:B4 (A2 through B4). Enter 20, 42, 9 (no units) in cells A2, A3, and A4 respectively.
Similarly enter the corresponding distances in the B column. Your worksheet should now resemble the
following illustration:
Building Formulas to Calculate Values

So far, you've entered data in a worksheet. To really make that data useful, you'll write formulas. Formulas
can do simple things, such as adding the values in two cells, or they can do much more complex things.
Here's how Excel uses the SUM function to add two values together.

On paper, you might


1 add two numbers like
+2 this
3 In Excel, do this

You can always identify a formula in Excel because it starts with an equal sign (=). You normally see the
formula itself only when you're editing the cell that contains the formula. Otherwise, you see the value
produced by the formula.

Now you will create a formula to calculate the velocity.

1. If it’s not already selected, choose cell C2.


2. Type =B2/A2. This tells Excel to use the value in cell B2 (500) and divide it by the value in cell
A2 (20). Hit ENTER. The value 25 should appear in the cell. Click back onto cell C2. Notice
that the formula =B2/A2 appears in the formula bar. If necessary, you could click up there to
edit it.
3. Instead of having to rewrite the same formula for cells C3:C4, you’ll want to use the “fill
handle”. Position the mouse cursor in the lower right corner (known as the fill handle) of cell
C2 until it resembles a plus sign.

Selected cell

Fill handle
Click on the fill handle of cell C2 and drag the mouse down through cell C4. The formula
should automatically increment such that in cell C4, the formula should read =B4/A4, while the
value should be 27.777...

Say you wished to find the average of all the velocities. Instead of typing =(C2+C3+C4)/3, Excel has a
function which will do this automatically.

1. Select cell C5.


2. Type = in the function bar, then click on the fx button just at the left of the Formula Bar. Select
AVERAGE if it appears as a function selection in the current menu or select the Statistical category
of functions and click on AVERAGE. Note the parenthesis and don’t hit ENTER yet! You should
be prompted to enter the range of cells to be averaged. Note: when you become familiar with the
different functions available in Excel and the proper format for entering function arguments, you can
type them directly into the cell (after the = sign).
3. Type C2:C4 NOTE: You may also use the mouse to highlight these cells.
4. Close the parenthesis with the final result being: =AVERAGE(C2:C4)
5. Press ENTER to accept the proposed formula. The final value should be 25.529...

As is, your final value could have any number of digits. When you learn more about significant figures, you
will know how many digits it should have. For now, let’s assume we only want to go to the tenths place.
With the mouse, highlight cells C2:C5. In the Home Tab, the central portion of the Ribbon should contain
a Group called Number that includes Increase/Decrease Decimal buttons which look like this: . If
they are present, click on them to decrease the values to only have digits in the tenths place. You may also
need to adjust the column width.

Whenever you have a new value, you should always give it a label. In cell B5, type average = .

You worksheet should now appear like the following:

=B4/A4
=AVERAGE(C2:C4)

Select any blank cell and hit the fx (function) button from the toolbar to discover what other formulas
Excel offers. You might want to try other formulas and see how they all work. Choose a formula, select
the range from the data given, end the parenthesis and hit ENTER. Be careful not to change any values
in your range! Before proceeding, be sure to delete any new formulas you've created.

Standard Deviation

This average value is perfectly reasonable, but how do you account for it only being the average? The best
way to do this is to use the property of standard deviation which gives an indication of the spread of
velocities used in calculating this average. As an analogy, think of it as throwing darts at a dart board. If
things are going well, most of the darts will hit a small area near the bulls-eye resulting in a small standard
deviation. However, if it’s a bad day and the darts are going all over the place, then there is a large standard

∑[ x(i) − x]
N
1 2
deviation. The formula used to calculate standard deviation, given as σ, is: σ = This is
N −1 i=1
a pretty involved expression, but fortunately, Excel has a function which will work through it automatically.
This function is =STDEVP(range) where range is the set of data for which you wish to calculate σ.
Standard deviation only works for a large number, N, of data points; as a general rule, you should have at
σ
least 10 data points to use standard deviation. The uncertainty in the average is not just σ; rather, it is .
N
Select cell C6, type = and using the function (fx) in the tool bar or the function menu in the formula bar
select the command for standard deviation (but don’t press ENTER yet). The range, for this case, will be
C2:C4, which you can type in manually or select by highlighting those cells. To divide by √N, enter
/SQRT(3), since you have 3 data points. The end formula should be =STDEVP(C2:C4)/SQRT(3). The
value you should get is 0.960...m/s. Decrease the decimals down to 1. (For more explanation on standard
deviation, read the last section of the Experimental Uncertainty Review link on the Physics 108 web page
and the Uncertainty Tutorial link on the Physics 108 web page.) Label this by typing Uncertainty = in cell
B6.

◗Before we proceed to the next section, you’ll need to do a few things first.

1. Select cells A2:C2.


2. Choose COPY from the Edit menu. A dotted line should appear around the cells.
3. Click on cell A8.
4. Choose PASTE from the Edit menu. Cells A8:C8 should now be a duplicate of A2:C2.

Partial Uncertainty

The above calculations assumed that every data value is exact. There is an uncertainty associated with each
measurement which will give an uncertainty for the calculated velocity. This uncertainty will tell the person
reading your data (us!) about what the velocity is, but makes no claims that this is exactly what the velocity
is (because it’s not). To get an uncertainty, you will need to make an educated guess (how these guesses are
made will be explained in lab) as to how far off your measurements might be. For example, suppose that
you measure the time traveled to have been 20 sec. But, your reaction time may have slowed you down, or
maybe it was a little hard to tell when the car exactly crossed the border (how well do you know the distance
anyway?), so maybe the time could have been anywhere between (17-23) sec. In that case,
t = (20 ± 3)sec . Since no measuring device is completely accurate, our distance has some uncertainty
to it as well. Let’s say d = (500 ± 1) m. To find the uncertainty in the velocity, we will use partial
uncertainties. This means that we will find the partial uncertainty of the velocity with respect to the 1)
distance and 2) time and then sum of the partials gives the total uncertainty.

Let’s do the distance first. We assume there’s no time uncertainty and see how just the distance
uncertainty affects our calculation of the velocity.

1. Highlight cells A8:C8.


2. Using the fill handle, drag down through cells A12:C12. Now you should have five identical rows
of data.
3. Choose cell B9. In here, you will enter the max distance of 501 (=500+1). Notice cell C9. The
corresponding velocity should have automatically changed to 25.1. (isn’t Excel great?!)
4. Enter the min distance (=500-1) into cell B10.
5. Enter the min and max times in cells A11 and A12 respectively.

This section of your worksheet should resemble the following:

diff/2=unc in v wrt d

diff/2=unc in v wrt t

Now, if you find the difference of cells C9:C10 divided by two, this will give the partial uncertainty of
velocity with respect to (wrt) the distance. The partial for v wrt t is from the diff/2 of cells C11:C12. To
find the total uncertainty of the velocity, add together these two partial uncertainties. Find this value using
Excel. To find the partial with respect to d, select cell C13 and enter the formula =(C9-C10)/2. Move to
cell C14 and do similarly for the partial with respect to time. Finally, select cell C15 and add together cells
C13+C14. This value is the total uncertainty for the velocity. It is also very helpful to label each of these
uncertainties for what they are. For example, in cell A13, you could type: partial unc wrt d =

For more on partial uncertainties, see the Experimental Uncertainty Review and Uncertainty
Tutorial links on the Physics 108 web page.

Creating a Chart

Charts are visual representations of worksheet data. Excel includes several chart types, such as bar, line,
and pie charts. You can use charts to clarify trends or relationships that might not be apparent in the
worksheet data alone.

A chart is either embedded directly on a worksheet, or it appears on its own chart sheet in the workbook.
Excel automatically updates a chart if the worksheet data upon which it's based changes.

Now you'll create a line chart of the distance vs. time data and embed it directly on the worksheet. To do
this, click on the Insert Tab in the Ribbon. One of the Groups shoud be Charts.

1. Highlight the cells in the worksheet that you want to be graphed. (For x-y axis graphing, Excel
defaults to assume your leftmost column is to be graphed on the x-axis and, if you have more than
one additional column, that each additional column is to be graphed as a separate y-data range
corresponding to the same x-data).
2. Make sure you see the Charts Group in the Ribbon (under the Insert Tab).
3. Select Scatter.
4. Select the graph subtype from the samples that plots data points but doesn’t draw lines or curves.
5. The chart should appear on the worksheet. To format the chart, click on the Layout Tab.
6. Add a chart title and x and y axis labels using the Chart Titles, Axis Titles, et al in the Labels
Group under the Layout Tab. Using other options in this Group, you can also adjust the axes,
add gridlines and a legend for data points. For this graph, click on the Legend option and turn off
the data legends.

Excel creates the chart on the worksheet.

Manipulating the Chart

Often, we will ask you to find the slope of the best-fit line for your data. Excel will calculate it numerically
as well as draw this line (called a “trendline”) on the chart.

1. Select cell B17. Type best slope =


2. Move to cell C17. Enter =linest(B2:B4, A2:A4). Where B2:B4 are the y data, and A2:A4 are the
x.
3. Hit enter, and the value for the best-fit slope (which is the velocity--do you see why?) of 22.7 m/s
should appear.

To plot this best fit line

1. Right click on one of the data points on your chart. A new menu window should open.
3. Select the Add Trendline option in the new window.
4. Another new window (Format Tendline) should appear. Under Type, choose the linear graph
option.
5. If you want to display the equation on your graph, check the box in this window that says Display
Equation on Chart, then Close the window Notice the slope calculated above corresponds to the
linear term of the trendline equation that now appears on your chart. Make your own calculation
of this slope and see how it compares to Excels.
6. Most of the time when adding trendlines you will want to make the trendline thinner. You can do
it when in the Format Trendline window or at any time later. To make the line thinner, just open
the Format Trendline window as before and select the Line Style option on the left of the window.
See if you can figure out how to make data point markers (the “dots” displaying data points on the
graph) by right clicking on a data point and selecting Format Data Series.

(Note: This is only the best slope. We will ask you to do max and min slopes as well. Excel will NOT do
this for you. Can you figure them out? For hints, go to the Uncertainty Review link on the Physics 108 web
page to the section on Graphs and Error Flags--Uncertainty in the Slope of a Line.)

Occasionally, you may need to change the scale of the axes. The same technique applies to either the x or y
axes. In this example, you will change the y.

1. If the chart isn’t still selected from before, double click on it.
2. Right click on the y axes. In the window that opens, select Format Axis.
3. Under the Axis Options tab, Change the Minimum option to Fixed and change its value to -1000.
4. Close the window, and the scale of the y axes should have changed.

Printing your results

The information in this section should apply to EVERY lab you do, so make careful note of its contents.
When you’re happy with how your worksheet looks and it’s ready to be printed, save it to your floppy and
move to one of the printer-connected computers. Always try to make sure it will print how you want it the
FIRST time. In general, we try to make the analysis such that it will take only one sheet of paper.
To see how the printed copy will appear, select Print Preview from the Office Button. Click on the Print
option and click Print Preview. If it will take many pages, try one of the following "tricks" to minimize
pages:

A. Have the document print horizontally rather than vertically: Click on the Page Layout Tab in
the Ribbon and click on Orientation in the Page Setup Group. Select Landscape for the
Orientation and click on OK. (Notice you can also Print Preview in this Group.

B. Change the scaling: Click on the Page Layout Tab in the Ribbon and change the Width and
Height to 1 page in the Scale to Fit Group.

Finally, once everything will fit on a (hopefully!) single page, in the Page Layout Tab of the Ribbon,
look in the Sheet Options Group and check the Print boxes for Gridlines and Headings. This will add
gridlines to your cells and give them the alphanumeric headings (columns A, B, C, rows 1, 2, 3 . . .) that
enable someone looking at the sheet to locate specific cells.

After printing your worksheet, write the formulas used in Excel on the sheet itself or in your lab notebook.

+ ~`
You can also print the equations used by pressing
Ctrl
This changes the worksheet into a mode where any cells containing equations will display the equations
instead of the calculated value of the equation. Just hit the same keys to toggle the worksheet back to show
cell values.

Spend more time simply messing around with Excel. It's a powerful spreadsheet and fairly straightforward
to use, and it definitely has its quirks! But, if you learn it, it will save a lot of time for doing analysis.
USEFUL EXCEL FORMULAS

in English in Excel
plus minus times divided by power of + - * / ^
average =average(range)
standard deviation =stdevp(range)

π =pi( )

square root =sqrt(cell)


exponent (e.g. 3x10-3) E (e.g. 3E-3)

[arc]cosine of θ (θ in radians) =[a]cos(cell)

[arc]cosine of θ (θ in degrees) =[a]cos((PI()/180)*(cell))

slope from m=∆y/∆x =linest(y range, x range)

You might also like