Lab 3 Guide Sp2024 v1
Lab 3 Guide Sp2024 v1
Adapted from: J. Chem. Educ. 2015, 92, 1840-1845 and versions of Chem 104L lab guides, Sp2023 version1
Goal
To increase awareness of analytical tools for chemistry using Microsoft Excel and Logger Pro
for chemical calculations and analysis of chemical data.
Skills to Develop
Using a spreadsheet (Microsoft Excel) with formulas to carry out calculations
Graphing data and obtaining standard error using Logger Pro, including obtaining a best fit line
and R2 value
Tools
Laptop or computer (please bring your laptop to lab if you are willing and able); each person
should have access to Excel
Introduction
A spreadsheet is a useful tool for organizing raw data and performing basic mathematical and statistical
analysis. Learning how to use spreadsheets in the beginning of the semester and continuing to improve
your skills will save you precious time performing data analysis. Although the calculations necessary for
some labs can easily be done using a scientific calculator, it becomes impractical, if not impossible, to
perform data analysis for more complex labs without the use of computerized spreadsheets. You may
also find that Excel is a great tool for homework in science classes, including CHEM 102. Even if you
do not plan on pursuing a career in chemistry; however, learning how to compose and manipulate
spreadsheets is a useful tool for any type of data organization including social science research, public
health research, and medical research.
Some of the major advantages of using a spreadsheet are that repetitive calculations can be duplicated
with just a few keystrokes, mistakes in calculations can be fixed by changing single cells or functions,
and data is organized in a clear and understandable way.
This ‘lab’ will walk you through some Excel basics in the context of some simple (and difficult)
chemistry problems that you might encounter in a quantitative chemistry lab context. Depending on your
level of Excel fluency, you may already know some of the basics. Try to use this tutorial to help develop
some of the more elegant and useful commands.
1
During this tutorial you will be asked to modify a spreadsheet to make it your own. Make sure to save
your work frequently in order to secure your work. Use a distinct naming convention for your lab
data files, such as “course year lastname firstinitial lab#.xlsx” (CH102LA 2023 doe j labS.xlsx is the
name of file that Jane Doe would use for Lab #3 of CH102L Section A in 2023). Answers to some
questions should be given on the lab worksheet.
Download the Lab 3 Template from Moodle, open the spreadsheet and locate cell D5. This
cell is in the fourth column and fifth row of the spreadsheet.
What is the code used to reference the cell in the eleventh column and fortieth row? Record
your answer to this question in your worksheet as Problem 1.
Note: All the commands in this tutorial will be typed in bold to differentiate them from the
rest of the text, but while performing actual calculations, you should not use bold font to
type the commands.
Cell appearance — when a cell or range of cells is selected, it’s appearance will change to let you know
it has been selected. Interaction with cells will make more sense if you understand what you are seeing.
In the table below, the bold outline indicates cell A1 has been selected, but the cursor has different
shapes depending on where it is placed over the cell.
Cursor location is over the Cursor location is over the Cursor location is over the
center of the cell edge of the cell lower-right corner
Select – allows you to select Move – allows you to drag Copy – allows you to copy
the cell or drag to select a the cell to a different place the contents of the cell to
range of cells another cell or cells by
dragging this corner
Test yourself – select cell A9, type a number in the cell, move the cursor to the edge so that it looks like
the middle image above and drag it to a lower cell, finally, move the cursor to the lower-right corner and
drag to a different cell to see how it works.
2
One use of a spreadsheet is as a basic calculator, but unlike most calculators, it stores your results, which
can used in subsequent calculations. All calculations in the spreadsheet must begin with an equal-sign
“=”, indicating in that cell you are performing a calculation. Below is a table listing basic mathematical
operations and the correlated commands.
Notice that multiplication must be done using the asterisk (*); Excel does not recognize using “x” as a
symbol to perform multiplication or likewise it does not recognize paired parentheses as implying
multiplication (i.e. (A1)(B1) would not work, but (A1)*(B1) would work). We will now use some of
these mathematical operations to solve a basic chemistry question using Excel.
To appreciate the power of doing chemical calculations in Excel, complete this two-part problem – you
will do the first part by hand, then use Excel to solve the second part.
Problem 2A: If you mix 5.000 grams of Fe2O3(s) with an excess of CO(g) according to the balanced
chemical reaction:
Fe2O3(s) + 3CO(g) → 2Fe(s) + 3CO2(g)
Problem 2B: Now you will solve the same problem again, this time using Excel. One of the advantages
of Excel is that it becomes easy to change variables and see how it changes the result, as you’ll see when
you work through this problem.
Start by opening the following table (Problem 2) in your Lab 3 Template spreadsheet:
3
Your goal will be to set up the solutions in the table so the values in each cell are calculated from cells
with a value that has already been given. To do this, you need to know about referencing cells. Do not
type the answers from the first part of the problem into the empty cells. You will use Excel to do the
calculation work for you, as described here.
Referencing Cells
When typing out the equations to fill in the blank cells, it is not necessary to retype numbers that are
already present, rather you can click on the cell containing that number to refer to it. Consider cell E5 in
the table above. When you did Problem 2A, you should have calculated moles CO2 by determining the
number of moles of Fe2O3 you had and multiplying by the stoichiometry coefficient (because. In Excel
language, the calculation would look like this:
= (5.000/159.69) * (3/1)
where 159.69 is the molar mass of Fe2O3(s) and 3/1 is the stoichiometric ratio. Instead of manually
entering the numbers, consider the following version that references the appropriate cells in the table:
=B5*(E2/B2)
Now, if you were to change the starting grams of Fe2O3, your calculation would automatically adjust.
Using this approach, now enter formulas in each empty cell of your spreadsheet for
Problem 2. Your handwritten approach should help you figure out what you need for each
cell. To make sure everything is set up correctly, your formula for cell B5 should give you
0.03131 moles of Fe2O3(s).
Fill in the remainder of the Excel table; the calculated result should match your
handwritten response.
You may realize that there are an excessive number of decimal places in some of your values. Excel
does not automatically account for significant figures; thus, it is your responsibility to be aware of
appropriate significant figures. In that way Excel is like your calculator; unless you take control of how
the number is displayed, Excel shows many digits. On the other hand, the number that you report in your
assignments that needs to reflect the correct number of significant figures.
That said, you can control the number of decimal places that are being displayed.
There are two ways to do this: (1) On the Home ribbon, the Number button allows
adjustment of the digits displayed left or right (see left and right arrows in the
image at right), or (2) use the format cells feature. Adjusting the cell number
format allows you to convert the number displayed to the correct number of
significant figures, scientific notation, fractions, percentages, and other formats
that may be useful.
Convert values in the cells in row 5 into scientific notation, and all
values within the table to have three decimal places (cell E5 should
read 9.393E–2)
With the use of calculators there is always the danger that rounding a number too early in the calculation
will result in an incorrect answer due to ‘round off error;’ and for that reason, you are normally advised
to not round to the correct number of significant figures until the end of your calculations. One of the
4
advantages of using Excel as a calculation tool is that it does not round the number that is stored in
memory – when you change the formatting, it only limits how the number in the cell is displayed.
Change the value in cell B3 to 6.500. What are the values in cells D6 and E3?
Report your answer in your lab worksheet under Problem 2B.
Hopefully it is apparent that using cell referencing is a very valuable feature; if you make a mistake in a
calculation, you can go back and correct the cell with the mistake and all subsequent cells that include
the reference will automatically update accordingly.
Now is a good time to save your Excel sheet – besides your report sheet, you will submit your resulting
Excel sheet for grading.
Part 3 – Dealing with More Data
There are a number of shortcuts that make it easier to deal with large datasets. Consider, for example, a
case where you want to copy a formula you have typed down a number of rows or across a number of
columns. If you copy a formula containing reference cells down several rows, then it will automatically
adjust the cell references to match the new cell. For instance, let us assume that you have the formula
=(G2/A2)*H2 in cell I2. If you copy this cell to I3 then the formula will now read: =(G3/A3)*H3. If
you copy the cell to J3 then the formula will read =(H3/B3)*I3.
It is often the case that we want to copy the general formula, but that some of the cell references should
remain unchanged. Adding a dollar sign ($) before the letter or number in the cell reference then it will
remain unchanged when copied. If, in our previous example, cell I2 had been =(G2/$A$2)*$H2 then
copying the cell to J3 would give the formula: =(H3/$A$2)*$H3.
Problem 3: You are preparing a set of dilutions from a stock iron (Fe) solution with initial concentration
of 0.50 mg/L. Hint: using the dollar signs in the cell reference before both B and 2 allows you to keep
the cell reference as B2 as you copy equations into antoher cell.
If you do not know how to ‘drag’ values or formulas down a column or across a row, ask your TA or
instructor to show you before starting this problem.
5
Open Sheet Problem 3 on your Lab 3 Template:
Complete the table (if you enter your formula correctly, your final value for cell D8 should
be 5.0x10-3). Make sure you set your equation up so that you do not have to retype it for each
row.
Record the answers to the following questions in your worksheet under Problem 3:
What is the value of cell D11?
In your own words, describe what would have happened if you would have only put a dollar
sign in front of the B.
Use the data in the table below and the skills in this tutorial to determine the average (hint: type ‘=aver’
and select the appropriate formula) freezing temperature of both the pure lauric acid and the solution.
Then using the average values, use your Excel sheet to calculate
a) the molality of the solution,
b) the number of moles of solute, and
c) the molar mass of the solute to appropriate significant figures.
For comparison, provide a handwritten calculation using just the first trial on your report sheet under
Problem 4.
6
4 43.15 4 40.29
5 43.11 5 40.28
Data for Problem 4 – already entered in the Lab 3 spreadsheet.
Part 5 – Using Excel for calculation and Logger Pro for linear fit information
Using your spreadsheet, incorporate as many of the elements you have learned as you can to solve the
following problem clearly and efficiently, and then follow instructions for using Logger Pro to
perform linear fitting to analyze the calculated results.
Problem 5: The vapor pressure of a liquid increases with increasing temperature. A student measures
the vapor pressure of a liquid at various temperatures multiple times in order to determine ΔHvap for the
liquid. The data can be found under the Problem 5 tab of the lab template.
Use your Excel skills to calculate the input needed to use the Clausius-Clapeyron (CC) equation
(namely, inverse temperature (in Kelvin units) and natural logarithm of pressure).
Launch Logger Pro.
o You do not need your laptop to be connected to a data acquisition device. If you do not have
Logger Pro on your device, this is a chance to install it following instructions provided on
moodle, or you can move to another computer that already has Logger Pro. In the latter case, you
should email the CC calculated results to yourself.
o From Excel (or your email) you can cut and paste the CC data into the X and Y columns of the
Logger Pro file. Your inverse T data should be in the X column; change the name of the X label
of the column by double clicking on it and change to ‘Inverse Temperature’, here you also can
enter units of 1/K. The Y column name should be changed to ln(pressure), this is unitless. The
data is automatically graphed.
Next, we will perform a linear fit to the data. You should select the ‘Curve Fit’ button . This
gives you nearly two dozen types of fit functions; you can try any of them, but we will focus on the
linear function (you may have to drag up or down in the window of functions). Select it and click
‘Try Fit.’ The preview allows you to see the fit. Since we expect the calculated result to follow a
linear function, it should show the resulting line is a good representation of the data. Click OK. The
equation information for the linear result is provided along with the slope as one of fit parameters.
The fit results also provide the standard error in the slope, which is a measure of how well we know
the slope based on the input data.
7
Write the following info on your report sheet under Problem 5:
m (Slope) including std error
b (Y-intercept) including std error
Correlation
RMSE
o Calculate the square of Correlation, which equals R2, write it on the report sheet.
o Correlation, R2 and RMSE are figures of merit for the fit of a model (like a linear
equation y = mx + b) to data. For systems that follow a linear model, the R2 value is often
characterized by the number of ‘nines’ in the value, the more nines, the better. This fit
has an R2 value with two nines – we will compare that to the fit in Problem 6.
o RMSE represents root-mean-square error, which is a relative measure of the quality of
the linear fit – a smaller RMSE indicates a fit with less error, therefore a better fit.
Use the slope to calculate the ΔHvap for the liquid in units of kJ/mol. Be sure to report your units
along with your answer in the report sheet.
Calculate the relative error in the slope, RE = Slope std error/Slope
Calculate the ΔHvap absolute error = RE x ΔHvap and round this number to one significant figure. This
error in ΔHvap tells you what digit is least significant, in other words, it is how you know the number
of significant figures (for example, a value of 38.3 ± 0.7 has only three significant figures because
the error tells us the digit to the right of the decimal place is least significant, based on how well we
know the linear fit to the data.
Report your final value for ΔHvap including error and appropriate significant figures.
Go back to your Excel sheet and use the linear equation you generated to calculate the vapor
pressure of the liquid at the following temperatures: 204K, 258K, 312K, 480K, and 507K. Use Excel
for the calculations. For full credit, your calculation should only include references to other cells, not
numbers. You must also set up your calculation so that you can drag the formula down the column to
calculate the vapor pressure at any of these temperatures. Record your pressure at 312 K on your
worksheet under Problem 5
This is a good place to reach in the lab. Save your sheet. The next two problems are optional. They will
give you good additional experience with both Excel and Logger Pro. For those who reach this point
with enough time remaining in the lab period, you are encouraged to choose one or both problems.
Complete the summary on the worksheet when you are finished.
Problem 6: See how vapor pressure data for a different liquid gives a different result. Using the
spreadsheet data in the tab for Problem 6, follow the same approach as in Problem 5. Copy your
calculated inverse temperature (in Kelvin units) and natural logarithm of pressure) over to Logger Pro,
do a linear fit to find the fit parameters including the errors in slope and intercept – like the previous
problem record these values on your worksheet. Calculate R2. Determine the value for ΔHvap including
error and appropriate significant figures.
What difference do you notice about the RMSE value? Which fit is better, Problem 5 or 6?
The data for Problem 6 come from the science literature and might be expected to provide a better fit.
Are you able to report a result with more significant figures?
8
Part 7 – Graphing in Excel
By now you’ve hopefully come to appreciate the computing and organizational abilities of Excel. In
addition to its excellent ability to keep track of data and perform calculations, Excel can also be used to
make graphs. Graphs are an essential tool in the scientist’s arsenal - they enable someone to present
large amounts of data in a concise manner that immediately draws the reader’s attention to a trend or
pattern. Unfortunately, the format and types of default graphs that Excel makes are far from on-par for
science purposes.
For your reference, here are examples of an incorrect graph and a corrected version of the graph:
Incorrect Correct
temperature
9
Problem 7: A public health researcher hypothesized that there is a correlation between height and
weight. (Note: 1 kg = 2.2 lbs.) She recorded the weights of various individuals of different heights (3 per
each height), as shown in the table shown below.
10