Appendix A INTRODUCTION: Microsoft Excel is a popular software package that combines spreadsheet accounting, graphing, and database functions into one program. One can enter data, modify it, and then the data can be graphed. A spreadsheet is made up of numbered rows and lettered columns which form cells. Many types of information can be entered into a cell, such as words, numbers, or even mathematical formulas. You can use a spreadsheet to do many different things: to balance your checkbook, do your taxes, or analyze physics data. Below are some steps as to how to become proficient with Excel. This knowledge will be very useful in future labs and courses, so its to your benefit that you learn it well. OPENING AN EXCEL SPREADSHEET: To start working with a blank Excel spreadsheet, you should: 1. Log on to your station s computer. 2. Find and enter the Excel program, it is the green button as shown below: 3. After loading, the screen should appear as shown: 1
HOW TO USE THE SPREADSHEET: Rows run along the left hand side of the spreadsheet page and are numbered. Columns run along the top of the page and are alphabetized. A cell is where the row and column meet, for example, Cell C3, as shown below: An Example If we wanted to determine someone s average pitching speed, a spreadsheet would be used to analyze data on the distance a baseball travels in a certain amount of time. In such an analysis we would want to calculate the sped of each pitch and the average speed of all the pitches. Assume that you have collected data on distances and times of travel for a pitched baseball. Entering the Information and Data into Cells Now we will enter your recorded data into the spreadsheet so we can analyze it. To organize the data, write the titles for each column at the very top space. 1. Alphabetic Titles (and text in general) Use the mouse to select the cells in which you want to put the titles, and type in the titles shown below. After you type each entry, select the next cell into which you want to enter information, and the previous title will automatically be entered into its appropriate cell. Distance (m) Time (s) Average time (s) in cell A1 in cells B1,C1,and D1 in cell E1 Your spreadsheet should now look like that shown in the diagram below: 2
2. Entering Data Suppose the times you recorded in seconds for the three throws were: for 10m, t = 0.45s; 0.50s; 0.47s for 15m, t = 0.76s; 0.92s; 0.85s for 20m, t = 1.02s; 0.97s; 0.95s for 30m, t = 1.46s; 1.44s; 1.34s To enter the data, select the cell you want to put the data in and type the number. You can also move the black selector around the spreadsheet by using the arrow keys. Your spreadsheet should now look like that shown in the next diagram: 3. Entering Formulas To enter the formula that will calculate the average value of your times for each distance, follow these steps: (a) Select the appropriate cell for the average time, for the first set (10 metres), the location is cell E2. (b) Type: = (B2+C2+D2)/3. The screen should look approximately like that shown in the next diagram. (c) Hit the Return key and the value for the average of the three points should appear in the cell you selected. 3
To duplicate the formula into the remaining cells down below E2, put the mouse cursor on top of the bottom right hand corner of the E2 cell. When a small black cross shows up, click and drag down the column into the next two cells. The formula should now have been placed on all the remaining E cells, giving you the correct average time value, as shown below: Now notice that there are too many digits in the answer. To solve this problem, we will use a handy Excel function that will decrease the number of digits to a more reasonable value, like two decimal places. To do this, follow these steps: (a) Click on the Formatting Pallete at the top right hand corner. (b) This will give you a display of all the tool functions. (c) There are two tool options we have for changing of decimal places, one tool for increasing the number of decimal places, and one to decrease. The tool we would like to use is the one that decreases, click on it. 4
(d) Highlight the cells you would like the tool to modify, then click on. 4. Playing Around Try opening different windows and finding out what some of the commands do. You can try deleting data. To do this, select a cell holding data, and then press "delete" and hit "return". Observe the average when you do this. Be sure to re-insert any data you deleted before saving the file. 5. Using Functions Instead of Formulas Many of the common mathematical functions and formulas are available for your use with the spreadsheet. For example, instead of entering the formula = (B2+C2+D2)/3 in cell E2, you could have used the "Average" function. To do this: (a) Select cell E2 (b) Type = average( (c) Next select all the data points to be included in the average. (In this case, B2 through D2). Move the arrow to cell B2 and drag it across the row to D2. (d) Type ) so that the formula on the upper line of the screen is shown as "= average(b2:d2)" (e) Hit the return key. The same value for the average of the three points should appear in cell E2. There are many other functions available, including sin(), cos(), StDev(). StDev stands for standard deviation. 5
6. Other Handy Spreadsheet Features Two other features that are very useful in physics computations include formatting data and changing the width of columns. (a) Formatting: The Format Menu allows you to change the appearance of your spreadsheet. To format cells, select them and then choose appropriate items from the Format menu. You should experiment with the features and watch what happens in each case. (b) Column Width: If a column is too narrow to hold your values or is wider than needed, you can change its width. Just move the arrow to the line at the very top of a column, click on the mouse and drag the divider line between cells forward or back. There is also a Column Width command under the Format window. 7. Saving a Spreadsheet In order to save a spreadsheet for future use, you have three options: 1) Save your file in your SFU file server using the Apple file system. To access this system (your name is for example Jane Doe): a) Go to the Finder icon b) Type then K. Then for Server Address, type in afp://jdoe@home.sfu.ca (obviously, replace jdoe with your own computing ID) c) Press connect, then type in your password when asked. d) You are now able to transfer in and out of this file server. When saving a file, you can directly save into this directory. You can find this file under where when you click save as. Note: at home, if you have Windows or Linux, you must type in ftp://jdoe@fraser.sfu.ca Important: If you do not have a computing ID, please go to www.sfu.ca/acs/accounts, click on the link which says activate your ID and follow the instructions. If you have trouble activating your ID, contact ACS (Academic Computing Services) for help. 2) This next option is technologically less advanced and more of a hassle. Email the file to yourself to your SFU email account. This way, you can easily access it anywhere on any computer by simply checking your email and downloading the file from your webmail. 6
3) Not all students may have this option. But if you have a USB (thumb) drive, you can plug the drive in on the side of the computer monitor, where the USB plug is. HOW TO SORT DATA USING EXCEL Now that you know some Excel spreadsheet basics, it is time to learn some more features. One feature that will come in handy is sorting selected information in a row or column. Text information can be alphabetized and numbers can be put in order from lowest to highest or vice versa. For example, suppose you have analyzed pitching data for several individuals and you want to rank people according to how fast they pitch. To do this you should 1. Select all the data that you want to sort. Note: Any cells not selected will not be sorted. Also, if you sort cells which contain equations referring to cells that are not sorted, your sheet will become mixed up. The picture above shows some famous, not-so-famous, and simply infamous individuals and their respective pitching speeds. 2. After selecting the cells, go to the menu bar, choose the Data menu, and drag the cursor down to sort. A window similar to the one below will appear. 7
The only part of the sort window that you will need to deal with is the "sort by" part. Excel will sort the selected data according to the cell that is listed in the "sort by" part of the Sort window. It automatically lists the cell where the selecting started, which in this case is A2. This is the sorted data. Notice that George Bush and Paul Martin have changed positions and that the average speeds are in ascending order. HOW TO USE THE EXCEL CHART WIZARD To Graph Data: FOR GRAPHING 8
We will use the sample baseball pitching data to demonstrate how to graph on the Excel. Suppose you want to plot the distance a baseball travels as a function of its average timeof-flight. 1. In order to use the Excel Chart wizard to make a graph, you must organize your data properly in columns. The X-data (i.e. the horizontal axis data) should be placed in a column to the left of the column (or columns) of Y-data (i.e. the vertical axis data). Column headers with variable names and units may be placed at the top of each column to denote what variable is being plotted. In this case, the X-data represents average time and the Y-data the distance the ball has traveled in that time. 2. Once you have the data columns you want to graph next to each other, highlight them. If you highlight the column headers they can be placed as axis labels on your graph. Since we want to know how far the baseball has traveled as a function of time, the time axis is horizontal and the distance axis is vertical. Note: The computer will always take the highlighted column farthest to the left to be the X-data. If your X-data is to the right of your Y-data, you will have to move the columns around before graphing. 3. Click on the ChartWizard icon located on the tool bar in the top right part of the screen. You will then be prompted to do the following: 9
a) Choose the general type of graph you want. In general, you will probably wish to choose an XY scatter graph. Then you will be asked if you want an unconnected or connected dots graph. b) Enter any text you may wish for your graph. At this stage, you may enter a graph title and axis labels. At this point, Excel will create a graph using your highlighted data. It will look something like this: 10