Professional Documents
Culture Documents
4 Functions I - Content Handout - 2018
4 Functions I - Content Handout - 2018
MICROSOFT EXCEL
BASICS:
Functions I
Heather C. Young
2013
INTRO TO FUNCTIONS 2
TODAY() 3
RAND() 3
SUM() 3
COUNT() 4
AVERAGE() 4
MAX() 4
MIN() 5
ROUND() 5
Nesting functions 6
A couple of handy text functions 6
LOWER() 7
UPPER() 7
PROPER() 7
CONCATENATE() 7
Other Excel Functions 7
Practise basic functions: RAND(), SUM(),COUNT(), AVERAGE(), MIN(), MAX() 8
Practise more advanced functions: ROUND(),nesting functions 10
TODAY()
- Just for fun!
- Returns today’s date
- An example of a function with NO arguments (i.e. the parentheses remain empty): you don’t
need to tell Excel what cells to work on; it knows what to do based on the name of the
function
RAND()
- Random number generator
- Another function with NO arguments: again, you don’t need to identify what cells it will use:
Excel will just generate a random number between 0 and 1, to 15 decimal places
- USE → rapidly generating lots of numbers on which you can practise other functions ☺
- It’s pretty rare that you will need a number between 0 and 1! However, you can use RAND()
to generate random WHOLE numbers by multiplying the result
o For instance =RAND()*100 will multiply your random number by 100 and yield a
result in the tens
o Likewise =RAND()*1000 will multiply by 1000 and yield a result in the h
undreds
- The random number generator changes its results every time you perform another action.
You can keep numbers by value-copying them (i.e. replacing the formula with the result).
Highlight the cell(s) you want to value-copy. From the Edit menu choose Copy. A moving
border appears round the cell(s). Open the Edit menu again and choose Paste Special. In the
Paste Special dialog box, select Values and OK.
SUM()
- Adds the numbers you identify
o You can fill the parentheses with numbers or with cell references
o Probably the most typical use would be on a series of cells, e.g. in a budget or
financial report
- You can type the function in “longhand,” or use the Sigma button (Greek capital E)
- Sigma automatically adds an unbroken column of numbers above it OR an unbroken row of
numbers to its left
COUNT()
- Counts how many cells in the block you identify are occupied by n umeric content
- Does not count cells occupied by text. Be sure to try it repeatedly using numbers, text and a
combination of numbers and text so you understand how this function works.
- Same types of arguments as for SUM() → Try each type of argument (row, column, block
using numbers, text and cell references).
- To get you started:
- =COUNT(A1:B10) – counts the number of cells containing numbers in the block where the
top left corner is cell A1 and the bottom right corner is cell B10
- =COUNT(A15,A20,B10) returns a value of 3, provided each of these cells contains a number
- =COUNT(2,2) returns a value of 2 → this argument contains 2 numbers
- =COUNT(2,”two”) returns a value of 1 → this argument contains 1 number; text doesn’t count
Variations on the theme:
- COUNTA() will count all occupied cells; i.e. every cell that’s not blank. If you were using Excel
to track your donors, you could use COUNTA() at the foot of a list of names (text content)
and it would tell you how many donors were in the list
o Easy way to recall this may be that COUNTA refers to text, i.e. add the “A”, first letter
of the alphabet, to denote a function that works with content beyond numbers
- COUNTBLANK() will count all the blank cells in the range you define
AVERAGE()
- Averages the block of numbers you identify
- THAT IS – it takes the SUM of the numbers, and divides by the COUNT of the numbers
o So, you could also work this out as SUM() / COUNT()
- See the example arguments given for SUM() and COUNT() → The same things work for
average – try them out!
- Could be useful for reporting, e.g. where you’re presenting results from (say) a concert
series, and you also show the average result
- Could be useful for forward planning, e.g. where you know what the last 3 years yielded, and
you decide that next year will be the average of that experience plus 5%
o =AVERAGE(a, b, c) * 1.05
MAX()
- I.E. Maximum
- Returns the highest numeric value from the block of cells you identify
- Same types of arguments as for SUM() and COUNT() → Try each type of argument.
MIN()
- I.E. Minimum
- Returns the lowest numeric value from the block of cells you identify
- Same types of arguments as for SUM() and COUNT() → Try each type of argument.
- Same types of uses as MAX()
ROUND()
- Forces a value to be rounded to the number of decimal places you specify
- This is DIFFERENT from formatting the cell, which “masks” the number of decimal places, but
does not change the value of the number
- If I calculate 8/3 the result is 2.6666666666 (etc. – “repeater” decimal fraction)
- If I put that calculation in a cell and format the cell for dollars, Excel will mask the number,
and show the result as $2.67. However, the number in the cell continues to be that
“repeater” fraction.
- In the example below, I value-copied the formula =8/3 and formatted the cell for dollars:
- If I use ROUND() I can force the result to actually be 2.67, which is a different number.
- ROUND() uses 2 arguments separated by a comma, as follows:
- =ROUND ( thing to be rounded , n
umber of decimal places )
- the “number of decimal places” can be a positive or a negative number or zero
o positive numbers round to the right of the decimal place
o zero rounds to a whole number
o negative numbers round to the left of the decimal place (e.g. -1 rounds to the tens, -2
rounds to the hundreds, -3 rounds to the thousands, and so on)
o see following table for examples:
Nesting functions
Let’s use ROUND() as an example.
- the thing to be rounded can be another function
o =ROUND(((sum(A1:A5)),-1) adds the series of numbers A1:A5 and rounds the result to
the nearest 10
o =ROUND(((average(B10:B15)),-3) averages the series of numbers and rounds the
result to the nearest 1000
o note the use of two sets of nested parentheses – the SUM() function has its own set
of parentheses, a nd the argument within the SUM() function also has parentheses
UPPER()
- Converts text to all upper case
- Same process as for lower
PROPER()
- This one may be the winner of the three in terms of document titles: it capitalizes the first
letter of each word and puts the rest of the text in lower case
- Note that we might often capitalize the “substantive” words and leave prepositions, articles,
etc., in lower case: Excel doesn’t make this distinction
CONCATENATE()
- Puts two text strings together in one cell
- Very handy for list management! Say I’ve got one field for firstname and a second for
lastname, but I really wish they were together as a proper name. I actually want to
concatenate THREE things: the contents of firstname, a space, then the contents of
lastname. Let’s say my firstname field is in column A and lastname in column B:
o =CONCATENATE(A1,” “,B1)
o The double-quotes with a single space in between will add my space character
o When you use double-quotes in an argument, Excel understands you to be referring
to text rather than numbers