You are on page 1of 12

Excel 2007 Basic I

Physics Teaching Laboratory,


HKUST

Do You Know How to?


create scatter plot?
add chart title and axis title?
add trendline to scatter plot?
find errors of slope and intercept?
add error bars to a scatter plot?
create plots of two data series on one graph?

How to enter information into Excel 2007


An Excel spreadsheet is a series of small blocks (cells) where the
columns are labeled with capital letters and the rows are labeled
with numbers.
To enter data into Microsoft Excel, simply type each entry into its
cell.
Enter your x-axis data into left column (e.g. A);
y-axis data into right column (e.g. B).

Useful function in Excel


You can type worksheet function in an empty cell, here are some examples:

Sum of two numbers


=A1+A2

Logarithm
=log(A1)

Sine
=sin(A1)
* note: the unit of data in A1 cell is radian

Average
=average(A1:A10)
* note: (A1:A10) is range of data from A1 to A10 cells.

You can find more function using Excel Help

How to create scatter plot


1.

Highlight all of the entered data.

2.

Click on the INSERT tab on the top of the Excel screen.

3.

Choose the scatter option in the charts menu and select the first sub-type, Scatter with
only Markers.

4.

The scatter plot of the data will now appear within the Excel worksheet.

How to add chart title and axis title


1.

Click on the scatter plot just generated

2.

Click on chart layouts and choose Layout 1

3.

Change the chart title and axis title as shown

How to add trendline to scatter plot


1.

Right click any of the data markers.

2.

Select the add trendline option on the shortcut menu. A Format Trendline dialog box will appear.

3.

Select Trendline Options:


Trend/ Regression Type = Linear
Display Equation on chart
Display R-squared on chart

4.

Excel will display the trendline


for the data and an equation
for the suggested line.
In our example, the equation is
y = 31.06x + 0.1073

How to find errors of slope and intercept


Click on an empty cell and type in:

=index(linest(B2:B6,A2:A6,true,true),1,1)
where,
B2:B6 is the range of y data
A2:A6 is the range of x data

1,1 = slope
1, 2 = c
2,1 = m
2, 2 = c

How to add error bars to a scatter plot


1.

Type in the error data in a new column (e.g. Column C)

2.

Click on the chart. This displays the Chart Tools, adding the Design, Layout, and Format tabs.

3.

On the Layout tab, in the Analysis group, click Error Bars.

4.

For scatter charts, both horizontal and vertical error bars are displayed by default. So, choose Error Bars
with Standard Error to make both horizontal and vertical error bars appear on the graph first.

How to add error bars to a scatter plot (Continued)


5.

To remove the error bar of one axis: Click on the error bar and press DELETE.
* in our example, we remove vertical error bar

6.

To change the amount of error bar of one axis: Right click on the error bar and select Format Error Bars
in the shortcut menu. A Format Error Bars dialog box will appear.
* in our example, we change the amount of horizontal error bar

7.

Select Custom and click Specify Value

8.

Choose the Column C for both Positive and Negative Error Value and Click OK

9.

Close Format Error Bars dialog box.

How to create plots of two data series on one graph


1.

Right click the first chart and click Select Data

2.

In Select Data Source dialog box,


click Add Legend Entries (Series)

How to create plots of two data series on one graph (continued)


3.

Select the Series X values and Series Y values and Click OK

You might also like