You are on page 1of 19

WR304 Excel tutorial

Spring 2007, by Stephanie Kampf

In this tutorial, we will work on processing met data that I downloaded for my hometown, Grand
Junction, Colorado. The file, gjmet.txt, contains all the data from the NCDC website, and the
file, gjdoc.txt, contains information describing the format of the data.

1) Open Excel. To import the data file, go to File Æ Open. In the browser window that
appears, make sure you specify that you are looking at Files of Type Æ All Files. Select
the data file, gjmet.txt.
2) After you select the file, the Text Import Wizard will appear. In the first window, click
“Delimited” then “Next”:

3) This file is delimited by commas – you can see all these commas between each column of
text. Select “Comma” then “Finish”.
4) The data should appear in excel and look like the window below. The text file contains
the following data fields:

MMNT: mean monthly minimum temperature in TF (tenths of degree F)


MMXT: mean monthly maximum temperature in TF
MNTM: mean monthly temperature in TF
TPCP: total monthly precipitation in HI (hundredths of inches)
TSNW: total monthly snowfall in TI (tenths of inches)
5) Save your file as an excel spreadsheet. File Æ Save. Save as type Æ Microsoft Office
Excel Workbook:
6) Now we will create a separate worksheet for working with a segment of the data. Go to
Insert Æ Worksheet. A new blank worksheet should appear. At the bottom of the
screen, look for a tab that labels this worksheet, “Sheet 1”. Right click on that tab, and
select “Rename”:
7) We are going to work with the MNTM (monthly mean temperature) data, so I will call
the new worksheet “Tmean”. This is the worksheet in which we will process all of the
monthly mean temperature data.

8) Now we will filter all the MNTM data from the spreadsheet. Click on the tab with the
original data (mine is called gjmet). Click on the top of the column labeled “ELEM”.
This should highlight the entire column:
9) To filter out only the rows with MNTM, go to Data Æ Filter Æ Auto Filter.

10) You should now see a little arrow in the cell labeled “ELEM”. Click on this arrow, and
select MNTM:
11) This filters the data, so only the rows labeled “MNTM” are visible:
12) Next we will select all of the columns we need to graph average monthly air
temperature. Click on the top of the “YEAR” column and each column labeled with a
month. To select multiple columns, hold down the “Ctrl” key while you click:
13) When you have selected all the columns, Copy them to the clipboard. You can do this
by going to Edit Æ Copy or by hitting the keystroke combination, Ctrl-C. Paste the
columns into your Tmean worksheet (Edit Æ Paste or Ctrl-V). Now your Tmean
worksheet should look like this:

14) You are now ready to perform calculations on the data. In excel, you can perform a
calculation in any cell. Each cell is indexed by a column and a row number. For
example, the label “YEAR” is in column A and row 1. This cell is therefore called “A1”.
The year, 1975, is in cell A2.
15) For these data, we need to convert temperatures from tenths of degrees F to degrees F.
For example, to convert January temperatures to degrees F, type the label, “Jan (F)”, in
cell N1.

In cell N2, type the expression “=B2/10”. The “=” sign tells excel that you are entering a
formula. In the formula, you can either type in the cell index, B2, or just click on the cell
to have excel automatically enter the index for you:

16) Hit enter when you are finished with the formula. You can copy this formula down to
the rest of the column by double clicking the little square box at the lower right corner of
the cell (N2 in this case):
17) Excel has many built-in functions for calculations. For your class assignment, you will
need the function, “average”, which obviously calculates the average of a series of
numbers. For example, to calculate the average of the January monthly average
temperatures, type the expression, “=average(B2:B33)/10”.
18) If you want to highlight this cell to distinguish it from others, you can click on the little
bucket tool and select a color:
19) You can then copy this formula into each of the month columns. There are many ways
to copy a formula from one cell to another. You can click on the cell you wish to copy
then use your mouse to drag the little square anchor on the cell into adjacent cells.

Alternatively, you can copy the cell by going to Edit Æ Copy; then highlight the other
cells where you want this same formula; then go to Edit Æ Paste.
20) Now we are ready to make a graph of the mean monthly temperatures. To create a
graph, highlight the cells you want to plot. In this case, we want to highlight the month
labels and all of the cells containing the monthly averages we just calculated. Hold down
the Ctrl key to highlight these two separate rows of cells.
21) Click on the little graph icon, or go to Insert Æ Chart. The chart wizard should appear.
Select a “Column” graph, and click on “Next”:
22) In the next window, fill in appropriate labels for the graph:

23) Finally, choose where you would like to see the graph in excel. In this example, I am
sending the graph to a new worksheet:
24) Now you should have a plot that looks something like this:
25) You can modify the plot by right clicking on the component you would like to change.
For example, if you right click on one of the axes, you should get an option to Format
Axis. There you can change the font style, size, color, etc. You can also change the
background color of the plot by right clicking inside the plot area. Here is a modified
version of my graph: