You are on page 1of 179

Get started with formulas

In just a few steps, you'll be up and running with building formulas and functions in Excel, the
world's most powerful spreadsheet app.

Go back to top by pressing CTRL+HOME. To start the tour, press CTRL+PAGE DOWN.
Let's go >
Bas
Basics: doing ma
You can Add, Sub
To Add, select ce
You ca
To Subtract,
Yousele
jus
sign.
To Multiply, selec
To Divide, select c
Check this out: c
EXTRA CREDIT:1 Y
Dive down for mo
Next step
More about2 form
Excel is made up
Formulas can
You'll notice3that
Formulas with fu
You confirm a fo
4
Some formula ex
=10*20 is a form
=SUM(A1:A10) is
=SUM(A1:A10,C1
GOOD TO
Previous
Next
More information
Mo
Use Excel as a ca
Overview Excel
of form
is
Excel functions
numbe(
and you
Excel functions (
Free ExcelFormul
trainin
The foll

=A1+B1
=10*20
=SUM(A

You'll n
built co
result. F
totals t
over 40

Formul
argume
You con
the resu
bar ben
cell. Pre

Mo
sics: doing math with Excel
ath with Excel
btract, Multiply, and Divide in Excel without using any built-in functions. You just need to use some basic oper
ell F3, type =C3+C4, then press Enter.
an Add, Subtract, Multiply, and Divide in Excel without using any built-in functions.
ect cell F4,
st need typesome
to use =C3-C4, then
basic press Enter.
operators: +, -, *, /. All formulas start with an equals (=)
ct cell F5, type =C3*C4, then press Enter.
cell F6, type =C3/C4, then press Enter.
change the numbers in cells C3 and C4, and watch the formula results automatically change.
To Add, select cell F3, type =C3+C4, then press Enter.
You can raise a value to a power by using the carat (^) symbol, like =A1^A2. Enter it with Shift+6. In cell F7, en
CH
more detail
Ch
To Subtract, select cell F4, type =C3-C4, then press Enter. the
mulas, cells, and ranges ch
p of individual cells that are grouped into rows and columns. Rows are numbered, and columns are lettered. T
To Multiply, select cell F5, type =C3*C4, then press Enter.
t in our third example above, we used the SUM function. A function is a pre-built command that takes a value
unctions start with an equals sign, then the function name follows with its arguments (the values a function
ormula by pressing Enter. Once you do that the formula will calculate, and the result will be displayed in the ce
To Divide, select cell F6, type =C3/C4, then press Enter.
xplanations
mula, where 10 and 20 are constants, and the * sign is the operator.
s a formula, where SUM is the function name, the opening and closing parentheses contain the formula argu
1:C10) is a formula, where SUM is the function name, the opening and closing parentheses contain the formu
Dive down for more detail Next step

on on the web
re about formulas, cells, and ranges
alculator
mulas
s madeinupExcel
of individual cells that are grouped into rows and columns. Rows are
(by category)
ered, and columns are lettered. There are over 1 million rows and 16,000 columns,
ou can put formulas in any of them
(alphabetical) 
lasonline
ng can contain cell references, ranges of cell references, operators, and constants.
lowing are all examples of formulas: =A1+
1
0 Cell referen
(A1:A10)

notice that in our third example above, we used the SUM function. A function is a pre-
ommand that takes a value or values, calculates them in a certain way, and returns a
For instance, the SUM function takes the cell references or ranges you specify, and Functio
them. In this example it takes the cells A1 through A10, and totals them. Excel has
00 functions which you can explore on the Formulas tab
=SUM
A range
las with functions start with an equals sign, then the function name follows with its
When
ents (the values a function uses to calculate) wrapped in parentheses.
nfirm a formula by pressing Enter. Once you do that the formula will calculate, and
ult will be displayed in the cell. To see the formula itself, you can look at the formula
neath the Ribbon, or press F2 to enter Edit mode, where you'll see the formula in the
ess Enter again to finalize the formula and calculate the result.
Funct

suoiverP Next =SUM


ore information on the web
Use Excel as a calculator

Overview of formulas in Excel

Excel functions (by category)

Excel functions (alphabetical) 

Free Excel training online


Numbers to use: Operation: Formulas: Answers:
1 Addition (+) 3
2 Subtraction (-) -1
Multiplication (*) 2
Division (/) 0.5
Power (^) 1
nter =C3^C4.
HECK THIS OUT EXTRA CREDIT
hange the numbers here, and watch You can raise a value to a
e formula results automatically power by using the carat (^)
symbol, like =C3^C4. Enter it
hange. with Shift+6.
There are over 1 million rows and 16,000 columns, and you can put formulas in any of them.

e or values, calculates them in a certain way, and returns a result. For instance, the SUM function t
uses to calculate) wrapped in parentheses.
ell. To see the formula itself, you can look at the formula bar beneath the Ribbon, or press F2 to en

ments, and A1:A10 is the cell range for the function.


ula arguments, and A1:A10,C1:C10 are the cell ranges for the function separated by a comma.

GOOD TO KN
Operator Operator Constants are
=10*20 might

+B1 =10*20 good practice


without select
hard to chang
cells, where th
nce Cell Constant Constant formulas.
reference
For example: S
used the SUM
or "8" directly i
on Argument

M(A1:A10)
e of cells has a starting cell, colon, and an ending cell.
n you select a range of cells for a formula, Excel will
automatically add the colon.
Commas separate multiple arguments

tion Argument Argument

M(A1:A10,C1:C10)
A range of cells Another range of cells

Opening parenthesis Closing parenthesis. Excel will usually ad


when you press Enter.
takes the cell references or ranges you specify, and totals them. In this example it takes the cells A1 through

nter Edit mode, where you'll see the formula in the cell. Press Enter again to finalize the formula and calculate

NOW
e values that you enter in cells or formulas. While
t calculate the same as =A1+B1, constants aren't a
e. Why? Because you can't easily see the constant
ting the cell and looking for it. That can make it
ge later. It's much easier to put your constants in
hey can be easily adjusted, and referenced in your

Select the yellow cell with 12 below. You'll see we


M function with a range of cells. We didn't type in "4"
into the formula

Values
4
8
12
dd this for you
A10, and totals them. Excel has over 400 functions, which you can explore on the Formulas tab.

e the result.
Intr
Introduction to f
Functions give yo
Under the
Functio
Now let's try Auto
operati
Here's a neat key
values
Dive down for mo
EXTRA CREDIT T
Next step 1
More about func
Go to the Formu
2
If the SUM functi
The TODAY funct
CHECK THIS OUT
IMPORTANT
More information
3SUM
All about the
Use AutoSum to
All about the COU
Free Excel trainin
Back to top
Next step

Mor
Go to th
listed b
functio

When y
will list
press T
If the
D41, a

Mo

Free Excel trainin


Go back to top b
roduction
functions to functions
you the ability to do a variety of things, like perform mathematical operations, look up values, or even calculat

ons give you the ability to do a variety of things, like perform mathematical
oSum. Select the cell under the column for Meat (cell G7), then go to Formulas > AutoSum > select SUM. You'
ions, look up values, or even calculate dates and times. Let's try a few ways to add up
yboard shortcut.
with the Select cell D15, then press Alt =, then Enter. This automatically enters SUM for you.
SUM function.
more detail
TryUnder
the COUNT function
the Amount usingfor
column anyFruit
of the methods
(cell you've
D7), enter already tried.
=SUM(D3:D6), The COUNT
or type =SUM(, function counts the numb
then select that range with the mouse, and press Enter. This will sum the values in
cells D3, D4, D5, and D6. Your answer should be 170.
ctions
ulas tab and browse through the Function Library, where functions are listed by category, like Text, Date & Tim
Now
ion let'talk,
could s try itAutoSum. Select
would say, the
return yellow
the sum cell under
of all the column
the values in cellsfor Meat
D38 (cell G7),
to D41, and all of column H. SUM is th
then go to Formulas > AutoSum > select SUM. You'll see Excel automatically
ction returns today's date. It will automatically update when Excel recalculates.
enter the formula for you. Press Enter to confirm it. The AutoSum feature has all
T Select these cells. Then in the lower-right corner of the Excel window, look for SUM: 170 in the bottom bar. T

on on the web
Here's a neat keyboard shortcut. Select cell D15, then press then,Alt
Enter. This
=
M function
automatically enters SUM for you.
o sum numbers
UNT function
ng online
Dive down for more detail Next step

re about functions
he Formulas tab and browse through the Function Library, where functions are
by category, like Text, Date & Time, etc. Insert Function will let you search for
ons by name, and launch a function wizard that can help you build your formula.

you start typing a function name after you press =, Excel will launch Intellisense, which
all of the functions starting with the letters you type. When you find the one you want,
Tab and Excel will automatically finish the function name and enter the opening

The function The first Additional


name. argument. arguments,
It's almost separated by
always commas ( )
always commas (,).
required.

=SUM(D38:D41,H:H)
SUM function could talk, it would say, "Return the sum of all the values in cells D38 to
and all of column H".

The TODAY function returns today's date. It will


automatically update when Excel recalculates.

=TODAY()

re information on the web


All about the SUM function

Use AutoSum to sum numbers

All about the COUNT function

Free Excel training online

Back to top Next step

ng online
by pressing CTRL+HOME. To proceed to the next step, press CTRL+PAGE DOWN.
Fruit Amount Meat Amount
Apples 50 Beef 50
Oranges 20 Chicken 30
Bananas 60 Pork 10
Lemons 40 Fish 50
SUM > 170 SUM >

Item Amount Item Amount


Bread 50 Bread 50
Donuts 100 Donuts 100
Cookies 40 Cookies 40
Cakes 50 Cakes 50
Pies 20 Pies 20
SUM > COUNT >

EXTRA CREDIT
Try the COUNT function using any of
the methods you've already tried. The
COUNT function counts the number o
cells in a range that contain numbers

Fruit Amount
Apples 50 CHECK THIS OUT
Select these cells. Then in the lower-right
Oranges 20 corner of the Excel window, look for this:
Bananas 60
Lemons 40 That's called the Status Bar, and it's just
SUM > 170 another way to quickly find a total and other
details about a selected cell or range.

Item Amount
Cars 20
Trucks 10
Bikes 10
Skates 40

Total: Additional Value New Total


180 100 180

IMPORTANT DETAIL
Double-click this cell. You'll notice the 100 toward the end.
Although it's possible to put numbers in a formula like this,
we don't recommend it unless it's absolutely necessary. This
is known as a constant, and it's easy to forget that it's there.
We recommend referring to another cell instead, like cell
F51. That way it's easily seen and not hidden inside a
formula.
f
e
of
s.
AVERAGE
function AVE
Use the AVERAG
Use the
Select cell D7, the
Now select cell G
In cell D15, 1
you c
CHECK THIS
Activate the previo
2 she
Go to the next
EXTRA CREDIT
Links for more info
3 all a
Select to learn
Select to learn all a
Select to learn all a
Select to learn abo

Mo
ERAGE function
GE function to get the average of numbers in a range of cells.
e AVERAGE function to get the average of numbers in a range of cells.
en use AutoSum to add an AVERAGE function.
G7, and enter an AVERAGE function by typing =AVERAGE(G3:G6).
Select cell D7, then use AutoSum to add an AVERAGE function.
can use either AutoSum, or type to enter another AVERAGE function.

ousNow
sheet
select cell G7, and enter an AVERAGE function by typing =AVERAGE(G3:G6)
eet

formation on the web


In cell
about theD15, you can
AVERAGE use either
function on theAutoSum,
web or type to enter another AVERAGE
function.
about the MEDIAN function on the web
about the MODE function on the web
out free Excel training on the web
suoiverP Next

re information on the web


All about the AVERAGE function

All about the MEDIAN function

All about the MODE function

Free Excel training online


Fruit Amount Meat Amount
Apples 50 Beef 50
CHECK THIS OUT
Select any range of n
Oranges 20 Chicken 30 look in the Status Bar
Bananas 60 Pork 10 instant Average.
Lemons 40 Fish 50
AVERAGE > AVERAGE >

Item Amount Item Amount


Bread 50 Bread 50
Donuts 100 Donuts 100
Cookies 40 Cookies 40
Cakes 50 Cakes 50
Pies 20 Pies 20
AVERAGE > suoiverP

EXTRA CREDIT
Try using MEDIAN or MODE here.

MEDIAN gives you the value in the


middle of the data set, while
MODE gives the one that occurs
th tf tl

More about the SUM function


In some of the above tips, we taught you how to use the SUM function. Here are more details about it.
Cells C37 through D41 contain data with two columns: Fruit and Amount.
The formula in cell D42: =SUM(D38:D41).
If the SUM function in cell D42 could talk, it would say this: Sum up the values in cells D38, D39, D40, and D4
Here's another way it can be used:
Cells C47 through D48 contain data with two columns: Item and Amount.

More information on the web


All about the SUM function
All about the SUMIF function
Use Excel as your calculator
Free Excel training online
Go back to top by pressing CTRL+HOME. To proceed to the next step, press CTRL+PAGE DOWN.
umbers, then
r for an

41.
N
ext
MIN
MIN and MAX func
Use the MIN funct
Use the
Use the MAX func
Select cell D7,
Now select cell
1
In cell D15, you
More information
All aobut the MIN f
2
All about the MAX
Free Excel training
GOOD TO KNOW
3

Mo
You can use eithe

More information o
All about the MIN f
All about the MAX
Use Excel as your
Free Excel training
Nctions
and MAX functions
tion to get the minumum number in a range of cells.
e MIN function to get the smallest number in a range of cells.
ction to get the maximum number in a range of cells.

Select cell D7, then use the AutoSum Wizard to add a MIN function.

function
Now select cell G7, and enter a MAX function by typing =MAX(D3:D6).
X function
g online
In cell D15, you can use either the AutoSum Wizard, or type to enter a MIN or MAX
function.

re information on the web


er MIN or MAX with multiple ranges, or values to show the greater or lesser of those values, like =MIN(A1:A10,B1:B10),

on the web
All about the MIN function
function
X function
All about the MAX function
calculator
g online
Free Excel training online
Fruit Amount Meat Amount
Apples 50 Beef 50
Oranges 20 Chicken 30
Bananas 60 Pork 10
Lemons 40 Fish 50
MIN > MAX >

Item Amount Item Amount


Bread 50 Bread 50
Donuts 100 Donuts 100
Cookies 40 Cookies 40
Cakes 50 Cakes 50
Pies 20 Pies 20
MIN or MAX > 10
suoiverP

GOOD TO KNOW
You can use either MIN or MAX with multiple ranges, or
or =MAX(A1:A10,10). values to show the greater or lesser of those values,
like =MIN(A1:A10,B1:B10), or =MAX(A1:A10,B1), where
B1 contains a threshold value, like 10, in which case
the formula would never return a result less than 10.
Ne
ext
Dat
Date functions
Excel can give yo
Excel c
Check outalso
the TO
ad
Subtract Dates -
Add Dates - Let's
1
GOOD TO KNOW
IMPORTANT
Time functions
Excel can give yo
2
In cell D28, enter
Add up hours
If this formula co
Previous
3
Next
More information
All about the TOD
All about the NOW
All about the DAT
Free Excel trainin
Tim
Excel c
also ad
h

3
Mo
te functions
ou the current date, based on your computer's regional settings. You can also add and subtract Dates.
can give you the current date, based on your computer's regional settings. You can
ODAY
dd andfunction,
subtractwhich gives you Today's date. These are live, or volatile functions, so when you open your wor
Dates.
- Enter your next birthday in MM/DD/YY format in cell D7, and watch Excel tell you how many days away it is b
s say you out
Check want toTODAY
the know what date which
function, a bill isgives
due, or
youwhen you
Today' need These
s date. to return
arealive,
library
or book. You can add days to
volatile
W Excel functions,
keeps so when
dates and times you
basedopen
on your workbook
the number tomorrow,
of days it will
starting from have
January 1, 1900. Times are kept in
tomorrow's date. Enter =TODAY() in cell D6.

ou Subtract
the current time,- Enter
Dates basedyour
on your
nextcomputer' s regional
birthday in MM/DD/YYsettings.
formatYou canD7,
in cell also addwatch
and and subtract times. For ins
Excel tell you how many days away it is by using =D7-D6 in cell D8.

ould talk, it would say, "Take the Time Out and subtract it from the Time In, then subtract the Lunch Out/In Tim
Add Dates - Let's say you want to know what date a bill is due, or when you need to
return a library book. You can add days to a date to find out. In cell D10, enter a
random number of days. In cell D11, we added =D6+D10 to calculate the due date
on on the web
DAY function
OW function
TE function
ng online
me functions
can give you the current time, based on your computer's regional settings. You can
dd and subtract times. For instance, you might need to keep track of how many
l k d h k d l l t th i d ti

In cell D28, enter =NOW(), which will give the current time, and will update each
time Excel calculates. If you need to change the Time format, you can go to
Ctrl+1 > Number > Time > Select the format you want.

Add up hours between times - In cell D36 we've entered =((D35-D32)-(D34-


D33))*24, which calculates someone's start and end times, then subracts the
time they took for lunch. The *24 at the end of the formula converts the

If this formula could talk, it would say, "Take the Time Out and subtract it from
the Time In, then subtract the Lunch Out/In Times, then multiply those by 24 to
convert Excel's fractional time to hours", or =((Time In - Time Out)-(Lunch In -

*24 to convert Excel's


fraction of a day to
Time Out Lunch Out hours
=((D35-D32)-(D34-D33))*24

Time In Lunch In

You

The inner parentheses () make sure Excel calculates those


parts of the formula by themselves. The outer parentheses make
sure Excel multiplies the final inner result by 24.

suoiverP Next

re information on the web


All about the TODAY function

All about the NOW function

All about the DATE function

Free Excel training online


rkbook tomorrow, it will have tomorrow's date. Enter =TODAY() in cell D6.
by using =D7-D6 in cell D8.
Date functions
Today's date:
Your birthday:
Days until your birthday: IMPORTANT DETAIL
If you don't want Excel to display a n
stance, you might need to keep track of how many hours an employee worked
haven't eachyour
entered week, and calculate
birthday yet, yo
Grace period days: this: =IF(D7="","",D7-D6), which says,
Bill due on: show nothing, otherwise show D7 m
mes, then multiply those by 24 to convert Excel's fractional time to hours", or =((Time In - Time Out)-(Lu

GOOD TO KNOW
Excel keeps dates and times based on the number of days
starting from January 1, 1900. Times are kept in fractional
portions of a day based on minutes. So 01/01/2017 12:30
PM is actually stored as 42736.5208. If the Time or Date
show up as numbers like that, then you can press Ctrl+1 >
Number > select a Date or Time format.

Time functions
Current Time:

Daily Hours Worked


Time In: 8:00 AM
Lunch Out: 12:00 PM
Lunch In: 1:00 PM
Time Out: 5:00 PM
Total Hours: 8
Static Date & Time
Date: 09/27/17
Time: 8:52 AM

GOOD TO KNOW
can use keyboard shortcuts to enter Dates and Times that
won't continuously change:

Date - Ctrl+;
Time - Ctrl+Shift+:
negative number, because you
oue their pay an
can use andIFovertime.
function like
, "IF D7 equals nothing, then
minus D6".
unch In - Lunch Out))*24.
Joi
Joining text from
There are many t
In cell E3, enter =
There a
SmithNancy doe
examp
To create the full
as first
Dive down for mo
Next
Using text and nu
Now we'll use 1 the
In cell C36, enter
In cell C37, enter
CHECK THIS OUT
2
WORTH EXPLOR
More information
All about the TEX
Combine text an
3
Free Excel trainin

Usi
Now w

Look at

2
Mo
ning text from different cells
m different cells
times in Excel when you want to join text that's in different cells. This example is very common, where you hav
=D3&C3 to join the last and first names.
are many times in Excel when you want to join text that's in different cells. This
esn't
ple is look
very quite
common,right where
though. We
you needfirst
have to add
and alast
comma and
names, a space.
and Tocombine
want to do that we'll
themuse quotes to create a ne
lt name, we'll join first and last name, but use a space without a comma. In F3,
name last name or full name Fortunately Excel lets us do that with the Ampersand enter =C3&" "&D3.
more detail

umbers together
In cell E3, enter =D3&C3 to join the last and first names.
e & to join text and numbers, not just text and text Look at cells C28:D29. See how the date and times are in s
r =C28&" "&TEXT(D28,"MM/DD/YYYY"). MM/DD/YYYY is the US format code for Month/Day/Year, like 09/25/2
r =C29&" "&TEXT(D29,"HH:MM
SmithNancy AM/PM").
doesn't look quite HH:MM
right though. WeAM/PM
need toisadd
the aUS formatand
comma code
a for Hours:Minutes AM or PM,
T Formulas,
space. To doespecially biguse
that we'll ones, can sometimes
quotes be hard
to create a new textto read, This
string. but you
time,can break up their parts with spaces
enter
=D3&",
RING If you"&C3.
don'tThe &",know
don't "& portion
whatlets us join
format codea comma andcan
to use, you space
usewith the>text
Ctrl+1 in to format any cell the wa
Number
on on the web
XT function
nd numbers
To create the full name, we'll join first and last name, but use a space without a
ngcomma.
online In F3, enter =C3&" "&D3.

Dive down for more detail Next

ng text and numbers together


we'll use the & to join text and numbers, not just text and text

at cells C28:D29 See how the date and times are in separate cells? You can join them

In cell C36, enter =C28&" "&TEXT(D28,"MM/DD/YYYY"). MM/DD/YYYY is the US


format code for Month/Day/Year, like 09/25/2017.

In cell C37, enter =C29&" "&TEXT(D29,"HH:MM AM/PM"). HH:MM AM/PM is the


US format code for Hours:Minutes AM or PM, like 1:30 PM.
WOR
If you
Ctrl+1
select
suoiverP Next
suoiverP Next displa

re information on the web


All about the TEXT function

Combine text and numbers

Free Excel training online


First Name Last Name Last Name, First Name Full Name
Nancy Smith Smith, Nancy Nancy Smith
Andy North
Jan Kotas
Mariya Jones
Steven Thorpe
Michael Neipper
Robert Zare
Yvonne McKay
, like 1:30 PM.
s like this: =C28 & " " & TEXT(D28,"MM/DD/YYYY")
ay you want. Then select the Custom option. You can copy the format code that's displayed back to your f

Using text & numbers


Today's date: 06/23/19
Current time: 10:08 PM

Joining text & numbers


Today's date: 43639
Current time: 43639.9226273148
CHECK THIS OUT
Formatting text & numbers Formulas, especially big ones, can sometimes
Today's date: 06/23/2019 be hard to read, but you can break up their
Current time: 10:08 PM parts with spaces like this:

=C28 & " " & TEXT(D28,"MM/DD/YYYY")

RTH EXPLORING
don't don't know what format code to use, you can use
1 > Number to format any cell the way you want. Then
t the Custom option. You can copy the format code that's
p py
ayed back to your formula.
formula.
IF s
IF statements
IF statements all
In cell D9 enter
Copy D9 to IFD10.
state
genera
Try another
formula
IMPORTANT DET
Dive down for mo
Next
IF statement 1wit
IF statements ca
In cell F33, we've
Next we've 2
Next, change
GOOD TO KNOW
EXPERT TIP 3
Previous
Next
More information
All about the IF f
All about the IFS
Advanced IF stat
Free Excel trainin

IF s
IF state
met. H
it if the

3
Mor
statements
low you to make logical comparisons between conditions. An IF statement generally says that if one conditio

ements allow you to make logical comparisons between conditions. An IF statement


ally says that if one condition is true do something, otherwise do something else. The
as can return text values or even more calculations
TAIL TRUE and FALSE are unlike other words in Excel formulas in that they don't need to be in quotes, and Exc
more detail
In cell D9 enter =IF(C9="Apple",TRUE,FALSE). The correct answer is TRUE.
th another function
an also force additional calculations to be performed if a certain condition is met. Here we're going to evaluat

Copy D9 to D10. The answer here should be FALSE, because an orange is not an
apple.

W When you create a formula, Excel will automatically place colored borders around any ranges referenced in
Try another example by looking at the formula in cell D12. We got you started
with =IF(C12<100,"Less than 100","Greater than or equal to 100"). What
happens if you enter a number greater than or equal to

on on the web
function
S function
Dive down for more detail
tements Next
ng online

statement with another function


ements can also force additional calculations to be performed if a certain condition is
Here we're going to evaluate a cell to see if Sales Tax should be charged, and calculate
e condition is true

In cell F33, we've entered =IF(E33="Yes",F31*SalesTax,0), where we set up


SalesTax as a Named Range with a value of 0.0825. Our formula says If cell E33
equals Yes, then multiply cell F31 times SalesTax, otherwise return a 0.

Next we've added an IF statement to calculate shipping if it's required. In cell F35
you'll see =IF(E35="Yes",SUM(D28:D29)*1.25,0). This says "If cell E35 is Yes, then
take the sum of the Quantity column in the table above, and multiply it by 1.25,

Next, change the 1.25 in the formula in cell F35 to "Shipping". As you start typing, EX
Excel's auto-correct, should find it for you. When it does, press Tab to enter it. Na
This is a Named Range, and we entered it from Formulas > Define Name. Now, if an
na
Ma

suoiverP Next

re information on the web


All about the IF function

All about the IFS function

Advanced IF statements

Free Excel training online


on is true do something, otherwise do something else. The formulas can return text, values, or ev

cel will automatically capitalize them. Numbers don't need to be in quotes either. Regular text, like

IF statements
Apple
Orange

50 Less than 100

the formula, and the corresponding ranges in the formula will be the same color. You can see thi
IMPORTANT DETAIL
TRUE and FALSE are unlike other words in Excel formulas in
that they don't need to be in quotes, and Excel will
automatically capitalize them. Numbers don't need to be in
quotes either. Regular text, like Yes or No does need to be in
quotes like this:
=IF(C3="Apple","Yes","No")

Item Quantity Cost Total


Widget 2 $9.76 $19.52
Doohickey 3 $3.42 $10.26

Sub-Total $13.18 $29.78

Sales Tax? Yes $2.46 GOO


When
color
Shipping? Yes $6.25 and t
color
Total $38.48 edit t

XPERT TIP
amed Ranges allow you to define terms or values in a single place,
d then reuse them throughout a workbook. You can see all of the
med ranges in this workbook by going to Formulas > Name
g yg g
anager. Click here to learn more.
ven more calculations.

e Yes or No does need to be in quotes like this: =IF(C3="Apple","Yes","No")

is if you select cell F33 and press F2 to edit the formula.

OD TO KNOW
en you create a formula, Excel will automatically place
red borders around any ranges referenced in the formula,
the corresponding ranges in the formula will be the same
r. You can see this if you select cell F33 and press F2 to
the formula.
VLOOKUP VLO
VLOOKUP is one
=VLOOKUP(A1,B
VLOOK
What do you wan
VLOOK
If you find it, how
th
Where do you wa
Do you want an e
In cell D22, enter
Now try for
EXPERIMENT Try
Dive down for mo
Next
VLOOKUP and #
Invariably, you'll r
If you know
If you're not
IMPORTANT DET
Previous
Next
More information
All about the VLO
1
All about the IND
All about the IFE
Use PivotTables t
2
Free Excel trainin

VLO
Invaria
returns
can be

1
2

Mo
OOKUP
e of the most widely used functions in Excel (and one of our favorites too!). VLOOKUP lets you look up a value
B:C,2,FALSE)
KUP is one of the most widely used functions in Excel (and one of our favorites too!).
nt to look for?
KUP lets you look up a value in a column on the left, then returns information in
w many columns to the right do you want to get a value?
l t th i ht if it fi d t h VLOOKUP
ant to look for it?
exact, or approximate match?
What do you If you find it, how many
want to look columns to the right do
for? you want to get a value?
ry selecting different items from the drop down lists. You'll see the result cells instantly update themselves wit
more detail

=VLOOKUP(A1,B:C,2,FALSE)
#N/A
run into a situation where VLOOKUP can't find what you asked it to, and it returns an error (#N/A). Sometime

Where do Do you want


TAIL IFERROR is what's known as you want toerror handler,
a blanket an exact, or
meaning it will suppress any error your formula mig
look for it? approximate
match?
on on the web
OOKUP
In cellfunction
D22, enter =VLOOKUP(C22,C17:D20,2,FALSE). The correct answer for
Apples is 50.
DEX/MATCH VLOOKUP looked for Apples, found it, then went over one column to
functions
ERROR function returned the amount.
the right, and
to analyze worksheet data
Now try for yourself in the Meat section, in cell G22. You should end up with
ng online
=VLOOKUP(F22,F17:G20,2,FALSE).

Dive down for more detail Next

OOKUP and #N/A


If the SUM function

ably, you'll run into a situation where VLOOKUP can't find what you asked it to, and it
s an error (#N/A). Sometimes, it's because the lookup value simply doesn't exist, or it
ecause the reference cell doesn't have a value yet.

If you know your lookup value exists, but want to hide the error if the lookup cell is
blank, you can use an IF statement. In this case, we'll wrap our existing VLOOKUP
formula like this in cell D43:
If you're not sure your lookup value exists, but you still want to suppress the #N/
A error, you can use an error handling function called IFERROR in cell G43:
=IFERROR(VLOOKUP(F43,F37:G41,2,FALSE),""). IFERROR says, "If the VLOOKUP

suoiverP Next

re information on the web


All about the VLOOKUP function

All about the INDEX/MATCH functions

All about the IFERROR function

Use PivotTables to analyze worksheet data

Free Excel training online


e in a column on the left, then returns information in another column to the right if it finds a match. VLOOKU

th new values.

es, it's because the lookup value simply doesn't exist, or it can because the reference cell doesn't have a value

Fruit Amount Meat Amount


Apples 50 Beef 50
Oranges 20 Chicken 30
Bananas 60 Pork 10
Lemons 40 Fish 50

Apples Pork

EXPERIMENT
Try selecting different items from the drop down lists. You'll see the
result cells instantly update themselves with new values.

n in cell D42 could talk, it would say this: Sum up the values in cells D38, D
Item Amount Item Amount
Bread 50 Bread 50
Donuts 100 Donuts 100
Cookies 40 Cookies 40
Cakes 50 Cakes 50
Pies 20 Pies 20

#N/A Pastry
IMPORTANT DETAIL
IFERROR is what's known as a blanket error handler, meaning it
will suppress any error your formula might throw. This can cause
problems if Excel is giving you a notification that your formula has
a legitimate error that needs to be fixed.

A rule of thumb is to not add error handlers to your formulas until


you're absolutely certain they work properly.
UP says:

e yet.
Con
Conditional func
Conditional func
SUMIF letsCondit
you s
=SUMIF(C3:C14,
What range do y
What value (text
For each match f
SUMIFS is the1 sa
=SUMIFS(H3:H14
What range do y
This is the first ra
This is the criteria
This is the
This is the criteria
EXPERT TIP
Dive down for mo
Next step
Conditional func
COUNTIF and CO
Select cell D64 an
=COUNTIF(C50:C
What range do y
2
What value (text
COUNTIFS is the
=COUNTIFS(F50
This is the first ra
This is the criteria
This is the secon
This is criteria fo
Dive down for mo
Next
More conditiona
You've already
=SUM
Dive down for mo
Next
SUMIF with a val
Here's an examp
200
Sum up some va
....Look through
...and if the value
NOTE: If you find
More information
All about the SUM
All about the SUM
All about the COU
All about the COU
Con
All about the AVE
All about the AVE
All about the MIN
COUNT
All about the MA
Create a drop-do
Free Excel trainin
Back to top
Next 1

=CO

Mo
You've
own wi
structu

SUM
Here's a
a given

Sum u
values
on this
criterio

=SU
NOTE:
PivotTa

Mo
nditional
ctions - SUMIF functions - SUMIF
ctions let you sum, average, count or get the min or max of a range based on a given condition, or criteria you
sum
tionalinfunctions
one rangeletbased on a average,
you sum, specifc criteria
count oryouget
look
thefor
minin or
another
max ofrange, likebased
a range how many
on Apples you have. Se
,C17,D3:D4)
you want to look at?
t or number) do you want to look for?
found, what range do you want to sum in?
SUMIF lets you sum in one range based on a specifc criteria you look for in
ame as SUMIF,
another butlike
range, it lets
howyou
manyuseApples
multiple criteria.
you have. So in this
Select cellexample,
D17 and you
typecan look for Fruit and Type, instead
4,F3:F14,F17,G3:G14,G17)
=SUMIF(C3:C14,C17,D3:D14). SUMIF is structured like this:
you want to sum?
ange to look in for matches
a for the first matchWhat range do you For each match found, what
want to look at? range do you want to sum?
a for the second match

=SUMIF(C3:C14,C17,D3:D4)
more detail

ctions - COUNTIF
OUNTIFS let you count values Whatin a range
valuebased onnumber)
(text or a criteria you specify. They're a bit different from the other
nd type =COUNTIF(C50:C61,C64). do youCOUNTIF
want toislook
structured
for? like this:
C61,C64)
you want to look at?
SUMIFS is the same as SUMIF, but it lets you use multiple criteria. So in this
t or number)you
example, do can
you look
wantfor
toFruit
look and
for? Type, instead of just by Fruit. Select cell H17
and type =SUMIFS(H3:H14,F3:F14,F17,G3:G14,G17). SUMIFS is structured like
0:F61,F64,G50:G61,G64)
ange to count
a for the first match
What range This is the This is the
nd range to count
do you want criteria for criteria for
or the secondtomatch
sum? the first the second
more detail match match

al functions

MIFS(H3:H14,F3:F14,F17,G3:G14,G17)
more detail

lue argument
ple of the SUMIF function using This is the
greater Thisgreater
than (>) to find all values is the than a given amount:
first range to second
alues based on this criterion: look in for range to look
these cells...   matches in for
e is greater than 50, sum it up.  
d you are making a lot of conditional formulas, you might find that a PivotTable is a better solution. See this P
on onDive down for more detail
the web Next
MIF function
MIFS function
UNTIF function
UNTIFS function
nditional functions - COUNTIF
ERAGEIF function
ERAGEIFS function
NIFS function
TIF and COUNTIFS let you count values in a range based on a criteria you specify.
AXIFS function
own list
ng online

Select cell D64 and type =COUNTIF(C50:C61,C64). COUNTIF is structured like


this:
What range do you
want to look at?

=COUNTIF(C50:C61,C64)

What value (text or number)


do you want to look for?

COUNTIFS is the same as SUMIF, but it lets you use multiple criteria. So in this
example, you can look for Fruit and Type, instead of just by Fruit. Select cell H64
and type =COUNTIFS(F50:F61,F64,G50:G61,G64). COUNTIFS is structured like

This is the first This is the second


range to count range to count

OUNTIFS(F50:F61,F64,G50:G61,G64)

This is the criteria This is criteria for


for the first match the second match

Dive down for more detail Next

ore conditional functions


already seen SUMIF, SUMIFS, COUNTIF, and COUNTIFS. Now you can try on your
ith the other functions, such as AVERAGEIF/S, MAXIFS, MINIFS. They're all
ured the same way, so once you get one formula written, you can just replace the

Dive down for more detail Next

MIF with a value argument


an example of the SUMIF function using greater than (>) to find all values greater than
n amount:

up some ....Look ...and if the


s based through these value is
cells... greater than
is   50, sum it up.
ion:  

UMIF(D118:D122,">=50")
If you find you are making a lot of conditional formulas, you might find that a
able is a better solution. See this PivotTable article for more information.

ore information on the web


All about the SUMIF function All about the SUMIFS function

All about the COUNTIF function All about the COUNTIFS function

All about the AVERAGEIF function All about the AVERAGEIFS function
All about the MINIFS function All about the MAXIFS function

Create a drop-down list Free Excel training online

Back to top Next step


Fruit Amount Fruit Type Amount
Apples 50 Apples Fuji 50
Oranges 20 Oranges Florida 20
Bananas 60 Bananas Cavendish 60
Lemons 40 Lemons Rough 40
Apples 50 Apples Honeycrisp 50
Oranges 20 Oranges Navel 20
Bananas 60 Bananas Lady Finger 60
Lemons 40 Lemons Eureka 40
Apples 50 Apples Honeycrisp 50
Oranges 20 Oranges Navel 20
Bananas 60 Bananas Cavendish 60
Lemons 40 Lemons Eureka 40

Fruit SUMIF Fruit Type SUMIFS


Apples Oranges Florida

IF and IFS functions, in that they only have a criteria range, and criteria. They don't evalute
EXPERTone range,
TIP then
Each one of the Frui
drop-down list wher
different fruits. Try it
formulas automatic

PivotTable article for more information.


Fruit Amount Fruit Type Amount
Apples 50 Apples Fuji 50
Oranges 20 Oranges Florida 20
Bananas 60 Bananas Cavendish 60
Lemons 40 Lemons Rough 40
Apples 50 Apples Honeycrisp 50
Oranges 20 Oranges Navel 20
Bananas 60 Bananas Lady Finger 60
Lemons 40 Lemons Eureka 40
Apples 50 Apples Honeycrisp 50
Oranges 20 Oranges Navel 20
Bananas 60 Bananas Cavendish 60
Lemons 40 Lemons Eureka 40

Fruit COUNTIF Fruit Type COUNTIFS


Apples 3 Oranges Florida 1

Fruit Type Amount


Apples Fuji 50
Oranges Florida 20
Bananas Cavendish 60
Lemons Rough 40
Apples Honeycrisp 50
Oranges Navel 20
Bananas Lady Finger 60
Lemons Eureka 40
Apples Honeycrisp 50
Oranges Navel 20
Bananas Cavendish 60
Lemons Eureka 40

Fruit Type Try it


Lemons Eureka 80

Item Amount
Bread 50
Donuts 100
Cookies 40
Cakes 50
Pies 20
200
n look in another to summarize.
it and Type cells has a
re you can select
t, and watch the
cally update.
GOOD TO KNOW
Double-click this cell and you'll see that the formula is
different. Specifically, the sum criteria is ">=50" which
means greater than or equal to 50. There are other
operators you can use like "<=50" which is less than or
equal to 50. And there's "<>50" which is not equals 50.
Let
Let the Function
If you know the n
Select cell D10,
Next, enterIf the
you k
CHECK THIS the
use
GOOD TO KNOW
GOOD TO 1
Previous
Next
More information
Overview of form
2 (
Excel functions
Excel functions (a
Free Excel trainin

Mo
the Function Wizard guide you
Wizard guide you
name of the function you want, but you're not sure how to build it, you can use the Function Wizard to help yo

know the name of the function you want, but you're not sure how to build it, you can
e Function Wizard to help you out.
W You can type cell and range references, or select them with your mouse.
Select cell D10, then go to Formulas > Insert Function > type VLOOKUP in
the Search for a function box, and press GO. When you see VLOOKUP
highlighted click OK at the bottom When you select a function in the list

n on the web
mulas in Excel
Next, enter the function arguments in their respective text boxes. As you enter
(byeach
category)
one, Excel will evaluate it, and show you its result, with the final result at the
(alphabetical)
bottom. Press OK when you're done, and Excel will enter the formula for you.
ng online

suoiverP Next

re information on the web


Overview of formulas in Excel

Excel functions (by category)

Excel functions (alphabetical)

Free Excel training online


g
ou out.

Fruit Amount
Apples 50
Oranges 20
Bananas 60
Lemons 40

Apples 50

CHECK THIS OUT


You should end up with =VLOOKUP(C10,
C5:D8,2,FALSE)

GOOD TO KNOW
You can type cell and range references, or select them with
your mouse.

GOOD TO KNOW
As you enter each argument's section, the argument's description
will be displayed toward the bottom of the form, above the Formula
result.
Fixi
Fixing formula er
At some point in
Error checking - G
At som
If you click Help o
with #E
Each time you cli
working
EXPERIMENT Wh
can hel
GOOD TO
Previous
1
Next
More information
Detect errors in fo
How to avoid bro
Evaluate a nested
Free Excel trainin

3
Mo
ng formula errors
rrors
time, you'll run across a formula that has an error, which Excel will display with #ErrorName. Errors can be he
Go to Formulas > Error Checking. This will load a dialog that will tell you the general cause for your specific er
me point in time, you'll run across a formula that has an error, which Excel will display
on this Error, a help topic specific to the error message will open. If you click Show Calculation Steps, an Evalu
ErrorName. Errors can be helpful, because they point out when something's not
ick Evaluate, Excel will step through the formula one section at a time. It won't necessarily tell you why an erro
g right, but they can be challenging to fix. Fortunately, there are several options that
hat' s wrong
lp you track here?
down Hint: We're trying
the source of theto SUM
error, upfix
and allit.
the items.

Error checking - Go to Formulas > Error Checking. This will load a dialog that will
tell you the general cause for your specific error. In cell D9, the #N/A error is
n oncaused
the web because there is no value matching "Apple". You can fix this by using a
formulas
oken formulas
ed formula one step at a time
ng online

If you click Help on this Error, a help topic specific to the error message will open.
If you click Show Calculation Steps, an Evaluate Formula dialog will load.

Each time you click Evaluate, Excel will step through the formula one section at a
time. It won't necessarily tell you why an error occurs, but it will point out where.
From there, look at the help topic to deduce what went wrong with your formula.
suoiverP Next

re information on the web


Detect errors in formulas

How to avoid broken formulas

Evaluate a nested formula one step at a time

Free Excel training online


elpful, because they point out when something's not working right, but they can be challenging to fix.
Fruit Amount
Apples 50
Oranges 20
Bananas 60
Lemons 40

Apple #N/A

GOOD TO KNOW
Clicking Options will let you set the rules
for when errors in Excel are displayed or
ignored.

Fruit Amount
Apples 50
Oranges 20
Bananas 60
Lemons 40

Total #NAME?

EXPERIMENT
What's wrong here? Hint: We're trying to SUM up all the
items.
. Fortunately, there are several options that can help you track down the source of the error, and fix it.
More quest
Press ALT+
Keep going
LinkedIn Le
Community
What else
Give us feed
tions about Excel?

More questions about Excel?


+Q and type what you want to know.
. There is more to learn with Excel:
earning: Video courses for all levels—from beginner to advanced. Take at your own pace.
y: Ask questions and connect with other Excel fans.

dback on this tour


Click the Tell Me button and type what you
want to know.

Keep going. There is more to learn with Excel:

LinkedIn Communit What else is


Learning y new?
Video courses for Ask questions Office 365
all levels—from and connect subscribers get
beginner to with other continual
advanced. Take at d d
Learn Learn Learn
more more more

Give us feedback on this tour

You might also like