Excel Formulas and Functions

You might also like

Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 26

Text Functions

These are functions that utilize the text in

Concatenate
Description Example
This function links together strings that are either
typed into the function or located in cells. It only has The formula creates a sentence by joining together
imputs called text and will expand to include another cells and text.
space when you add a comma.
Name Start
=CONCATENATE(text1, [text2], ...) John My friend
----------------------------------------------------------
1. Text
In each of the text you can either type in a string or Action
put a cell reference. They will be joined together in swimming
the order you enter.
Formula
=CONCATENATE(I15,F15," went ",F18,".")
Result

My friend John went swimming.

Upper
Description Example
This function makes all of the characters uppercase.
It only has an imput called text. The formula makes the three lowercase letters
uppercase
=UPPER(text)
---------------------------------------------------------- Item
1. Text John
In text you can either type in a string or put a cell
reference.

Formula
=UPPER(F36)
Result

JOHN
JOHN

Proper
Description Example
This function makes the first character of each word
uppercase and others lowercase. It only has an The formula makes the three lowercase letters
imput called text. uppercase

=PROPER(text) Item
---------------------------------------------------------- john aTE lettuce
1. Text
In text you can either type in a string or put a cell
reference.

Formula
=PROPER(F36)
Result

John Ate Lettuce


Text Functions

nctions that utilize the text in a cell.

Trim
Description Example
This removes spaces at the start or end of text in a
cell. This function only has one input called text. The formula removes the spaces from the cell,
leaving just the text "John"
=TRIM(text)
---------------------------------------------------------- Trim Item
1. Text John
The cell with the spaces that need to be removed

Formula
=TRIM(F15)
Result

John

Lower
Description Example
This function makes all of the characters lowercase.
It only has an imput called text. The formula makes the two uppercase letters
lowercase
=UPPER(text)
---------------------------------------------------------- Item
1. Text JohN
In text you can either type in a string or put a cell
reference.

Formula
=LOWER(P36)
Result

john
john

Search
Description Example
This function looks for a character or string in a cell
and returns its start position (reading left to right). It The formula looks for "1000" in the string. Since it
only has imputs called text and will expand to starts on the 6th character, it returns 6.
include another space when you add a comma.
Search Item
=SEARCH(Find_text,within_text, [start_num]) 19282100012
----------------------------------------------------------
1. Find_Text
In text you can either type in a string or put a cell
reference contining the string or character you are
looking for
2. Within_Text
The cell you are searching in Formula
3. Start_Num =SEARCH("1000",F57,1)
Optional. How many characters from the left you
want the search to start at. Ex. if you wanted to Result
exclude the first 3 characters from the search, you
would tell it to start on 4

6
Logical Functions

These are functions that perform test a logic statement and return a result base

If
Description Example
This function gives different results based on
whether a condition is true or false The formula returns yes because f15= house. If it did
not say house, then it would return no
=IF(logical_test, value_if_true, value_if_false)
---------------------------------------------------------- Item
1. Logical Test House
Here is where you put your test. Things like =, <, > <>
can be used. It can also contain other logical
functions
2. Value If True
If your test come back true, this value will be
returned
3. Value If False Formula
If your test comes back false, this value will be =IF(F15="House","Yes","No")
returned
Result

Yes

OR
Description Example
This checks to see that at least 1 condition is true.
There must be at at least on logical test, and more The formula returns "true" because at least one
can be added by putting commas between condition is true. (F36=house)

=OR(logical1, logical2,...) Item


---------------------------------------------------------- House
1. Logical1
This is the first logic you want to check
2. Logical2 Item 2
This is the second logic you want to check 13

Formula
=OR(F36="house",F39<10)
Result

1
1

If Error
Description Example
If a cell has an error, this will let you decide what you
want returned The formula returns "error help" because the
referenced cell has an error.
=IfError(value, value_if_error)
---------------------------------------------------------- Item
1. Value #DIV/0!
This is where you place the cell refrence where you
would like the formula to look for an error
2. Value if Error
If there is an error, this is the value you would like to
have returned
Formula
=IFERROR(F57,"Error Help!")
Result

Error Help!
Logical Functions

ment and return a result based on whether the statement is true or false.

And
Description Example
This checks to see that all conditions are true. There
must be at at least on logical test, and more can be The formula returns "False" because both tests are
added by putting commas between not true. 13 is not less than 10

=AND(logical1, logical2,...) Item


---------------------------------------------------------- House
1. Logical1
This is the first logic you want to check
2. Logical2 Item 2
This is the second logic you want to check 13

Formula
=AND(P15="House",P18<10)
Result

NOT
Description Example
Returns the opposite result of of a True or False
statement. The formula takes the or statement which results in
"true" and changes it to false
=NOT(logical)
---------------------------------------------------------- Item
1. Logical House
This is the first logic you want to check and reverse
the result
Item 2
13

Formula
=NOT(OR(P36="house",P39<10))
Result

0
0

IS NA
Description Example
This checks to see if a cell value is #N/A.
The formula returns "true" because the cell value is
=ISNA(value) #N/A
----------------------------------------------------------
1. Value Item
This is where you place the cell refrence where you #N/A
would like the formula to look for #n/a

Formula
=ISNA(P36)
Result

1
Math Functions

These are functions that perform a mathe

Count IF
Description Example
Count if counts cells that meet the criteria you
specify. It has two parts, the range and the criteria The Counts the cells that are greater than 4
=COUNTIF (range, criteria)
---------------------------------------------------------- Value Look up Table
1. Range 3 3
This is the range where you want excel to look for
your criteria 2
2. Criteria 1
This is the criteria that you want excel to use. The 4
function supports logical operators (>,<,<>,=) and
wildcards (*,?) for partial matching. 7
Formula
=COUNTIF(I15:I19,">" &F15)
Result

Count A
Description Example
Count A counts all of the blank cells in a range
This counts all of the populated cells in the look up
=COUNTA (range) table
----------------------------------------------------------
1. Range Index Look up Table
This is the range where you want excel to look for Boat
populated cells
Car
Bus
Boat Glass
Turtle
Formula
=COUNTA(I36:J40)
Result

6
6

Sum If
Description Example
The Sum if has three parts: range, criteria and the
sum range. The Sum if function sums up the numbers column
where the item is Boat
=SUMIF( range, criteria, [sum_range] )
---------------------------------------------------------- Index Look up Table
1. Range Boat Boat 1
This is the range where you want excel to look for
your criteria Car 2
2. Criteria Bus 1
This is the criteria that you want excel to use. Boat 4
3. Sum Range
This is the range that has the numbers you want to Turtle 7
sum Formula
=sumif(I15:I19,F15,J15:J19)
Result

Subtotal
Description Example
The Subtotal funtion can perform variety of math
functions on the VISIBLE cells. It will skip over rows This sums up the visible numbers in the table
that are hidden by a filter. (hiding the rows on the
sheet will not change the result)
Look up Table
=SUBTOTAL(Function_num, ref1,...) Boat 1
----------------------------------------------------------
1. Function number Car 2
There is a list of options that appear when you start Bus 1
typing the functions. Choose the number for the Boat 4
operation you want to perform
2. Ref Turtle 7
These are the cells you want to reference. You can Formula
either select individual cells or ranges separated by =SUBTOTAL(9,J78:J82)
commas, or just select a single range.
Result

15
Math Functions

unctions that perform a mathematical action.

Count IFs
Description Example
Count if counts cells that meet the criteria you
specify. It has two parts, the range and the criteria. This counts rows in the table that have a number greater than 6
Unlike Count IF, multiple criteria can be used and a value of Summer

=COUNTIFS (range1, criteria1, [range2], Lookup Values Look up Table


[criteria2], ...) 6 Summer Car
----------------------------------------------------------
1. Range Summer Winter Car
This is the range where you want excel to look for Summer Car
your criteria Winter House
2. Criteria
This is the criteria that you want excel to use. The Summer Turtle
function supports logical operators (>,<,<>,=) and Formula
wildcards (*,?) for partial matching. =COUNTIFS(S15:S19,"Summer",U15:U19,">6")
Result

*Note: in this example the items are typed directly into the formula
instead of using a reference cell. The cells could be referenced instead.
Count Blank
Description Example
Count Blanks counts all of the blank cells in a range
This counts all of the blank cells in the look up table
=COUNTBLANK (range)
----------------------------------------------------------
1. Range Lookup Values Look up Table
This is the range where you want excel to look for Summer Car
blank cells
Car
Car
House
Winter Turtle
Formula
=COUNTBLANK(S36:U40)
Result

6
6

Sum Ifs
Description Example
The Sum if has the same three main parts as Sum if:
range, criteria and the sum range. However, the The match below looks for both "Summer" and "Car"
formula will allow you to continue adding ranges and
criteria as you need them
Lookup Values Look up Table
=SUMIFS (sum_range, range1, criteria1, [range2], Car Summer Car
[criteria2], ...)
------------------------------------------------------------ Summer Winter Car
Note: The sum range comes first in this function Summer Car
Winter House
1. Sum Range
This is the range that has the numbers you want to Winter Turtle
sum Formula
2. Range =SUMIFS(U15:U19,T15:T19,P15,S15:S19,P16)
This is the range where you want excel to look for
your criteria Result
3. Criteria
This is the criteria that you want excel to use.

13
number greater than 6
er

ook up Table
7
45
12
3
5

15:U19,">6")

rectly into the formula


d be referenced instead.

he look up table

ook up Table
1

40)
mmer" and "Car"

ook up Table
1
45
12
3
6

S15:S19,P16)
Index - Match

Index Match is a lookup formula that can replace both the Vlookup and Hlookup functions. The index max function i

Index
Description Example
The index function returns a cell within a range
based on a count provided by a user. It has two The index below returns the third cell down in our
parts, the range and the row or column you are lookup range
looking for.
Index Look up Array
=INDEX(range, row_or_column) 3 Boat
----------------------------------------------------------
1. Range Car
This is the range (row or column) where you want Bus
excel to look House
2. Row or Column
The location of the cell in the range Turtle
Formula
=INDEX(S15:S19,P15)
Result

Bus

Index- Match
Description Example 1
Since the match function finds the location of a cell,
we can use it to replace the Row or Column piece of The formula below looks up the word house, than finds its price.
index function.

=INDEX(range, MATCH(lookup_value, lookup_range, Index Lookup Table


match_type)) House Item Price
--------------------------------------------------- Car 19,000
What we get is a formula that returns a value located Bus 60,000
on the row or column we have looked up, in House 160,000
whatever range we have specified.
Turtle 10
Formula
=INDEX(J37:J40,MATCH(F36,I37:I40,0))
Result

160000
160000

Practice Section

1. Find the March Food Prices Jan Feb Mar


Pork $ 3.45 $ 2.39 $ 4.53
Chicken $ 3.49 $ 6.00 $ 3.46
Beef $ 4.56 $ 3.78 $ 8.00
Turkey $ 5.60 $ 4.57 $ 5.46

Hint: Adding $ to your ranges prevents them from moving when they ar

2. Find the Feb Food Prices


Pork Chicken Beef Turkey
Jan $ 3.45 $ 3.49 $ 4.56 $ 5.60
Feb $ 2.39 $ 6.00 $ 3.78 $ 4.57
Mar $ 4.53 $ 3.46 $ 8.00 $ 5.46
Index - Match

tions. The index max function is comprised of two functions with the MATCH being nested inside of the INDEX.

Match
Description Example

The match below looks for the value "House" in the


array

Lookup Value Look up Array


House Boat
Car
The match function looks for a value in an array (a Bus
group of cells) and returns its position. It has three House
parts: a lookup value, a lookup range, and a match
type. Turtle
Formula
=MATCH(lookup_value, lookup_range, match_type)
---------------------------------------------------------- =MATCH(F15,I15:I19,0)
1. Lookup Value Result
This is the value you want the function to search for
2. Look up Range
This is where you want excel to look for the value
3. Match Type
Less than (1):returns location of item less than your 4
lookup value
Greater Than(0): returns location of item greater
than your lookup value,
Exact Match (-1):Finds your lookup value

1 Example 2

d house, than finds its price. The formula below looks up the word Car, then finds its July Price

Index
Car Item Car House Boat
Lookup May Price 19,000 160,000 60,000
Table June Price 12,000 230,000 65,000
July Price 27,000 115,000 70,000

Formula
F36,I37:I40,0)) =INDEX(Q39:T39,MATCH(M36,Q36:T36,0))
Result

27000
27000

March (Your Answers) Sample Answer


Beef $ 8.00
Turkey $ 5.46
Pork $ 4.53
Chicken $ 3.46

em from moving when they are dragged down

Feb (Your Answers) Sample Answer


Beef $ 3.78
Turkey $ 4.57
Pork $ 2.39
Chicken $ 6.00
Time Functions

These are function that can be used

Today
Description Example
This function returns today's date
Pulls today's data
=TODAY()
----------------------------------------------------------
No Imputs

*Note: you can add or subtract days from today


Ex: If you wanted to find yesterday's date you could
add -1 to the formula: =Today() - 1

Formula
=TODAY()
Result

10/12/2020

Now
Description Example
This is similar to the today function, but it includes
the time with the date This example returns the current date and time
=NOW()
----------------------------------------------------------
No Imputs

*Note: you can add or subtract days/hours from the


result

Ex: If you wanted to find yesterday's date you could


add -1 to the formula: =NOW() - 1
Formula
Ex: If you wanted to find an hour earlier you could =NOW()
add -(1/24) to the formula: =NOW() - (1/24)
Result

10/12/2020 15:39
10/12/2020 15:39

Workday
Description Example
This function lets you add or subtract from a date,
looking only at weekdays This example returns the date for 10 workdays from
today
=WORKDAY(start_day, days, [holidays])
----------------------------------------------------------

1. Start Day
The day you are adding or subtracting from
2. Days
The number of days you are adding or subtracting
(add a - to subtract ex: -1)
3.Holidays Formula
Optional: the number of holidays in your time frame =WORKDAY(TODAY(),10)
Result

10/26/2020
Time Functions

are function that can be used to find dates

EO Month
Description Example
This formula finds the last day of the month for the
date you input. This counts rows in the table that have a number greater than 6
and a value of Summer
=EOMONTH (start_date, months)
---------------------------------------------------------- Date
1. Start Date 10/12/2020
This is a day of the month you want to reference.
You can put today() if you would like to know the last
day of the current month
2. Criteria
This tells excel which month you are interested in. It
is based off they month of the start date. 0 will
return the month of the start date, -1 is the prior Formula
month, 1 will be the next month. Any number can be =EOMONTH(P15,0)
entered
Result

10/31/2020

Weekday
Description Example
This provides a number saying what day of the week
your date is. This returns what day in the week today is.
=WEEKDAY (serial number, [return type])
----------------------------------------------------------
1. Serial Number
This is the day you need the weekday number for

2. Return Type
This determines how the week will be counted. A
menu will pop up to give you options. Select one of
the numbers. If you want a standard Sunday-
Saturday week, the number you need is 1. Formula
=WEEKDAY(TODAY(),1)
*Note: This is particularly helpful if used with other
date formulas like today() Result
Ex: To find next thurday I can go to the end of the
week + add 5 days (thursday is fifth day of the week)
=TODAY()+(7-WEEKDAY(TODAY(),1))+5
2
date formulas like today()
Ex: To find next thurday I can go to the end of the
week + add 5 days (thursday is fifth day of the week)
=TODAY()+(7-WEEKDAY(TODAY(),1))+5
2

Week Number
Description Example
This provides a number saying what day of the week
your date is. This returns the week number today is in.
=WEEKNUM (serial number, [return type])
----------------------------------------------------------
1. Serial Number
This is the day you need the week number for

2. Return Type
This determines how the week will be counted. A
menu will pop up to give you options. Select one of
the numbers. If you want a standard Sunday-
Saturday week, the number you need is 1. Formula
=WEEKNUM(TODAY(),1)
Result

42
umber greater than 6
r

ek today is.

)
oday is in.

1)
Practice Questions

Question WorkSpace
Write a formula to find the last day of
1 the prior month that will update
dynamically.
Write a formula that give an answer of
2 "Yes" if it is Tuesday, and "No" if it is
not.

3 Find next Wednesday's date dynamically

4 Join cells in columns D & E together 123 abc

5 If the cell contains the string "cat" then


A dog and a cat play
return the word yes fetch.
Color Number Color Number
Columns f & g contain a look up table Orange Yellow 1
with colors and numbers, use index
6 Blue 2
match to find the number that goes with
orange Orange 3
Purple 4
Numbers Your Answer
Count the number of cells with numbers 2 3 4 7
7
greater than 6 31 1 5 8
1 9 6 1

Write a formula that makes this


8
sentence all uppercase.

Color Number
Grapes 1
9 Sum up the numbers for all apples Apples 2
Pear 3
Apples 4
Answer

9/30/2020

No

10/21/2020

123abc

Yes

WRITE A FORMULA
THAT MAKES THIS
SENTENCE ALL
UPPERCASE.

You might also like