Assignment 0a Excel
Assignment 0a Excel
Assignment 0a Excel
This assignment goes through basic modeling in and several functionalities of Excel,
forming a basis for the rest of the course. The exercises below correspond to questions in
the Canvas quiz. The Excel file containing all the numerical answers and charts must be
submitted to the last question of the quiz.
(a) Investigate why Equation (1) does not always hold in Excel.
Open an Excel workbook and name the first sheet ‘A.1’ and program f (p) in two
ways. You may use figure 1 as an example on how to format your sheet. First, put
the value of p in C2, taking p = 3. Next, put the outcome of f (p) in C3, by filling in
the formula in C3 and referring to cell C2 to get the value of p. Second, put 10p in C5
and 10−p in C6, and calculate =C5+C6-C5-C6 in cell C4.
The two should be equal, but one of the two is not even 0. This kind of errors do not only
happen in Excel, but happen in any programming language like Java, Python, and R.
So, what is happening? Excel stores Double Precision Floating Point numbers, a.k.a.
Doubles. These are 8-byte variables, storing numbers with 15 decimal places. Even when
one sees a number with two decimals, the underlying value has 15 decimal places.
1 1
(b) Investigate 3 + 3 + 13 .
Put ‘=1/3’ in three cells below each other and make sure Excel interprets the cell as a
number1 . Select these cells and go to Home (Tab) > Number (Group) > Decrease Decimal
(Command), till all three cells show ‘0.3’. Adding these three cells together will result
in 1.0, although visually 0.3 + 0.3 + 0.3 = 0.9 6= 1.0. Showing that the underlying
value is used, regardless of the formatting of the cells.
1
Assignment 0.a, Excel Introduction to Business Analytics
The way we have learned to store numbers, is in base-10, for instance, 13 = (3 × 100 ) +
(1×101 ). Computers store in binary, thus 42 = (0×20 )+(1×21 )+(0×22 )+(1×23 )+(1×24 ).
Likewise, fractions are stored as 0.75 = (1 × 2−1 ) + (1 × 2−2 ) + (0 × 2−3 ). The consequence
is that it is impossible to store the number 1/10 = 0.1 in binary form without a small error.
These are no errors or ‘bugs’, but well-known limitations.
(a) Create an Excel table that depicts the difference in length of bars with lengths of
L = 0, 20, 40, . . . , 100 meters in the columns, at temperature differences of ∆T =
0, 5, 10, . . . , 75◦ C in the rows, with α = 12 × 10−6 . This expansion coefficient corre-
sponds with Concrete2 .
First, create the row and column headers with the values of ∆T and L. Next, cre-
ate a formula in the table that uses both absolute as well as relative references3 .
One should create a formula that can auto-filled the whole table, by dragging the
fill-handle. Make sure that there is the flexibility to fill in different values for the
expansion coefficient α, i.e., reserve a separate cell outside of the table to store the
value of α and reference to it in the formula. An example of how to format your file
is given in Figure 3.
Cell names make formulas readable. Give the cell containing the numeric value of α
the name Alpha and adjust the table formula to include this cell names. Lastly, copy the
table4 and paste its transpose next to it5 .
and go to Home (Tab) > Number (Group) > Number Formats (Command) and select the correct format from
the drop-down menu.
2
en.wikipedia.org/wiki/Thermal expansion
3
$B$2 is absolute row and columns, B$2 is relative columns and absolute rows, and $B2 is absolute
columns and relative rows.
4
Select the complete table, copy it on the clipboard by Ctrl+C, the Copy command in the Home tab, or
right clicking on cell to find Copy in the Edit Menu.
5
Select an empty cell and use Edit menu > Paste special > Transpose or clicking on the arrow below
Paste in the Clipboard group.
Page 2 of 8
Assignment 0.a, Excel Introduction to Business Analytics
Page 3 of 8
Assignment 0.a, Excel Introduction to Business Analytics
Always make sure your graph has a relevant title and axis titles, and, if needed, a legend.
Page 4 of 8
Assignment 0.a, Excel Introduction to Business Analytics
Page 5 of 8
Assignment 0.a, Excel Introduction to Business Analytics
B.1 Gender
Analyze the number of male against female babies born and give the result in percentages.
This exercise can be solved in multiple ways, choose one. One can use COUNTIF and COUNT
or use a Pivot Table. When one uses the latter, put the Pivot table on a new sheet which
should be named B.1. One can put any of the features in the Values field when constructing
the pivot table. Click on the chosen feature in the Values field and choose the Value Field
Settings to summarize the value field by Count. Moreover, choose to Show Values As ‘%
of Grand Total’ in the Value Field Settings.
B.2 Time
Calculate the number of babies born per hour.
Add a column to the dataset which calculates in which hour of the day the baby is born.
Use the following definition, a baby is born in hour ‘0’ when the birth time was between 0-59
and in hour ‘1’ between 100-159, etc. For this, one can, for instance, use the ROUNDDOWN or
INT function. Next, analyze the dataset using a pivot table on a new sheet called B.2. Set
the hour on the Rows and the delivery method on the Columns, counting the occurrences.
Page 6 of 8
Assignment 0.a, Excel Introduction to Business Analytics
B.3 Age
Create age groups by making bins of size m, 0 − m, m − 2m, ....
We want to gain insight in the age of the mother and father, by making age groups such as
20 − 24, 25 − 29. The group size is defined as m, such that we can change it easily. Create
a new table with two columns, the lower bound and upper bound of the age group. The
first column will be (0, m, m + m, ...) and the second column will be (m − 1, m + m − 1, ...).
If m = 5, this will result in (0, 5, 10, ...) and (4, 9, 14, ...). Add a third column creating the
labels of the group, thus 0 − 4, 5 − 9, .... This can be done with TEXTJOIN using " - " as
delimiter.
Count per age group how many mothers and separately how many fathers are in the
data.
Put the outcomes in the next two columns of your table. For this, use the COUNTIFS function
with two criteria. The function requests a Criteria range, which is the data column with
the actual age of the mothers or fathers. Moreover, the function requests the Criteria which
follow the syntax ">="&A1 and "<="&B1, with A1 and B1 references to the lower and upper
bound of the group. Note that in your worksheet, the references can be to other cells. Test
if it works to change m to different values.
Page 7 of 8
Assignment 0.a, Excel Introduction to Business Analytics
Page 8 of 8