0% found this document useful (0 votes)
54 views

Definition:: A Variable Holds Values Which Can Change

The document discusses the basics of using formulas and functions in spreadsheets. It explains that the most basic use is to enter values and apply a formula to calculate an answer, like adding a list of numbers. However, there are hundreds of built-in formulas and functions that allow spreadsheets to be used for more advanced tasks like statistical analysis and modeling scenarios. It also discusses the differences between formulas and functions, and how relative cell references allow formulas to dynamically update when copied to other cells.

Uploaded by

qwertydude123
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Definition:: A Variable Holds Values Which Can Change

The document discusses the basics of using formulas and functions in spreadsheets. It explains that the most basic use is to enter values and apply a formula to calculate an answer, like adding a list of numbers. However, there are hundreds of built-in formulas and functions that allow spreadsheets to be used for more advanced tasks like statistical analysis and modeling scenarios. It also discusses the differences between formulas and functions, and how relative cell references allow formulas to dynamically update when copied to other cells.

Uploaded by

qwertydude123
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

1.

Introduction
The most basic way of using a a spreadsheet is to use it as a glorified calculator, where
you simply enter some values then apply a formula to work out the answer.

For instance you have a set of numbers you want to add


up.

So you enter them into a worksheet and simply add them up using a formula (as in cell
A3)

Most people can quickly master the use of basic


formulae and can usespreadsheets to add
together lists of things, multiply a few items and
come up with a grand total.

However, there are literally hundreds of different


formulae and functions already built into
spreadsheets. They allow you to use a
spreadsheet not just for basic calculations but
also for statistical analysis, as a database and
for modelling different scenarios.

Over the next few pages we will take a look at


formulae and functions and also discuss the
difference between relative and absolute cell addresses.

2. Variables

DEFINITION:
A variable holds values which can change. 

In order to set up a model, you need to be able to change parts of it in order to see what
effect that has on the overall result.
This is what a variable can do for you - a variable allows you to change the model that
then re-calculates the result.

The simplest kind of variable is a single cell containing a number

Cell A1 and A2 are 'variables', because if you change their values, the result in A3 will
change. So the simplest kind of variable is a single cell reference.

3. Named variables
=A1+A2

The formula shown above is so simple that it is easy to understand what it is doing. But
things can get (and do) become far more complicated. For instance, consider a formula
like this:

It is much more difficult to understand the purpose of this formula. You can see that is
seems to be adding up a range of cells and also multiplying a cell value but why?

Now lets set up the same formula in a slightly different way

It is still a little complicated but now it is much more clear as to what it is doing. In this
case it is taking the price variable and VAT variable to work out the VAT on an item,
then adds the postage costs. It then adds these to the total sales.

This can be done in a spreadsheet because it supports the idea of a 'Named variable'.

A named variable substitutes text for referencing a cell or range of cells.


Creating a Named variable

This is quite straight forward as it can be done right on screen.

Select the cell you want to use (B2)

In the top left box enter the name you want to use
(DISCOUNT) and press enter.

That's it. You can now use DISCOUNT instead of cell B2 in a


formula.

4. Formulae

DEFINITION:
A formula performs calculations using numbers, addresses of cells and
mathematical operators

Formulas are the bread and butter of spreadsheets. Without formulas, a spreadsheet
would only contain a static never-changing set of numbers. Not exactly useful.

A formula takes a set of values, usually from other cells, and carries out some maths on
them. The result is displayed in the same cell containing the formula.

Normally formulas are not visible when just viewing a spreadsheet

The image on the left is what you would normally see in a spreadsheet. But if you set
the spreadsheet software to make formulas visible, then you see the image on the right.
Just how you make formulas visible depends on the package, so check with the help
menu.

A spreadsheet formula must start with an equals sign (=). It is the trigger to tell the
spreadsheet that a calculation is needed.
Formulas can also contain functions which are explained in a later page. Like this.

Do you know how to write basic formulae?

Make sure that you know how to write a formula to add, subtract, multiply and divide

5. Mistakes in formulae

The picture above shows a formula that multiplies D1 by D2 and then adds the result to
E1 + E2.

What happens to the formula if you then delete Row 1? You get this...

A #REF error appears as the formula cannot work. The spreadsheet will no longer
calculate the formula and it is up to you to sort out the problem.

With large spreadsheets containing tens of thousands of formulas, deleting a single cell
location can result in thousands of #REF errors appearing
Another way of making a mistake is to include a named variable that does not / no
longer exists. Like this

There is no 'ALL' named variable in this spreadsheet so the #NAME message appears
in the cell containing the formula.

So formulas are very powerful, but you do need to make sure that it can actually carry
out the calculation sensibly.

6. Functions

DEFINITION:
A function is a standard routine used to perform common tasks.  It represents
a complex formula that uses reserved words e.g. VLOOKUP, IF. 

A function performs a specific set of operations on its input values to produce a single
output value. The main spreadsheet applications available today have hundreds of
ready-made functions that you can use.

For instance, one way to add up a list of items is to add them up one by one like this
The formula in cell D2 can add up the three numbers in cells A2, B2, B3 but the function
called SUM can also do the same thing. Creating a formula by hand to add up three
numbers is very simple - but what if you had to add up 30,000 numbers? By far the
easiest thing to do is to use the built-in function called SUM and provide it with the
range of numbers to be added up.

This is the power of functions - they can carry out complicated operations on a set of
numbers very easily. Other very common functions are

 VLOOKUP (looks up a value in a table)


 AVERAGE (works out the average of a set of numbers)
 COUNTIF (adds up numbers meeting a certain criteria)
 STDEV ( statistical function called standard deviation)
 DSUM (powerful way of summing values meeting a given criteria)
 WEEKNUM (finds the week number in the year that the input date falls within)

Functions can also be combined in a formula to make even more complicated


operations. For example

=SUM(A1:A4) * AVERAGE(C2:C5) + VLOOKUP(A1,PRICE_LIST,2,FALSE)

This formula sums a range of values, multiplies the result by the average of another
range of numbers then finally adds another number obtained from a look-up table.

People can be very creative in combining functions to work out complicated problems.

7. Differences between formulae and functions

FORMULA FUNCTION

A formula is typed directly A function is built into the software.; it is a


into the formula bar special type of formula

Unable to nest a formula Can nest functions

Formula are simple Functions are used to simplify


calculations complicated maths
FORMULA FUNCTION

Formulas do not have A function often has a built-in wizard to


built-in wizards help you complete them e.g. VLOOKUP

8. Relative Cell References


Very early on in the development of spreadsheets it was quickly realised that entering
formulas by hand was just too tedious for all but the simplest situtations.

There had to be an automatic way that the spreadsheet itself could generate formulas
once a single formula had been entered by the user. And so the idea of Relative Cell
Referencecame about.

Let's use an example to explain this a little more simply:

Imagine you have a blank worksheet in front of you.  In cell A1 you type the number 1. 
In cell A2 you type in the number 2 and continue until cell A5 where you type the
number 5.  Your worksheet will look something like this:

  A B C D
1 1      
2 2      
3 3      
4 4      
5 5      
 

Then in cell B1 you type =A1 and press the enter key

  A B C D
1 1 =A1    
2 2      
3 3      
4 4      
5 5      
 

After pressing the 'enter' key, the formula that you wrote in B1 will pick up the value held
in cell A1. It will look like this:

  A B C D
1 1 1    
2 2      
3 3      
4 4      
5 5      
 

To copy the formula in B1 down to the other cells B2:B5, you would probably use the fill
handle in B1 and drag down, so when you release the mouse button a set of extra
formulas will have been entered automatically by the spreadsheet software.

The result would look like this:

  A B C D
1 1 1    
2 2 2    
3 3 3    
4 4 4    
5 5 5    
 
The numbers in column B look exactly the same as those in column A.

However, if you were to look at the formulae in column B, they would look like this:

  A B C D
1 1 =A1    
2 2 =A2    
3 3 =A3    
4 4 =A4    
5 5 =A5    
 

What happened when you dragged the formula down from B1 to B2 was that the
spreadsheet understood that you were copying the formula down a row and that it
needed to track that formula 'relative' to the cell one column to the left on the new row.
So =A1 becomes =A2.

9. Relative cell references

Advantages Disadvantages

A formula can quickly be Any mistake in a formula will be


copied to a range of other replicated to all other cells that are
cells copied from the original formula

When replicated, the relative If a formula is referencing just one


cell reference will cell, it will not stay in that cell once
automatically update itself copied to other cells

If a change is made to the original


  formula, it will need to be recopied to
all the other cells
10. Absolute cell references

DEFINITION:
When a formula is replicated to other cells, any part of the formula which
contains an absolute cell reference will remain static or unmodified when the
formula/function is copied.

We saw on the previous page that with a relative cell reference, the formula will change
automatically as it is copied to other cells.

However, sometimes you might want the cell that the formula is referencing not to
change as it is dragged to different cells.

Have a look at the following example:

  A B C D E F
Sale Number Sales Discount
1 Item Discount
Price sold Revenue value
2 8" plate £6.99 5 £34.95 £3.49 10%
3 10" plate £8.99 9 £80.91    
4 Mug £5.99 4 £23.96    
5 Teacup £5.99 3 £17.97    
 

The shop has decided to offer a discount of 10% during January on all sales.

The 10% discount value has been placed in cell F2.

In cell E2 a formula calculates the discount by using the following formula: =D2*F2

The discount is calculated to be £3.49

 
The next logical step would be to use the fill-handle in cell E2 and drag the formula
down to cells E3:E5. However, when this is done, the following results happen:

  A B C D E F
Sale Number Sales Discount
1 Item Discount
Price sold Revenue value
2 8" plate £6.99 5 £34.95 £3.49 10%
3 10" plate £8.99 9 £80.91 0  
4 Mug £5.99 4 £23.96 0  
5 Teacup £5.99 3 £17.97 0  
 

By looking at the results in column E, you can see straight away that something is
wrong, but you have to take a closer look at the formulae to see what has happened.
These are the formulae:

  A B C D E F
Sale Number Sales Discount
1 Item Discount
Price sold Revenue value
2 8" plate £6.99 5 £34.95 =D2*F2 10%
3 10" plate £8.99 9 £80.91 =D3*F3  
4 Mug £5.99 4 £23.96 =D4*F4  
5 Teacup £5.99 3 £17.97 =D5*F5  
 

The original formula in cell E2 works correctly, it is multiplying D2 by the discount value
in F2.

However, when it is dragged down, relative cell referencing changes both values. The
first part of the formula changes correctly, D2 becomes D3, D3 becomes D4.
But the second part of the formula also changed relatively and it now doesn't do what
we want. F2 became F3. If you have a look at F3, nothing is contained in that cell. So
now we have D3 multiplied by F3 (nothing), so we get the result of 0.

To overcome this problem, we to allow the first part of the formula to change relatively
but we stop the second part from changing. In other words, we make it 'absolute'.

To make part of a formula into an 'absolute cell reference', a $ symbol is used. The $
tells the spreadsheet not to alter the formula as you drag or copy it to another cell.

If you are dragging the formula down, then the $ needs to go in front of the row number.

So, in our example, the formula in cell E3 would become =D2*F$2

  A B C D E F
Sale Number Sales Discount
1 Item Discount
Price sold Revenue value
2 8" plate £6.99 5 £34.95 =D2*F$2 10%
3 10" plate £8.99 9 £80.91 =D3*F$2  
4 Mug £5.99 4 £23.96 =D4*F$2  
5 Teacup £5.99 3 £17.97 =D5*F$2  
 

The results from using an absolute cell reference in this table would be:

  A B C D E F
Sale Number Sales Discount
1 Item Discount
Price sold Revenue value
2 8" plate £6.99 5 £34.95 £3.49 10%
3 10" plate £8.99 9 £80.91 £8.09  
4 Mug £5.99 4 £23.96 £2.39  
5 Teacup £5.99 3 £17.97 £1.79  
 
The example above looks at dragging a formula vertically down. However, you can also
use absolute cell references horizontally. Look at the following example:

  A B C D E F
1 Sales person Emma Sam James    
Weekly
2 £525 £750 £490    
Sales
Commission
3 £5.25 £7.50 £4.90    
Earned
4          
Commission
5 1%        
Rate
 

The commission earned was calculated by writing the following formula in cell B3:

=B2*$B5

When this formula was dragged horizontally from B3 to C3, the first part changed from
=B2 to =C2

However, the $ in front of the second B in the formula, stopped the column letter from
changing, it made it absolute. The other two formulae became:

=C2*$B5 and =D2*$B5

  A B C D E F
1 Sales person Emma Sam James    
Weekly
2 £525 £750 £490    
Sales
Commission
3 =B2*$B5 =C2*$B5 =D2*$B5    
Earned
4          
5 Commission 1%        
Rate
 

Hint

Putting the $ in front of the row number or column letter only is technically the correct
way to write an absolute cell reference. However, if you can't remember the correct way
to write one, it is very unlikely that you would be penalised by putting a $ in front of both:

=C2*$B$5

11. Absolute cell references

Advantages Disadvantages

If a range of cells are using a formula


the 'absolute' part of the
which has an absolute cell reference, a
formula will not change
change will affect all cells. You might
even if copied elsewhere
not want this to happen.

Just one cell needs to be it is more complicated to enter an


changed in order to update absolute cell reference as you have to
all of the cells related with a be careful about the placement of the
formula dollar signs.

You might also like