You are on page 1of 20

Business Mathematics

Computer tutorial 1
1 Introduction

In this tutorial session, we will work on two topics:


• typesetting mathematical expressions (formulas) using Microsoft Word;
• using Microsoft Excel for quantitative modelling.
Details on the subjects to be explored are described below.

2 Working at home

You can further practice at VU, but most students will prefer to do that at home. Below are our
recommendations on the hardware and software requirements.

Check https://www.microsoft.com/en-us/education/products/office to obtain Office 365 (including


Word+Excel) for students.

At the digital exams, we use Office 365 on Windows 10, the English edition. Settings of decimal
separator (comma or dot) may be varying.

3 Hardware requirements

What is a suitable computer? It is a computer that can work with a recent version of Microsoft Office
(e.g., 2016, 2019, 2021, 365). Most Windows PCs and laptops, as well as Apple computers, are good
enough, if they are not very old (e.g., not older than five years). But Chromebooks, iPads and similar
“light weight” systems are not suitable. If you have a Linux system, you can run Microsoft Office with
some effort. Please notice that we can’t help you with setting up your computer.

Your computer doesn’t need to be superfast. We will only do basic calculations, no weather forecasts.

4 Software requirements

You must obtain and install a recent version of Microsoft Office. We recommend you to choose the
English version of the software. At any rate, all our instructions and screenshots are in English. At the
exams, you may need to report commands. For that we only accept the English version (e.g., “SQRT(2)”
and not for example WORTEL(2) (Dutch) or WURTEL(2) (German)). So please take care in what you
buy.

If you already have Microsoft Office in a non-English version, it seems that you can switch the working
language using the Options. Please use Google (e.g. “Excel change syntax language”) to find tips how
to proceed.

Mind that we use Microsoft Office, and in particular Microsoft Word and Microsoft Excel. There are
free alternatives (Google Docs, Libre Office), many of which resemble the Microsoft version to a high
degree (95% or so). However, they are not 100% compatible, so they provide no acceptable substitute
for our sessions, and certainly not for our exams.

5 Way of working

The purpose of our sessions is that you find out how to work with Word’s equation editor and Excel.
You do this on the basis of the documents (below, and for later weeks). These documents contain
explanations and exercises. By carefully reading, supported by thinking (this is a university, so we

BUSM 1 Computer tutorial 1


expect creativity from your side), you should be able to complete the sessions and obtain a good grade
at the exams.

In some cases, you may have a problem. The answer you find is wrong, or you can’t find an answer.
We expect a great capacity for solving problems from your side. Never ask “What should I do”. Instead,
say “I tried this and I tried that, but apparently I misunderstand something, can you give me a hint”.

Basically, the hierarchy in finding your way is as follows:


• use our tutorial below;
• discuss with fellow students;
• use Google, YouTube or another website;
• check the Canvas discussion forum, or post a thread to it;
• ask the teacher.
It is particularly helpful to discuss with your fellow students. Often there are different ways to
accomplish a certain task, and some students have discovered a clever short-cut.

You don’t need to hand in or even save anything. However, it can be good to practice everything,
including saving.

6 Equations in professional-looking documents

Although Word is definitely not the best option to type highly mathematical texts1, it is by far the most-
used word processor at businesses, offices and consultants.2 Because it is so popular, and because
business administration and economics are quantitative subjects, it is important that you are able to type
mathematical elements in your Word texts.

We assume you know the basics of Word: start-up, typing and formatting text, saving and opening files.
If you don’t please, make sure you quickly master those basic skills! There are hundreds of books,
tutorial websites, YouTube videos, etc, for using Word. You will need these skills for every course in
your study!

In our Mathematics course, we will concentrate on typesetting formulas according to the rules of good
science and mathematics. For instance, suppose you want to type the quadratic formula for solving a
quadratic equation (𝑎𝑥 2 + 𝑏𝑥 + 𝑐 = 0):
−𝑏 ± √𝑏 2 − 4𝑎𝑐
𝑥1,2 =
2𝑎
Without an equation editor, this will be very hard, and the result will look not really professional:
-b+V(b2-4ac)
x1,2=-----------------
2a
And this is even an easy example. What about typing the formula
𝑛
1 2
𝜎 = √ ∑(𝜉𝑖 − 𝜉̅)
𝑛
𝑖=1

The formula editor of Word is an easy way to integrate complicated formulas (as well as easy formulas)
into text. By employing it, your texts
• are more clear to read;
• have a more professional appearance;

1
We prefer LaTeX, which is moreover free (https://www.latex-project.org/).
2
This text is based on the official Word for Windows, not on Word for Mac, OpenOffice, or other similar
programs. To a large extent, they will resemble Word for Windows, but we cannot support you with problem
solving if you are using these alternatives.

BUSM 2 Computer tutorial 1


• are faster to type;
• will be more robust if you change font or margins.

Typesetting mathematics is not only relevant for typing complicated formulas. It is also important:
• for typing unusual symbols (𝜋, ∞, ≥, ℝ,×);
• for typing ornaments to symbols (𝑥̃, 𝑥⃗, 𝑥̅ );
(3+2)
• for adjusting the size of parentheses and other symbols (4 + 4 ).

Consider the following snippet:

You can observe that some mathematical symbols are printed in italics (𝑓, 𝑔𝑗 , etc.) but also sometimes
in bold non-italics (𝐱, etc.). In mathematical texts this all has a special meaning. 𝑥 means something
different than 𝐱. Typing mathematical texts (like we do today) helps you to better read mathematical
texts (which you will do a lot during your study).

In general, every professionally typeset text obeys certain conventions for typesetting math:
• variables and other letter-like symbols are generally printed in italics (so 𝑦 = 𝑓(𝑥) instead of
y=f(x));
• minus signs are longer than hyphens (so 8 − 2, instead of 8-2);
• multiplications are never done like pxq or p*q or p.q, but always like 𝑝 × 𝑞 or 𝑝 ∙ 𝑞.
Such conventions are also adhered to for in-line text, so in places where underneath a formula you see
“In this formula, 𝑝 is the price in euro and 𝑞 the quantity sold”. It is an ugly but common error to type
a high-quality formula, with low-quality surrounding text, as in: “We now calculate the proceeds  as
𝜋 = 𝑝𝑞
where p is the price in euro and q is the quantity sold.” Don’t follow this bad practice!

One more thing. If you type a sentence like “where 𝑝 is the price”, it can be attractive to just use the
italic function ([ctrl]i) for typing the 𝑝. Don’t do this! There are various reasons for this, including:
• the italic p looks different from the formula p. Look carefully: 𝑝 or p, which is which?
• minus signs typed in normal text still look wrong, while the formula editor automatically uses
the correct form. Compare 𝑥 = −12 and x=-12.
• there are also subtle differences for subscripts and superscripts. Compare 𝑥 2 and x2.
So, from now on, if you type a mathematical part, either as a big formula or as part of a text, switch to
math mode. Below, we will tell you how.

6 Equations in Microsoft Word – the basics

In using Word and the equation editor, mind well that there are not only different versions of Word
(2016, 2019, for Mac, etc.), but also different equations editors:
• Microsoft Equation, which is sometimes available on older computer systems and which then
can be invoked with Insert - Object;
• MathType3, which is installed on some computers, and which you can also invoke with Insert
- Object;
• the newer “integrated” equation editor (see Figure 1) which can be invoked with Insert -
Equation or with the keyboard shortcut [alt]=.

3
MathType is a commercial add-on supported by Word. It may or may not be available at your computer.

BUSM 3 Computer tutorial 1


These three systems work slightly different, but there are more similarities than differences. If you can
produce formulas with one system, working with the other system is more or less similar. Our emphasis
will be on using the new equation editor.

Figure 1: The lay-out of the newer “integrated” equation editor of Word, which will be used in the rest
of this document.

In the red circle you see the icon to start the newer “integrated” equation editor of Word. The keyboard
short-cut [alt]= also works.
1
We will now show you stepwise how to type a simple equation (𝑦 = 2 𝛽 2 ) with the integrated equation
editor.

Step 1. Start Word with a new document, and type a first line (“My first equation:”) followed by a
return.

Step 2: Start the equation editor, either by [alt]=, or by clicking Insert - Equation. Using keyboard
shortcuts (here: [alt]=) is of course much faster, especially if you type in-text symbols, like in “where
𝑝 is the price”.

BUSM 4 Computer tutorial 1


You will see two changes: there is an area “Type equation here” (or similar text in another language),
and there is an extra toolbar (“Equation Tools”).

Step 3: Start typing the equation in the equation area.

You see that the equation editor recognizes that 𝑦 is a symbol and hence set in italics. Easy!
1
Step 4. Now things get less obvious. To type 2, we need the toolbar. Click the tool for “Fraction”.

BUSM 5 Computer tutorial 1


You will see that a number of options shows up. We see four possible “templates” for fractions. You
can select the one you want. In addition, some common, often-typed fractions can be selected. We take
the first option. The empty fraction will appear on your screen, with “placeholders” denoting numerator
and denominator. Now put your mouse cursor in the top dashed square (the numerator placeholder), or
use the arrow keys to navigate the cursor to that position.

You can see that its color changes.

Step 5. Now type the content, in this case a “1”. Move the cursor to the placeholder at the bottom, and
type a “2”:

1
You just typed your first fraction, not as 1/2, but as 2!

Step 6. Move the cursor to the right side of the fraction, but still inside the equation area.

Now you’re ready to type the rest of the formula. (If you wouldn’t move the cursor, you would continue
typing in the denominator of the fraction.)

Step 7. Observe that the next part is not a symbol (𝛽) but a symbol with a superscript (𝛽 2 ). First make
sure you create the placeholders by selecting the first icon from the Script tool:

BUSM 6 Computer tutorial 1


Step 8: Move the cursor to the first part of the newly typed placeholder.

Step 9. Now we need to type the Greek 𝛽. This symbol – and other symbols – are typed by selecting
the appropriate symbol from another part of the tool bar:

You will see a number of symbols, but no 𝛽. However, this part contains three arrows, two for scrolling,
and one for expanding the symbol menu. Click the down arrow, and now you will see the Greek alphabet
appearing, including the 𝛽:

Click the 𝛽, and it will be inserted in the placeholder.

Step 10. Move the cursor to the superscript placeholder and type the “2”. Finally, move the cursor
outside the formula editor. The equation is ready, and the equation toolbar is gone. You’re back in
“normal” typing mode.

BUSM 7 Computer tutorial 1


Congratulations! You managed to type your first professionally looking equation.

This was the biggest hurdle. Now, practice typing the following formulas:
Exercise 1: 𝑑 = √𝑎 + 𝑏 + 𝑐
1 1 2
Exercise 2: 1 = 3 =
1+ 3
2 2
−𝑏±√𝑏2 −4𝑎𝑐
Exercise 3: 𝑥1,2 =
2𝑎
Exercise 4: 𝑥 2 = 2 ⇔ 𝑥 = ±√2
Exercise 5: 𝛼 ∈ ℝ+

Answers and hints:


Exercise 5: Take care to type ∈, not 𝜀 (epsilon).
Exercise 3: Mind that the subscript 1,2 should be entirely lowered.
Exercise 2: Mind that the =-sign is at the correct level.
Exercise 1: Mind that the square root sign runs until 𝑏, but no further.

8 Equations in Microsoft Word – keyboard shortcuts

Above, we already suggested you to use the keyboard shortcut [alt]= for starting the equation editor,
instead of moving the mouse and clicking Insert – Equation. But the rest was quite a mousy affair. Can
we do it quicker? Yes, you can. There are hundreds of tricks to speed it up. Some are very easy, using
just the arrow or space keys. Some are more complicated.

We will repeat the above in a completely mouse-free procedure:


Step 1. Type My first equation and press [enter]
Step 2. Activate the equation editor using [alt]=
Step 3. Type 𝑦 = 1/2
1
Step 4. Press space. The equation editor will now automatically change 1/2 into
2
Step 5. Type \beta (with the slash in front)
Step 6. Press space. The equation editor will now automatically change \𝑏𝑒𝑡𝑎 into 𝛽
Step 7. Type ^2 (with the “raising” symbol hat (circumflex) in front)
Step 8. Press space. The equation editor will now automatically change 𝛽^2 into 𝛽 2
Step 9. Press the right arrow, and you’’ move outside the equation editor.

BUSM 8 Computer tutorial 1


This is much faster, and it will save you hundreds of mouse kilometres. But how could you know that
“\beta” was the shortcut for 𝛽? Easy. If you use the mouse, a wizard will appear after a second, telling
in parentheses what the shortcut is,

You can type everything using the mouse, but after some time, the keyboard works much nicer.

9 Equations in Microsoft Word – display and inline

There is one final thing important at this stage: the distinction between a “display” equation and an
“inline” equation. Basically, we have an inline equation if mathematical elements occur within a
sentence, like in “... it now follows that √𝑥 > 10 so that ...”. A display equation is a separate paragraph,
like in “it now follows that
√𝑥 > 10
so that ...”. Word’s equation editor has different rules for display equations and inline equations. For
instance, compare the display form
𝑛

∑ 𝑎𝑖
𝑖=1
with the inline form ∑𝑛𝑖=1 𝑎𝑖 . In typing these two forms, we did exactly the same things, but the result
looks different. We can easily type an isolated equation as if it is an inline equation, by just typing one
extra space behind it:
∑𝑛𝑖=1 𝑎𝑖
But we cannot change an inline equation into a display form without moving it out of the surrounding
text.

10 Equations in Microsoft Word – including text

You have seen that the letters 𝑥 and 𝑦 are automatically recognized as a variable, and therefore printed
in italics. But in some cases, this is unwanted4. Some examples:
• variables with long names: sales = 𝑝 × 𝑞 instead of 𝑠𝑎𝑙𝑒𝑠 = 𝑝 × 𝑞;
euro
• units: 𝑝 = 12 m2 ;
• subscripts of variables 𝑝fixed = 5;
• text fragments 𝑦 = 5 or − 5.
The trick is the icon for “normal text” in the equation toolbar:

4
Mathematicians do not agree on some details. For instance, is the symbol 𝑒 = 2.71 ⋯ italic (𝑒) or not (e)? And
𝑑𝑦
the 𝑑 or d for ? We have an easy-going attitude in this course.
𝑑𝑥

BUSM 9 Computer tutorial 1


You should type everything in the equation editor, but use normal text for the words (like “sales”, “or”,
“fixed”, or “euro”). Normal text effectively turns of the italic font for letters. You may also employ the
usual icon for toggling italic font, or [ctrl]i.

The automatic change from a display equation into an inline equation creates trouble when some text
elements are needed. For instance, when you include punctuation:
𝑛

∑ 𝑎𝑖 .
𝑖=1
How did we get the full stop in a display equation? By making it part of the equation. Next, try the
following:
𝑛

∑ 𝑎𝑖 where 𝑎𝑖 is a positive number


𝑖=1
Without using the “Normal text”, you would get either
∑𝑛𝑖=1 𝑎𝑖 where 𝑎𝑖 is a positive number
or
𝑛

∑ 𝑎𝑖 𝑤ℎ𝑒𝑟𝑒 𝑎𝑖 𝑖𝑠 𝑎 𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒 𝑛𝑢𝑚𝑏𝑒𝑟


𝑖=1

When you type sin 𝑥, observe the 𝑥 is italic (as it should be), but that sin is not italic (as it should be).
The same applies to ln 𝑥, exp 𝑥, min 𝑥, etc. Apparently, the equation editor recognizes certain functions.
Whenever the function should be, but is not, recognized, use “normal text”. Whenever the opposite
happens, also use “normal text”. The feature turns on and off the italic font.

Finally, in mathematical texts, we sometimes encounter bold letters, in particular for vectors and
matrices. The usual way for making bold font is to click the bold icon, or press [ctrl]b. This indeed
creates bold symbols, but they are still italic. So may have to change bold and italic at the same time.
Now, we can type 𝐛 = 𝑐𝐚.

Exercise 6: for all 𝜃, it is true that sin2 𝜃 + cos2 𝜃 = 1


Exercise 7: for any 𝑛 ∈ ℕ, define 𝑆(𝑛) as 𝑆(𝑛) = ∑𝑛𝑖=1 𝑖
Exercise 8:
𝑛

for any 𝑛 ∈ ℕ, define 𝑆(𝑛) as 𝑆(𝑛) = ∑ 𝑖


𝑖=1
Exercise 9: if 𝐗 = 𝐈𝑛 , then for every 𝑐 ∈ ℝ: 𝑐𝐗 = 𝐗. Further, 𝐗 −1 = 𝐗.

Answers and hints:


italic, also for subscripts and superscripts.
Exercise 9: Observe carefully where difference between bold and non-bold and between italic and non-
Exercise 8: Here you should select correct icon to produce 𝑖 = 1 below the ∑.
Exercise 7: Recall that you cannot type the 𝑖 = 1 below the ∑ in an inline formula.

BUSM 10 Computer tutorial 1


11 Mathematical modelling in Excel – the basics

Excel is a convenient tool for managing data. Again, real programmers prefer other applications, such
as Matlab or R for simulation or Stata for statistics, but we acknowledge that Excel is widely-used.
Therefore, being able to handle Excel is an important asset for any student of SBE entering the job
market.

There are hundreds of books, tutorial websites, YouTube videos, etc, for using Excel in general as well
as for dedicated tasks, such as creating a histogram or solving an equation. Another suggestion: use the
left part of the screen for this website, and the right part for Excel.

In our Mathematics course, we will concentrate on using Excel for processing data, using basic
formulas, using relative and absolute references, using variables, handling matrices, and creating basic
graphs.

In using Excel, mind well that there are not only different versions of Excel, but that also three other
complications:
• Excel comes in different languages. If you have an English version, you should type SUM to
add an array of numbers. If you have a Dutch version, type SOM instead.5 This may be a
complication if you watch movies or read tips on achieving some result. Moreover, if you save
your file in an English program, and open the file in Dutch program, all such names are
automatically converted. This may be convenient, but it is of course also a source of confusion.
• Regardless of the language of the program, your computer has so-called Regional settings,
which amongst others determine how numbers are represented. if you type “=1/2” the result
may show as “0.5” or as “0,5”, depending on the settings for the decimal separator. Make sure
you understand how your computer handles the decimal separator. Important to notice is that if
Excel sees an entry as a number it will automatically be outlined to the right of the cell. Thus if
you type for example 0.5 in a cell and it is not outlined to the right of the cell then Excel does
not recognize it as a number. That will happen if on your version of Excel the decimal separator
in numbers is a comma and not a dot. To complicate the situation, there is also a thousands
separator, which is usually a comma if the decimal separator is a point, and the other way
around. Thus either “1,234.5” or “1.234,5” can mean “one thousand two hundred thirty-four
and a half”. And “3.141,526” can mean “slightly more than 3”, or “more than 3000”. As this
can change from computer to computer, you should really make sure you understand (or adjust)
the logic.
• Another regional setting issue is the way arguments of a function are separated. Consider the
mathematical standard in 𝑓(𝑥, 𝑦) where the comma separates the two arguments 𝑥 and 𝑦. Now,
if we use commas as a decimal separator, the expression 𝑓(3,14,6,28) becomes unreadable.
Therefore, Excel by default employs the semi-colon “;” whenever the decimal separator is a
comma. So you should use either 𝑓(3.14,6.28) or 𝑓(3,14; 6,28). In the examples in this
document and in the tips-and-tricks on internet, you will find both systems interchangeably.
We will assume that you are able to use the correct form for the computer system you’re
working on.

In general, the computers at VU are in English, with the Dutch settings for numbers. However, this may
have changed, and you cannot count on it. Note that this is a realistic issue: when you do an internship
in a company or start your first job, you must also be able to handle the computers that are provided to
you! Further, the PCs run Windows 10 and Office 365. Also this may be different, but again, that is a
realistic thing in your job career. Your private computer may be different. At the exams you should

5
See http://dolf.trieschnigg.nl/excel/index.php for an overview of the function names in English, French, Dutch,
German, Spanish, Portuguese, Russian, Swedish, Italian, Danish, Polish, Finnish, Norwegian, Czech, Hungarian
and Turkish. The website https://en.excel-translator.de/ provides a syntax translator: you can type in syntax in,
e.g., Polish, and see the equivalent in , e.g., Vietnamese.

BUSM 11 Computer tutorial 1


hand in your command in English, not in other languages. For the numbers, anything goes: it may be in
comma format or in dot format.

If you start Excel, you will see an empty worksheet:

A worksheet is shown as a rectangular grid with cells. Cells are coded as “A1”, “C5”, etc., where a
letter codes for the column and a number for the row. Cell AB14 corresponds to column 28 (“Z”=26,
“AA”=27, “AB”=28) and row 14.

You can type content in a cell. Put the cursor in cell A1, type “test”, and click in B1 (or press Tab).
Now in cell B1 type “3” and click in C1 (or press Tab). Finally in cell C1 type “=B1+5” and click in
D1. Now, the first miracle happens: cells A1 and B1 show their original content (“test” and “3”), but
cell C1 shows the result of a calculation: “8”.

The second miracle happens when you again click in cell B1, type “2”, and click in cell D1. The content
of cell C1 has changed, even though you haven’t even touched cell C1.

Excel is thus able to dynamically process changes in data. This makes it very convenient for
mathematical modelling. Suppose, for instance, that we want to study the behavior of the function

BUSM 12 Computer tutorial 1


𝑥 2 + 2𝑥 − 5
𝑦=
𝑥3 − 𝑥 + 9
If we reserve cell B1 for the 𝑥-value and type in cell C1 the code “=(B1^2+2*B1-5)/(B1^3-B1+9)”, the
following happens:

We can now easily type different values in B1 (the 𝑥-value) and see what happens in C1 (the 𝑦-value).

It’s time for the third miracle. Put the cursor in cell C1, press [ctrl]c (or use the Copy icon), move to
cell C2 and press [ctrl]v (or use the Paste icon).

Something strange has happened. The value of C1 (0.2) has not been copied. Instead we see a puzzling
value: –0.55556. The formula of C1 has been copied to C2, but with one important difference: it now
points to B2 instead of B1. Excel has understood that copying to below also means referring to a source
cell one line lower. But B2 doesn’t contain anything. Excel interprets this as a zero, so it evaluates
02 + 2 ⋅ 0 − 5 5
3
= − ≈ −0.55556
0 −0+9 9
Now type a value in B2 (e.g., 3), and you will see that the formula just works on B2.

Now, copy again C1, but now to C3, C4, etc. Further supply values in B3 (4), B4 (5), etc.

You will see how easy it gets to explore a function. Column C in Excel suggests that the function peaks
somewhere between 𝑥 = 2 and 𝑥 = 4. This is the start of using Excel to explore the maximization of a
function!

12 Mathematical modelling in Excel – absolute and relative references

BUSM 13 Computer tutorial 1


Copying a formula with automatic changing the reference to source cells can be convenient, but there
are cases where you don’t want this. Consider a worksheet where cell A1 contains the VAT percentage
and column C a whole list of prices without VAT. If you want column D to contain the prices with
VAT, you might be tempted to use for cell D2 the formula “=(1+A1)*C2”. This formula works great,
but only for cell D2.

If you copy it to cell D3, it will change into “=(1+A2)*C3”. The changed reference to C3 is correct, but
the reference to A1 has inadvertently changed into a reference to A2, which is empty. You might repair
this in two ways:
• changing the formula for D2 into “=(1+0.18)*C2”, and copying that formula to below;
• copying the value “0.18” to cell A2 as well, so that the formula in D3 remains “=(1+A2)*C3”
but now points to a valid number in A2.
However, the point is of course that you want to be able to update all inclusive prices by just updating
one VAT-rate, not a whole column of VAT-rates. So we use a third solution, using a special symbol,
the dollar sign ($):
• typing in D2 not a reference to “A1” but to “A$1”.
The dollar sign has no effect on the calculation, but it has effect on the act of copying.

You should make sure to understand when to use a dollar sign. It can be used to make an absolute
reference to a certain row (“A$1”), to a certain column (“$A1”), or to a certain cell (“$A$1”).

When you type a formula with a cell reference, like “=A1”, you can press the [F4] key one or more
times, which will alter the formula in “=$A$1” and other variants.

13 Mathematical modelling in Excel – variables

Referring to an abstract cell address (“A1”) is of course not a very user-friendly way. Fortunately, Excel
allows you to assign a name to a cell. Once again, look at cell A1:

BUSM 14 Computer tutorial 1


Between the toolbar with icons and the rectangular grid, you will see two important information
elements for the selected cell: its address (“A1”) in the so-called Name Box, and its content (“0.18”) in
the so-called Formula Bar. Now click on the Name Box, and type meaningful variable name, e.g.,
“VATrate”.

From now on, you can refer to this value by referring to the cell “VATrate” instead of “A1”. So click
on D2 and change the formula into “=(1+VATrate)*C2”. Copying to below will just work as intended.
No worrying about absolute or relative addresses, and a more readable code!

14 Mathematical modelling in Excel – functions

In typing formulas, you can use the familiar operators “+”, “–”, “*” and “/”. Further, you can use “^”
for exponentiation.

How to make a square root of the value in A1? There are two ways: “=A1^(1/2)”, and “=SQRT(A1)”.
The second form is based on a built-in function, in this case SQRT. In general, a function assigns a
value and depends on one or more arguments. Another function is “LN”: the syntax “=LN(A1)” will
yield the natural logarithm of the value in A1. Likewise, the function “LOG10” gives the logarithm of
base 10. The function “LOG” takes two arguments: the first for the number of which the logarithm
should be taken, the second for the base. Thus, “=LOG(A1;10)” is the same as “=LOG10(A1)”. Observe
that the two arguments are separated with the semicolon symbol (“;”). However, you may stumble upon
a computer with different settings, for instance the comma (“,”). Again, we expect you to be able to fix
this yourself.

Excel has a tremendously long list of built-in functions. When you select from the menu Formulas -
Insert function, you will see an extra screen to select the appropriate function, with additional
instructions.

BUSM 15 Computer tutorial 1


Let us now select the function “MAX”. This function gives you the largest element of a list. Thus,
“=MAX(12;3)” returns 12, and so does “=MAX(3;12)”. This is of course not a very useful way of using
the function MAX. However, we can apply it to an entire set of cells in one go. For instance
“=MAX(C2:C67)” returns the largest value from all number in cells C2, C3, ..., C66, C67. We can even
use “=MAX(C:C)” to find the largest value in everything that is in column C. And “=MAX(C2:D67)”
even searches in a rectangular area demarcated by C2, C67, D2 and D67.

Important mathematical functions that we will use are: ABS, EXP, INT, LN, LOG, LOG10, MIN,
MAX, PI, POWER, ROUND, SQRT, SUM.

√𝑒 𝑥
Exercise 1: Create a worksheet in which you can explore the function 𝑦 = for a range of values of
𝑥
𝑥. including positive and negative values.
3
Exercise 2: Create a worksheet in which you can explore the function 𝑧 = √𝑥 3 + 𝑦 3 for a range of
values of 𝑥 and 𝑦. Do not forget to check the domain of the function.
1
Exercise 3: Create a worksheet in which you can explore the function 𝑦 = 𝑥−𝑎 for a range of values of
𝑥 with a fixed but modifiable parameter 𝑎. Do this a) by using an absolute reference for 𝑎 and b) by
using a name for 𝑎. Do not forget to check the domain of the function.
Exercise 4: As said, “=LOG10(A1)” is equivalent to “=LOG(A1;10)”. How can you use “LOG” to do
“LN”? How to write ln 𝑥 using the function “LOG”?
Exercise 5: Use the function “PI” to obtain the value “3.14...”.

Answers and hints:


Exercise 5: “=PI()”.
Exercise 4: “=LOG(A1;EXP(1))”. Do not use “=LOG(A1;2.71)”.
“=1/(A1-par)”, where A1 refers to the 𝑥-value and par is the name given to the parameter 𝑎.
Exercise 3: a) “=1/(A1-$C$1)”, where A1 refers to the 𝑥-value and C1 refers to the parameter 𝑎; b)
Exercise 2: “=(A1^3+B1^3)^(1/3)”, where A1 refers to the 𝑥-value and B1 to the 𝑦-value.
Exercise 1: “=SQRT(EXP(A1))/A1”, where A1 refers to the 𝑥-value.

15 Mathematical modelling in Excel – errors and conditional formulas

In our mathematics class, your final result will be based on two tests (each counts for 15%) and the
written exam (70%). Suppose we use the formula “=0.15*B2+0.15*C2+0.7*D2” in cell E2, and copy
downwards.

BUSM 16 Computer tutorial 1


This works fine, except for the “NS” for Daniel and Evelyne. “NS” (no show) is the code the faculty
uses for recording that you didn’t show up. Of course, it counts as a 0, but it is not recorded as a 0 but
as NS. Cells E5 and E6 try to do a calculation on the value “NS”, but that obviously doesn’t work. It
reports “#VALUE!” instead6, which is the Excel way of error notification. But we want to return a value
“NS” as the final grade, not “#VALUE!”. The way to go forward is to use Excel’s function for
conditional calculation. Below, we use for F2 the function call “=IFERROR(E2;"NS")”, which returns
the value of cell E2 if there is no error in E2, and the value “NS” if there is an error in E2.

This example of IFERROR is a first case of a conditional formula: a formula that returns a result that
depends on whether or not a certain condition is fulfilled. Let us proceed with another one. Your final
grade is the weighted average, but the result of the written exam must be at least 5. If it is less than 5,
your final grade will be 1.

Observe that we have nested a conditional function IFERROR and another conditional function IF. IF
in this case returns “1” if the condition “D2<5” is fulfilled, and it returns the value of E2 if this condition
is not fulfilled.

6
Excel in another language may display a different message, e.g. “#WAARDE!”.

BUSM 17 Computer tutorial 1


Now, suppose that we want to count how many students have a result anyhow. The stupid way is just
to count. This is stupid, because one change would require changing the results, while Excel is so
powerful in dynamically updating such results. Fortunately the function COUNT can help.
COUNT(F2:F8) finds how many student have a numerical result, while COUNTA(F2:F8) also finds
the students who have a non-numerical result (e.g., “NS”).

And how many passed? We can do a conditional count. COUNTIF counts the number of cells in which
something is the case. The first argument specifies the range; the second argument the condition. In
many cases we need to use quotation marks for the condition.

Exercise 6: Make a formula which returns “continue” when the exam grade is 5 or more and “retake”
when the exam grade is smaller than 5.
Exercise 7: Create a function that counts how many students have a result between 6 and 7.5. Hint: use
the function COUNTIFS. Note than the grades 6 and 7.5 are to be included.

Answers and hints:


or so.
Exercise 7: “=COUNTIFS(F:F;">=6";F:F;"<=7.5")”. Observe the “>=” and “<=”. Do not use “>5.99”
be greater than 5.
“=IF(AND(D2<>"NS";D2>=5);"proceed";"retake")” works better. Apparently Excel considers “NS” to
Exercise 6: Check that “=IF(D2>=5;"proceed";"retake")” is not good enough. The syntax

16 Mathematical modelling in Excel – formatting and rounding

You can use crazy fonts and ugly colors; we will not discuss these issues. But we will mention one
thing that is important in a quantitative context: the formatting of numbers.

Here, we see that √0.3 is evaluated in six digits. Clicking Format cells (or [ctrl]1) gives a new form:

BUSM 18 Computer tutorial 1


We will not discuss the tabs for alignment, font, etc., but we concentrate on the tab for Number. In a
quantitative context, of particular interest are the categories Number and Scientific. Number will print
the result as a normal number, but with some options, most importantly the number of digits displayed.

The sample already reveals what will happen: cell A1 will be shown as “0.55”. The category Scientific
will use the scientific notation; in this case the result will be “5.48E–01”.

BUSM 19 Computer tutorial 1


Note well that formatting the cell does not affect the value. If cell A1 contains the formula “=1/3” and
the value is shown with one decimal place, you will see “0.3”. Now, the formula “=3*A1” will give
“1.0”, rather than “0.9”.
1
If you would like to work with rounded values, so effectively put 3 = 0.3, you should not use formatting,
but a function that achieves this result. Several functions are available for this, in particular “ROUND”,
“CEILING”, “FLOOR”, “ROUNDUP”, “ROUNDDOWN”, and “TRUNC”. Play around with these
functions.

Exercise 8: Consider the following worksheet:

In column E we would like to see the values in cents, so in two digits, but not only shown in two digits
but also calculated in two digits.
Exercise 9: In column F we want to see a further rounding (visual only) to whole dollars.
Exercise 10: Column H contains the information in column G, but rounded downward. After all, when
you are 33.61 years old, you’re 33 years old, not 34 years.
Exercise 11: Add a column in which the word “poor” is shown in rows where the income/person is less
than or equal to 15000, and where the value itself is shown if this is not the case.
Exercise 12: Create a function that counts the fraction of poor families.

Answers and hints:


Exercise 12: “=COUNTIF(K:K;"poor")/COUNTA(K:K)” (assuming the information is in column K.
Exercise 11: “=IF(D2<=15000;"poor";D2)”
Exercise 10: “=FLOOR(G2;1)” or “=TRUNC(G2)”
Exercise 9:”=E2” with Format Cells - Number - Decimal places = 2
Exercise 8: “=ROUND(D2;2)”

BUSM 20 Computer tutorial 1

You might also like