05 1022q Cell Formula Basics s2020
05 1022q Cell Formula Basics s2020
• SUM is a
function • A range of • The total number
cells which of meals
contains the
costs of 5 • / means divide
meals
Arithmetic
• In cell formulas you can do basic
calculations like those you learned in
school:
+ Addition
- Subtraction
* Multiplication
/ Division
^ Power
• Take a
look at the
example
in the web
site
"<40" means
any value
smaller than 40
Other Cell Functions with ‘IF’
• As well as COUNTIF(B2:B6, "<40") there’s
also these cell functions which have ‘if’ in their name:
• AVERAGEIF(B2:B6, "<40")
calculate the average for the cells which have values <40
• SUMIF(B2:B6, "<40")
add up the cells, for the cells which have values <40
• You can use any of these:
= equal to <> not equal to
< smaller than <= smaller than or equal to
> larger than >= larger than or equal to
String Concatenation
• In computer language, ‘a string’ means ‘a piece of text’
• Concatenate means putting one string at the end of
another string
• In Excel cell formulas, you can concatenate two strings
by using & or the CONCATENATE function
• For example, this formula:
="Happy" & "Birthday"
and this formula:
=CONCATENATE("Happy", "Birthday")
both produce the same result: HappyBirthday
String Concatenation
• Here is an example of both:
^ Power
* and / Multiplication and division
+ and - Addition and subtraction
& String concatenation
= <> < <= > >= Comparisons
Precedence Example 1
= 20 - 10 / 2 * 3 + 2
• / and * have
higher precedence
than + and -, so
they are handled first
• / and * have equal • So the answer is:
precedence, so the =(20-((10/2)*3))+2
one on the left (/) is
evaluated first, then * = 7
• Then – and + are handled
• – and + have equal precedence, so the
one on the left (-) is evaluated first, then +
Precedence Example 2
= 10 / 2 * 4 - 3 ^ 3
• ^ has a higher
precedence than the
• So the answer is:
others, so it is handled
first =((10/2)*4)-(3^3)
• / and * have equal
precedence, so the one on =((10/2)*4)- 27
the left (/) is evaluated
first, then the * = -7
• The – is handled last
Precedence Example 3
• The comparison
is done last
• The concatenation
is done next
• The multiplication
• For this situation the is done first
result of the formula is:
Quick List of Cell Things
We Looked At
•+ - * / ^
• LEN
• = < > <> <= >=
• UPPER
• SUM • COUNTIF • LOWER
• AVERAGE • AVERAGEIF • LEFT
• STDEV • SUMIF • RIGHT
• MAX • SUBSTITUTE
• MIN •&
• RANK • CONCATENATE