Excel for Gen Chem General Chemistry Laboratory September 15, 2014 Excel is a ubiquitous data analysis software. Mastery of Excel can help you succeed in a first job and in your further studies with expertise and skills to solve other organizational, computational, statistical or mathematical problems you ll encounter. Note: It is important to keep your raw data separate from the spreadsheet you re analyzing data in. In General Chemistry, keep your raw data in your notebook and do your data analysis in Excel. Getting to Know Excel You ll find these steps are specific to the Macs in the Keyes 405 lab. Things will be similar on other machines the functions available in Excel will be the same but some of the menus and keyboard keys will be different. Also, there are a lot of different ways to do things in Excel. You can pretty much control everything from the keyboard, or you can control everything from the mouse. These instructions mix these two methods to give you more to build on. Starting Excel Click on the Excel icon in the Dock. The Excel Workbook Gallery will open, click on the Excel Workbook. A blank workbook page should appear containing a grid of cells with letters labeling columns and numbers labeling rows. Entering numbers or text Click in the cell that you wish to type in. Type numbers or text. To record the newly typed data, hit return.. This moves you to the next cell down. If you hit tab., you move to the cell to the right. To reverse either of these directions, hit.. + return. or + tab.. If you made a mistake and want to leave the contents of the cell unchanged after you have started typing, hit esc.. Note: Any changes can be undone using the undo keyboard shortcut:.. + ż. Anything undone can be redone by using the redo shortcut:.. + ẏ. Entering formulas You can use Excel to do math. Formulas always start with an equals sign; the cell will contain the formula but display the output. If you enter =1+1 in a cell, and hit. return, the cell displays 2, but if you double click on that cell, you can edit the formula. Note: Another place to edit cell input is in the formula bar that looks like this:. Normal arithmetic operations work as expected including / for divide, * for multiply, and ˆ for raise to the power of. Order of operations follow normal calculator rules or can be established using parentheses. Check that yourself: Enter =(5+4)ˆ2 in one cell and =5+4ˆ2 in another. You can use the values of other cells in your formulas. We ll use this a lot in General Chemistry. Give it a try: enter 1 in cell A1 and 1 in cell A2 and =A1+A2 in cell A3 and hit. return.
Excel for Gen Chem General Chemistry Laboratory 2 Click once on cell A3 and copy it (.. + ċ ), you can paste in cell A4 (.. +. v ). The value in A4 is different than that of A3 because when you copy, you copy the relative cell reference. If you were to copy A3 and paste it down A4,A5,A6,,A10 you ve generated the Fibonacci sequence. Cool! In addition to relative cell references, you can make absolute cell references. In cell C1, type the word scale and in cell D1 enter 25. In cell B1 enter =A1*$D$1. If you copy this cell down the B column, you ll see that the reference to the row in column A changes, but the reference to D1 does not. If you change D1 s value to another number, all the values in column B will change. The last thing for now is using Excel s intrinsic functions. Make sure you ve copied the contents of A3 down to A10. In cell A11, enter =AVERAGE(A1:A10) and hit return. If you re on track, the value 14.3 should appear. Other intrinsic functions we ll use include =STDEV() for the standard deviation and =COUNT() for the number of things in a list. Note: In the =AVERAGE() function above, we used Excel s list notation, taking the average of values in cells A1 to A10. Use commas include non-continuous cells in your lists. Note: You can make a list with the mouse by dragging over the cells in the list (and holding.. to add on non-continuous cells). To do this, enter =AVERAGE( in cell A11, with the mouse, drag over A1 to A10, A1:A10 should appear in your cell entry. Close the parentheses and hit return.. Note: You can make a list with the keyboard. To do this, enter =AVERAGE( in cell A12, hit the up arrow to move the highlighted cell to A10. Hold.. and highlight the cells to A1. Close the parentheses and hit return.. There are also intrinsic functions for arithmetic including =SQRT(), =ABS(), =EXP(), =LN(), =LOG() (note, this is base 10), =SIN(), etc. Formatting Cells You can change the way numbers and text are shown in the cell in different ways. Font: You can change the font to be bold (.. + ḃ ), italic (.. +. i ) or underline (.. +. u ). You can also change the font itself. I find Microsoft s default Calibri to be a bit casual and tend to prefer the more traditional sans-serif fonts like Arial or Helvetica. Find your own style! Make sure your toolbar menu is at, pick another font from the drop menu under the word Font. Another way to change fonts in Excel is to use Themes. On the same toolbar menu under the word Themes you can pick a different theme that applies font changes throughout the workbook. The Clarity theme has Arial as the main font. Use the buttons under the word Aligment to toggle between centered, left-, or right-justified text. Number: A number in a cell can be shown in different ways. In a cell enter =PI() and hit. return. The numeral representation for π should appear. While on the toolbar menu, play with the drop down menu under the word Number. The options General, Number and Scientific may be the most useful. You can also change the precision of the number represented by clicking the buttons in the same
Excel for Gen Chem General Chemistry Laboratory 3 area of the menu. Note: Changing the format of the number doesn t change the value in the cell, only what you see on the screen. This can be confusing if you use the Percentage number format. Borders: You can also add borders for more readable tables, I use a bold top and bottom border with a thinner border until your column headings with no borders between columns. You see examples of this style of table in the lab documents. Find your own style. You can control border placement using the button. Making Graphs and Linear Regression This guide leads you through similar steps to make your figures for the experiment from week 1. Enter the following data into a spreadsheet: Highlight the numerical data. When you make a plot, the x-axis is the column to the right of the y-axis. This can be fixed later, but it s something to keep in mind when you re organizing your data. Go to the Charts toolbar and click scatter. Pick Marked Scatter. Don t pick a scatter plot with lines connecting points. The following graph will appear in your workbook:
Excel for Gen Chem General Chemistry Laboratory 4 Excel s defaults are not suitable for General Chemistry laboratory. The axes and chart aren t labeled, and the axes are hard to see. There are no x-axis gridlines, but there are y-axis gridlines. There is a key, but it takes up a lot of room, and only one thing is plotted. The markers have a gradient fill and shadow, which doesn t print well and is distracting when looking for trends or values in the data. We re going to make this better: 1. First, click on the word Series so it s highlighted, and hit. delete. 2. Click on the y-gridlines extending across the graph, and hit. delete. 3. Go to the Chart Layout toolbar, and turn on the Chart Title and both Axis Titles. 4. Go back to the Charts toolbar, and pick a Chart Style with data markers without a gradient fill and without a shadow. 5. Double click on the data markers. A format menu should pop up. You can use the options at the right to set the color (medium blue), marker line (none), and marker style (dots, size 6). 6. Double click on the x-axis. A format menu should pop up. Set the line color to black and the weight to 1.5 pt. 7. Repeat the last step for the y-axis. 8. Rename the x-axis and y-axis, and the chart title. By convention, scatter plots are titled y-axis versus x-axis. 9. Double click on each of the labels and set the font size to 14 for the title and 12 for the axis labels 10. Click on the corner of the blue box containing your chart and make the chart more square. After you ve completed all these steps, your graph should look like this:
Excel for Gen Chem General Chemistry Laboratory 5 Much better! Note: Excel defaults the origin of the graph to be at (0,0). That isn t always the best way to present your data, so you may have to change the range of the axes. This is done at the same menu as steps 6 and 7 above. I also copied the degree sign from a Word document. You can also copy it from a website. Adding a Trendline Hold. control and click on a data point. Pick Add a Trendline.... From Type, pick Linear. From Options, pick Display equation on chart and Display R-squared value on chart. Move the equation so it s out of the way of the data. Your graph should look like this: Pretty good! To learn how to get error bars for the fit to the linear trendline, see the Error Analysis document on the course website. Using Excel to Do Your Math This guide will help you build the Excel spreadsheet for the second week of lab.
Excel for Gen Chem General Chemistry Laboratory 6 Let s say I want to predict the mass spectrum for ethanol, C 2 H 5 OH. Following the directions from the lab manual, I set up the following spreadsheet: We can use this spreadsheet to easily calculate the molecular mass of each isotopologue by the sum of the mass of each constituent isotope multiplied by the number of atoms of that isotope in the molecular formula. For the MH + isotope in this spreadsheet, the Excel formula would be =B3*B6+D3*D6+F3*F6. But, using absolute and relative references in Excel, we can write this formula in a way we can copy it and paste it into the other istopologues: =$B$3*B6+$C$3*C6+$D$3*D6+$E$3*E6+$F$3*F6+$G$3*G6 Likewise, we can calculate the isotopologue percent abundance as the product of the percent abundance of each constituent isotope raised to the power of the number of atoms of that isotope in the molecular formula. Written in a way we can copy this to the other isopologues, this formula is =$B$4ˆB6*$C$4ˆC6*$D$4ˆD6*$E$4ˆE6*$F$4ˆF6*$G$4ˆG6 (ignoring distinguishability). Entering these equations into columns H and I, respectively, the results are where the last column is just each value from column I divided by the value in I6. Note: Think about significant figures in columns H, I, and J. Are they correct here?