Excel Tutorial
Excel Tutorial
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.
Let's go >
Go back to top by pressing CTRL+HOME. To start the tour, press CTRL+PAGE DOWN.
Formulas can
contain cell
Previous
Next
More information on the web
More about formulas, cells, and ranges
Use Excel as a calculator
Overview of formulas in Excel
Excel is made up of individual cells that are grouped into rows and columns. Rows
are numbered, and columns are lettered. There are over 1 million rows and 16,000
columns, and you can put formulas in any of them.
Excel is made up of individual cells that are grouped into rows and columns. Rows
Excel functions (by category)
are numbered, and columns are lettered. There are over 1 million rows and 16,000
columns,
Excel functions and you can put formulas in any of them.
(alphabetical)
Free Excel training online
Formulas can contain cell references, ranges of cell references, operators, and
constants. The following are all examples of formulas:
=A1+B1
=10*20
=SUM(A1:A10)
You'll notice that in our third example above, we used the SUM function. A function is
a pre-built command that takes a value or values, calculates them in a certain way,
and returns a result. For instance, the SUM function takes the cell references or
ranges you specify, and totals them. In this example it takes the cells A1 through A10,
and totals them. Excel has over 400 functions, which you can explore on the Formulas
tab.
Formulas with functions start with an equals sign, then the function name follows
with its arguments (the values a function uses to calculate) wrapped in parentheses.
You confirm a formula by pressing Enter. Once you do that the formula will calculate,
and the result will be displayed in the cell. To see the formula itself, you can look at
the formula bar beneath the Ribbon, or press F2 to enter Edit mode, where you'll see
the formula in the cell. Press Enter again to finalize the formula and calculate the
result.
Previous
ll notice that in To
ourMultiply, select
third example cell F5,
above, we type
used =C3*C4, then press
the SUM function. Enter. is a pre-built command that takes a value or values, calcula
A function
3 in our third example above, we used the SUM function. A function is a pre-built command that takes a value or values, calcula
ll notice that
mulas with functions start with an equals sign, then the function name follows with its arguments (the values a function uses to calculate) w
mulas with functions start with an equals sign, then the function name follows with its arguments (the values a function uses to calculate) w
To Divide, select cell F6, type =C3/C4, then press Enter.
4
confirm a formula by pressing Enter. Once you do that the formula will calculate, and the result will be displayed in the cell. To see the form
confirm a formula by pressing Enter. Once you do that the formula will calculate, and the result will be displayed in the cell. To see the form
me formula explanations
*20 is a formula, where 10 and 20 are constants, and the * sign is the operator.
M(A1:A10) is a formula, where
Dive down SUM
for is the
more function name, the opening and closing parentheses
detail Next contain
step the formula arguments, and A1:A1
M(A1:A10,C1:C10) is a formula, where SUM is the function name, the opening and closing parentheses contain the formula arguments, an
1 Addition (+) 3
2 Subtraction (-) -1
Multiplication (*) 2
that takes a value or values, calculates them in a certain way, and returns a result. For instance, the SUM function takes the cell references
that takes a value or values, calculates them in a certain way, and returns a result. For instance, the SUM function takes the cell references
isplayed in the cell. To see the formula itself, you can look at the formula bar beneath the Ribbon, or press F2 to enter Edit mode, where yo
isplayed in the cell. To see the formula itself, you can look at the formula bar beneath the Ribbon, or press F2 to enter Edit mode, where yo
the formula arguments, and A1:A10 is the cell range for the function.
contain the formula arguments, and A1:A10,C1:C10 are the cell ranges for the function separated by a comma.
GOOD TO KNOW
Constants are values that you enter in cells or
While =10*20 might calculate the same as =A1
aren't a good practice. Why? Because you can
constant without selecting the cell and looking
GOOD TO KNOW
Constants are values that you enter in cells or
Operator Operator While =10*20 might calculate the same as =A1
aren't a good practice. Why? Because you can
=A1+B1
Cell
Cell
=10*20 constant without selecting the cell and looking
can make it hard to change later. It's much eas
constants in cells, where they can be easily ad
referenced in your formulas.
referenc Constant Constant
reference
e
For example: Select the yellow cell with 12 be
we used the SUM function with a range of cel
type in "4" or "8" directly into the formula.
Function Argument
=SUM(A1:A10)
A range of cells has a starting cell, colon, and an ending
cell. When you select a range of cells for a formula,
Excel will automatically add the colon.
=SUM(A1:A10,C1:C10
) A range of cells Another range of cells
Opening parenthesis Closing parenthesis. Excel will usually add this for
you when you press Enter.
function takes the cell references or ranges you specify, and totals them. In this example it takes the cells A1 through A10, and totals them
function takes the cell references or ranges you specify, and totals them. In this example it takes the cells A1 through A10, and totals them
s F2 to enter Edit mode, where you'll see the formula in the cell. Press Enter again to finalize the formula and calculate the result.
s F2 to enter Edit mode, where you'll see the formula in the cell. Press Enter again to finalize the formula and calculate the result.
O KNOW
re values that you enter in cells or formulas.
20 might calculate the same as =A1+B1, constants
d practice. Why? Because you can't easily see the
hout selecting the cell and looking for it. That
O KNOW
re values that you enter in cells or formulas.
20 might calculate the same as =A1+B1, constants
d practice. Why? Because you can't easily see the
hout selecting the cell and looking for it. That
hard to change later. It's much easier to put your
cells, where they can be easily adjusted, and
n your formulas.
Values
4
8
12
When you start typing a function name after you press =, Excel will launch Intellisense,
which will list all of the functions starting with the letters you type. When you find the
one you want, press Tab, and Excel will automatically finish the function name and enter
the opening parenthesis for you. It will also display the optional and required arguments.
Now let's look at the anatomy of a few functions. The SUM function is structured like
this:
If the SUM function could talk, it would say, "Return the sum of all the values in cells
D38 to D41, and all of column H".
Back to top
en you start typing a function name after you press =, Excel will launch Intellisense, which will list all of the functions starting wit
Introduction to functions
oduction to functions
ctions give you the ability to do a variety of things, like perform mathematical operations, look up values, or even ca
w let's try AutoSum. Select the cell under the column for Meat (cell G7), then go to Formulas > AutoSum > select SUM. You'll see Excel auto
w let's try AutoSum. Select the cell under the column for Meat (cell G7), then go to Formulas > AutoSum > select SUM. You'll see Excel auto
w let's Functions
look at thegive you the
anatomy ofability to do a variety
a few functions. of things,
The SUM like is
function perform mathematical
structured like this:Go to the Formulas tab and browse throu
operations,
e's a neat keyboard look up values,
shortcut. or even
Select cell D15, calculate
then pressdates
Alt =, and
thentimes. Let'sautomatically
Enter. This try a few ways to SUM for you.
enters
RA CREDIT
add up values with the SUM function.
en
the you
down start
for
COUNT typing
more a function
detail
function using any of name after you
the methods press
you've =, Excel
already will
tried. launch
The COUNT Intellisense, whichthe
function counts will list all of
number ofcells
the functions starting
in a range that wit
contain
the COUNT function using any of the methods you've already tried. The COUNT function counts the number of cells in a range that contain
1 Under the Amount column for Fruit (cell D7), enter =SUM(D3:D6), or type
=SUM(, then select that range with the mouse, and press Enter. This will sum
e about functions
e SUM functionthe values
could talk, in cells D3,
it would say,D4, D5,the
return andsumD6.ofYour answer
all the valuesshould
in cellsbe
D38170.
to D41, and all of column H. SUM is the function name
we let's
SUMlook at the
function anatomy
could of a few
talk, it would say,functions.
return theThe
sumSUMof allfunction
the valuesis in
structured like
cells D38 to this:
D41, and all of column H. SUM is the function name
CK THIS OUT2 Now let's try AutoSum. Select the yellow cell under the column for Meat
TODAY
ct thesefunction returns
(cell
cells. Then G7),
in today's
thethen godate.
lower-right It will automatically
to Formulas
corner > AutoSum
of the update
Excel window, when
> select Excel
SUM.
look for recalculates.
SUM: You'll see
170 in theExcel
bottom bar. That's called the Status Bar, and it's
ct these cells. Then in the lower-right
automatically corner
enter the of thefor
formula Excel
you.window, look for
Press Enter toSUM:
confirm170it.
in The
the bottom bar. That's called the Status Bar, and it's
AutoSum feature has all of the most common functions.
e information on the web
bout the3 Here's a neat keyboard shortcut. Select cell D15, then press
SUM function Altthen, =
AutoSum to sum Enter. This automatically enters SUM for you.
numbers
bout the COUNT function
e Excel training online
Dive down for more detail Next step
When you start typing a function name after you press =, Excel will launch Intellisense,
which will list all of the functions starting with the letters you type. When you find the
one you want, press Tab, and Excel will automatically finish the function name and enter
the opening parenthesis for you. It will also display the optional and required arguments.
Now let's look at the anatomy of a few functions. The SUM function is structured like
this:
=SUM(D38:D41,H:H)
If the SUM function could talk, it would say, "Return the sum of all the values in cells
D38 to D41, and all of column H".
=TODAY()
EXTRA CREDIT
Try the COUNT function using any
of the methods you've already
tried. The COUNT function counts
the number of 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
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.
EXTRA CREDIT
Try using
CHECK THIS
MEDIAN or
OUT
MODE here.
AVERAGE function
AVERAGE
Select any
function
range
MEDIAN of gives
Use the AVERAGE
numbers, then function to get the average of numbers in a range of cells.
you the value
Select
look
in Use
cell the AVERAGE function
the D7, then use AutoSum
theinmiddle to get
to add anthe averagefunction.
AVERAGE of numbers in a range of cells.
Status
of
Now Bar for
theselect
data set,
cell G7, and enter an AVERAGE function by typing =AVERAGE(G3:G6).
an instant
D15, 1
while
In cell gives
Average.
MODE you can use either AutoSum, or type to enter another AVERAGE function.
the one that
occurs
Activatethe
the previous sheet
next2sheet
most
Go to the
frequently.
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
the most frequently.
Previous
1 Select cell D7, then use the AutoSum Wizard to add a MIN function.
3 In cell D15, you can use either the AutoSum Wizard, or type to enter a MIN
or MAX function.
Previous Next
(A1:A10,B1:B10), or =MAX(A1:A10,10).
GOOD TO KNOW
You can use either MIN or MAX with multiple
ranges, or 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.
DETAIL
which
If you don't
calculates
want Excel to
someone's
display a
start
negativeand end
times,
number then
subracts
because you the
time
haven't they took
for lunch.your
entered The
*24 at the
birthday end
yet,
of
Date
you
In
the
can
Date functions
formula
functions
cell D28,
converts
IF function
Excel can
enter
use
the
an
like
give you the current date, based on your computer's regional settings. You can also add and subtract Dates.
=NOW(),
fractional
this:
which
portion
Check out will
of give
the TODAY function, which gives you Today's date. These are live, or volatile functions, so when you open your work
=IF(D7="","",D
the current
day that
7-D6), Excel
which
time,
sees and will can give you the current date, based on your computer's regional settings. You
into
Excel
says,
Subtract
update "IF D7 can also
Dates
each add
- Enter and
your subtract
next Dates.
birthday in MM/DD/YY format in cell D7, and watch Excel tell you how many days away it is by
hours.
equals You'll
time Excel
need to format
nothing,
calculates. then
the cell
Add
show Dates as a-IfLet'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
nothing,
you
Numberneed to 1
otherwise
change the
GOOD
though. TOToKNOW
do
show
Time D7 minus
format,
Excel
that, go to dates and times based on the number of days starting from January 1, 1900. Times are kept in fractional portions o
keeps
D6".
you can> go to
Home
Ctrl+1
Format>> Cells
Number
Time
(Ctrl+1) >>
functions
Time
Number > Select
Excel
the can>give
format 2you the current time, based on your computer's regional settings. You can also add and subtract times. For instan
Number > 2you
want.
decimals.
If this formula3could talk, it would say, "Take the Time Out and subtract it from the Time In, then subtract the Lunch Out/In Tim
Previous
Next
More information on the web
All about the TODAY function
All about the NOW function
All about the DATE function
Free Excel training online
Time functions
Excel can give you the current time, based on your computer's regional settings. You
can also add and subtract times. For instance, you might need to keep track of how
many hours an employee worked each week, and calculate their pay and overtime.
3
Previous
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 ou
1 Check out the TODAY function, which gives you Today's date. These are live, or
OD TO KNOW volatile functions, so when you open your workbook tomorrow, it will have
el 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
tomorrow's date. Enter =TODAY() in cell D6.
is formula3couldAdd
talk,Dates - Let's
it would say you
say, "Take the want to know
Time Out what date
and subtract a bill
it from theis Time
due, In,
or then
whensubtract
you the Lunch Out/In Times, then multipl
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
e information oncalculate
the webthe due date from today.
bout the TODAY function
bout the NOW function
bout the DATE function
e Excel training online
Time functions
Excel can give you the current time, based on your computer's regional settings. You
can also add and subtract times. For instance, you might need to keep track of how
many hours an employee worked each week, and calculate their pay and overtime.
1 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.
3 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 - Lunch Out))*24.
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 - Lunch Out))*24.
*24 to convert Excel's
fraction of a day to
Time Out Lunch Out hours
=((D35-D32)-(D34-D33))*24
Time In Lunch In
GOOD TO KNOW
The inner parentheses () make sure Excel calculates those You can use keyboard
parts of the formula by themselves. The outer that won't continuous
parentheses make sure Excel multiplies the final inner result by
24. Date - Ctrl+;
Time - Ctrl+Shift+:
Previous Next
Date functions
Today's date:
Your birthday:
Days until your birthday: 0
IMPORTANT DETAIL
ct times. For instance, you might need to keep track of how many hours anIfemployee
you don't worked eachtoweek,
want Excel and
display calculatenumber,
a negative their pay and overti
because you haven't entered your birthday yet, you can
Grace period days: use an IF function like this: =IF(D7="","",D7-D6), which
says, "IF D7 equals nothing, then show nothing,
Bill due on: 0 otherwise show D7 minus D6".
e Lunch Out/In Times, then multiply those by 24 to convert Excel's fractional time to hours", or =((Time In - Time Out)-(Lunch In - Lunch Ou
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:
GOOD TO KNOW
You can use keyboard shortcuts to enter Dates and Times
that won't continuously change:
Date - Ctrl+;
Time - Ctrl+Shift+:
culate their pay and overtime.
ative number,
hday yet, you can
",D7-D6), which
nothing,
Out)-(Lunch In - Lunch Out))*24.
Joining text from different cells
Joining text from different cells
There are many times in Excel when you want to join text that's in different cells. This example is very common, where you hav
In cell E3, enter =D3&C3 to join the last and first names.
There are many times in Excel when you want to join text that's in different cells. This
SmithNancy doesn't look quite right though. We need to add a comma and a space. To do that we'll use quotes to create a new
example is very common, where you have first and last names, and want to combine
them as first name, last name, or full name. Fortunately, Excel lets us do that with the
To create the full name, we'll join first and last name, but use a space without a comma. In F3, enter =C3&" "&D3.
Ampersand (&) sign, which you can enter with Shift+7.
Dive down for more detail
Next
Using text and numbers together
Now we'll use the & to join text and numbers, not just text and text
1
Look at cells C28:D29. See how the date and times are in separate cells? You can join them together with the & symbol like you
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/2
2 =C29&" "&TEXT(D29,"HH:MM AM/PM"). HH:MM AM/PM is the US format code for Hours:Minutes AM or PM
In cell C37, enter
Look at cells C28:D29. See how the date and times are in separate cells? You can join
them together with the & symbol like you'll see in cells C32:C33, but that doesn't look
right, does it? Unfortunately, Excel doesn't know how you want to format the
numbers, so it breaks them down to their basest format, which is the the Serial date in
this case. We need to explicity tell Excel how to format the number portion of the
formula, so it displays the way you want in the resulting text string. You can do that
Look at cells C28:D29. See how the date and times are in separate cells? You can join
them together with the & symbol like you'll see in cells C32:C33, but that doesn't look
right, does it? Unfortunately, Excel doesn't know how you want to format the
numbers, so it breaks them down to their basest format, which is the the Serial date in
this case. We need to explicity tell Excel how to format the number portion of the
formula, so it displays the way you want in the resulting text string. You can do that
with the TEXT function and a format code.
Previous
ell E3, enter =D3&C3 to join the last and first names.
There are many times in Excel when you want to join text that's in different cells. This
thNancy doesn't look quite right though. We need to add a comma and a space. To do that we'll use quotes to create a new text string. Thi
example is very common, where you have first and last names, and want to combine
them as first name, last name, or full name. Fortunately, Excel lets us do that with the
reate the full name, we'll join first and last name, but use a space without a comma. In F3, enter =C3&" "&D3.
Ampersand (&) sign, which you can enter with Shift+7.
down for more detail
Look at cells C28:D29. See how the date and times are in separate cells? You can join
them together with the & symbol like you'll see in cells C32:C33, but that doesn't look
right, does it? Unfortunately, Excel doesn't know how you want to format the
numbers, so it breaks them down to their basest format, which is the the Serial date in
this case. We need to explicity tell Excel how to format the number portion of the
formula, so it displays the way you want in the resulting text string. You can do that
Look at cells C28:D29. See how the date and times are in separate cells? You can join
them together with the & symbol like you'll see in cells C32:C33, but that doesn't look
right, does it? Unfortunately, Excel doesn't know how you want to format the
numbers, so it breaks them down to their basest format, which is the the Serial date in
this case. We need to explicity tell Excel how to format the number portion of the
formula, so it displays the way you want in the resulting text string. You can do that
with the TEXT function and a format code.
Andy North
Jan Kotas
Mariya Jones
Steven Thorpe
Michael Neipper
Robert Zare
Yvonne McKay
Minutes AM or PM, like 1:30 PM.
t. Then select the Custom option. You can copy the format code that's displayed back to your formula.
WORTH EXPLORING
If you don't know what format code to use, you can use
Ctrl+1 > Number to format any cell the way you want.
Then select the Custom option. You can copy the format
code that's displayed back to your formula.
Copy
anywhere
formula
allow D9
you toto
in incell
return
In
says
D10.cell"If acell
D9
The 0.enterE35
the
D12.
define workbook.
We got
terms
=IF(C9="Apple" or
is Yes,
answer
you then
here
started
values
Try
take in
changing
,TRUE,FALSE).
the a
should
Next,
with
single besum
change
place,
Yes
The
of to
the
FALSE, No
correct in
Quantity
because
the
cell
answer 1.25
=IF(C12<100,"L
and then
E33 to
is inreuse
the
see
column
an orange
formula
ess than in
in the
is
cell
them
the
TRUE.
table calculation
not
F35 toabove,
an
100","Greater
throughout
change.In
In cell
apple. ait
cell
D9toenter
and
Copy multiply
D9
"Shipping".
than or equal As
workbook.
F33,
by we've
=IF(C9="Apple"
1.25, You
D10.
you
to 100").
can seeTheallWhat
start of
entered
,TRUE,FALSE).
otherwise
answer here
typing,
happens
the named Excel's
if you
IF statements
=IF(E33="Yes",
The
return correct
IF
should aain
auto-correct,
enter
ranges be0".
statements
F31*SalesTax,0
answer is this
Next
FALSE,
IF we've
because
statements
should
number find itsetallow you to make logical comparisons between conditions. An IF statement generally says that if one condition i
workbook
), where
TRUE.
added an we by
IFis
an
for orange
you.
greater
going to When
than
up
not SalesTax
statement
an apple. to as
it
100 does,
Formulas press
in cell
acalculate
Named >
Tab
C12?
Name
Range to enter
withit's ait.
shipping
This isof a ifClick
IF statements allow you to make logical comparisons between conditions. An IF
Manager.
value
required. In
Named
here
0.0825. Range,
to learn
Our statement generally says that if one condition is true do something, otherwise do
cell
and F35 you'll
we says DETAIL
more.
formula
IMPORTANT If
see
entered
EXPERT
cell
TRUE E33 and it something
TIP from are unlike
equals
FALSE
else. The formulas can return text, values, or even more calculations.
other words in Excel formulas in that they don't need to be in quotes, and Excel will automatically c
=IF(E35="Yes",
Formulas >
Named
Yes, thenRanges
=IF(C3="Apple","Yes","No")IMPORTANT
SUM(D28:D29) DETAIL
Define
allow
multiply
TRUE Name.
you
and to
cell
FALSE are unlike other words in Excel formulas in that they don't need to be in quotes, and Excel will automatically c
*1.25,0).
Now, ifterms
you This
define
F31 times or
=IF(C3="Apple","Yes","No")
says "If cell E35
ever
values need
SalesTax, in ato
Dive
is Yes, down yourfor more detail
then
changeplace,
single
otherwise
take
Next
shipping
and
return
the sum
thena 0. cost,
reuse 1
of
you theonlyQuantity
have
IF statement with another function
them
column in one
the
to do it in
throughout
Try changing a
table
IF above,
statements
place, andinyou can also force additional calculations to be performed if a certain condition is met. Here we're going to evaluate
workbook.
Yes
and to No
multiply You itcan also force additional calculations to be performed if a certain condition is met. Here we're going to evaluate
IF
canstatements
cell use
see all
E33 the
to see of
by
the
1.25,
Shipping
named
calculation
otherwise
name 2
anywhere
ranges
change. in in
this
return a 0".
the workbook.
workbook by
going to
Formulas >
Name
GOOD
Manager. TO Click
KNOW 3
When you
here to learn create a formula, Excel will automatically place colored borders around any ranges referenced in the formula, and th
When
more. you create a formula, Excel will automatically place colored borders around any ranges referenced in the formula, and th
Previous
Next
More information on the web
All about the IF function
All about the IFS function
Dive down for more detail
Advanced IF statements
Free Excel training online
2
2
Previous
3 Try another example by looking at the formula in cell D12. We got you
OD TO KNOW
en you create a started
formula,with
Excel=IF(C12<100,"Less than
will automatically place 100","Greater
colored thanany
borders around orranges
equalreferenced
to in the formula, and the corresponding
en you create a 100").
formula,What
Excelhappens
will automatically placea colored
if you enter numberborders
greateraround anyequal
than or ranges
toreferenced in the formula, and the corresponding
100 in cell C12?
2
2 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, otherwise return a 0".
3 Next, change the 1.25 in the formula in cell F35 to "Shipping". As you start
typing, Excel's auto-correct, should find it for you. When it does, press Tab
to enter it. This is a Named Range, and we entered it from Formulas >
Define Name. Now, if you ever need to change your shipping cost, you
only have to do it in one place, and you can use the Shipping name
anywhere in the workbook.
Previous Next
Advanced IF statements
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
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 statements
Apple
Orange
he formula, and the corresponding ranges in the formula will be the same color. You can see this if you select cell F33 and press F2 to edit
he formula, and the corresponding ranges in the formula will be the same color. You can see this if you select cell F33 and press F2 to edit
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")
EXPERT TIP
Named Ranges allow you to define terms or values in a
single place, and then reuse them throughout a workbook.
You can see all of the named ranges in this workbook by
going to Formulas > Name Manager. Click here to learn
more.
r even more calculations.
O KNOW
eate a formula, Excel will automatically
d borders around any ranges referenced
a, and the corresponding ranges in the
be the same color. You can see this if you
3 and press F2 to edit the formula.
eate a formula, Excel will automatically
d borders around any ranges referenced
a, and the corresponding ranges in the
be the same color. You can see this if you
3 and press F2 to edit the formula.
IF statement.
exists, but you
In
stillthis
want case,to
we'll
In cellwrap
suppress D22, theour
existing
#N/A
enter error, you
VLOOKUP
can use an
=VLOOKUP(C2
formula
error like
handling
2,C17:D20,2,FA
this
functionin cell
LSE). Thecalled D43:
IFERROR
correct answer in cell
=IF(C43="","",V
G43:
for Apples is
LOOKUP(C43,C
VLOOKUP
=IFERROR(VLO
50. VLOOKUP
VLOOKUP
37:D41,2,FALS
VLOOKUP
OKUP(F43,F37: is one of the most widely used functions in Excel (and one of our favorites too!). VLOOKUP lets you look up a value in
looked
Now tryfor for
E))
G41,2,FALSE),"
Apples, found
yourself in the
").
it,
Meat IFERROR
then went
=VLOOKUP(A1,B:C,2,FALSE)
section,
This
says
over says
if
onethe if cell
in
What
C43 cell G22.
equals
do youVLOOKUP
You is one
want to look of the most widely used functions in Excel (and one of our favorites
for?
VLOOKUP
column
should end to the up VLOOKUP lets you look up a value in a column on the left, then returns
nothing
returns
If you and
right, find too!).
(""),
a validit, how many columns to the right do you want to get a value?
with
then return
result,
returned
Where
=VLOOKUP(F22 then information
the
do you want to look in another
for it? column to the right if it finds a match. VLOOKUP says:
nothing,
display
amount. that,
,F17:G20,2,FAL
otherwise
Do you want an exact, or approximate match?
otherwise,
SE). the
return
display nothing
VLOOKUP's
(""). We
results.
EXPERIMENT
displayed Note
the second
Try selecting
nothing here different items from the drop down lists. You'll see the result cells instantly update themselves with new values.
closing
(""), but youfor more detail
Dive down
parenthesis
can also useat
Next
the
numbersend of(0,1, the
formula.
VLOOKUP
2, etc.), orThis
and
text,#N/A
Invariably,
closes you'll run into a situation where VLOOKUP can't find what you asked it to, and it returns an error (#N/A). Sometimes
such asthe IF
statement.
"Formula isn't
IMPORTANT DETAIL
correct".
IFERROR is what's known as a blanket error handler, meaning it will suppress any error your formula might throw. This can caus
A rule of thumb is to not add error handlers to your formulas until you're absolutely certain they work properly.
Previous
Next
More information on the web
All about the VLOOKUP function
1
All about the INDEX/MATCH functions
All about the IFERROR function
Use PivotTables to analyze worksheet data
2 online
Free Excel training
1
2
Previous
OOKUP(A1,B:C,2,FALSE)
VLOOKUP
at do you is one
want to look of the most widely used functions in Excel (and one of our favorites
for?
u find it, how many columns you
too!). VLOOKUP lets look
to the updoa you
right value in atocolumn
want on the left, then returns
get a value?
ere do information in another
you want to look for it? column to the right if it finds a match. VLOOKUP says:
you want an exact, or approximate What match?do you If you find it, how many
want to look columns to the right do
ERIMENT for? you want to get a value?
selecting different items from the drop down lists. You'll see the result cells instantly update themselves with new values.
down for more detail
OKUP
riably, and =VLOOKUP(A1,B:C,2,FALSE)
#N/A
you'll run into a situation where VLOOKUP can't find what you asked it to, and it returns an error (#N/A). Sometimes, it's because the
ORTANT DETAIL
ROR is what's known as a blanket error handler,
Wheremeaning
do it will Do
suppress any error your formula might throw. This can cause problems if Ex
you want
youformulas
le of thumb is to not add error handlers to your want to until you're
an exact, or
absolutely certain they work properly.
look for it? approximate
match?
1 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(C43="","",VLOOKUP(C43,C37:D41,2,FALSE))
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(C43="","",VLOOKUP(C43,C37:D41,2,FALSE))
This says, "If cell C43 equals nothing (""), then return nothing, otherwise
return the VLOOKUP's results". Note the second closing parenthesis at the
end of the formula. This closes the IF statement.
2 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 returns a valid result, then display that, otherwise, display
nothing ("")". We displayed nothing here (""), but you can also use numbers
(0,1, 2, etc.), or text, such as "Formula isn't correct".
Previous Next
#N/A). Sometimes, it's because the lookup value simply doesn't exist, or it can because the reference cell doesn't have a value yet.
Apples Pork
EXPERIMENT
Try selecting different items from the drop down lists. You'll see
the result cells instantly update themselves with new values.
M function in cell D42 could talk, it would say this: Sum up the values in cells D38, D39, D40, and D41.
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.
=SUMIFS(H3:H14,F3:F14,F17,G3:G14,G17)
Dive down for more detail
Next
SUMIF with a value argument
Here's an example of the SUMIF function using greater than (>) to find all values greater than a given amount:
200
Sum up some values based on this criterion:
....Look through these cells...
....Look through these cells...
...and if the value is greater than 50, sum it up.
...and if the value is greater than 50, sum it up.
NOTE: If you find you are making a lot of conditional formulas, you might find that a PivotTable is a better solution. See this Piv
More information on the web
Dive down for more detail
All about the SUMIF function
All about the SUMIFS function
All about the COUNTIF function
All about the COUNTIFS function
Conditional functions - COUNTIF
All about the AVERAGEIF function
All about the AVERAGEIFS function
All about the MINIFS function
COUNTIF and COUNTIFS let you count values in a range based on a criteria you
All about the MAXIFS function
specify. They're a bit different from the other IF and IFS functions, in that they only
Create a drop-down list
Free Excel have a criteria
training online range, and criteria. They don't evalute one range, then look in another
Back to topto summarize.
Next
1
=COUNTIFS(F50:F61,F64,G50:G61,G64)
SUMIF =SUMIF(C92:C103,C106,E92:E103)
SUMIFS =SUMIFS(E92:E103,C92:C103,C106,D92:D103,D106)
AVERAGEIF =AVERAGEIF(C92:C103,C106,E92:E103)
AVERAGEIFS =AVERAGEIFS(E92:E103,C92:C103,C106,D92:D92,D106)
COUNTIF =COUNTIF(C92:C103,C106)
COUNTIFS =COUNTIFS(C92:C103,C106,D92:D103,D106)
MAXIFS =MAXIFS(E92:E103,C92:C103,C106,D92:D103,D106)
MINIFS =MINIFS(E92:E103,C92:C103,C106,D92:D103,D106)
Sum up some
values based
on this
criterion:
=SUMIF(D118:D122,">=50")
NOTE: If you find you are making a lot of conditional formulas, you might find that a
PivotTable is a better solution. See this PivotTable article for more information.
Back to top
Conditional functions - SUMIF
ditional functions - SUMIF
ditional functions let you sum, average, count or get the min or max of a range based on a given condition, or criteria
MIF lets you sum in one range based on a specifc criteria you look for in another range, like how many Apples you hav
Conditional functions let you sum, average, count or get the min or max of a range
MIF(C3:C14,C17,D3:D4)
based on a given condition, or criteria you specify. Such as, out of all the fruits in the
at range
MIFS is thedosame
you want to look
as SUMIF, butat?
it lets you use multiple criteria. So in this example, you can look for Fruit and Type, instead of just by Fruit. S
MIFS is list,
the how many
same as are but
SUMIF, apples?
it letsOr, how
use many oranges
criteria.are thethis
Florida type?
at value (text or number) do you wantyou
to look multiple
for? So in example, you can look for Fruit and Type, instead of just by Fruit. S
MIFS 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. S
eachismatch
MIFS the samefound, what range
as SUMIF, but itdolets
youyou
want
usetomultiple
sum in?criteria. So in this example, you can look for Fruit and Type, instead of just by Fruit. S
1 SUMIF lets you sum in one range based on a specifc criteria you look for in
another range, like how many Apples you have. Select cell D17 and type
MIFS(H3:H14,F3:F14,F17,G3:G14,G17)
at range do you =SUMIF(C3:C14,C17,D3:D14).
want to sum? SUMIF is structured like this:
is the first range to look in for matches
What range do you For each match found, what
is the criteria for the first match
want to look at? range do you want to sum?
=SUMIF(C3:C14,C17,D3:D4)
down for more detail
e conditional functions
=SUMIFS(H3:H14,F3:F14,F17,G3:G14,G17)
down for more detail
Next
first range to second range
look in for to look in for
matches matches
E: If you find you are making a lot of conditional formulas, you might find that a PivotTable is a better solution. See this PivotTable article fo
e information on the web
Dive down for more detail Next
bout the SUMIF function
bout the SUMIFS function
bout the COUNTIF function
bout the COUNTIFS function
Conditional functions - COUNTIF
bout the AVERAGEIF function
bout the AVERAGEIFS function
bout the MINIFS function
COUNTIF and COUNTIFS let you count values in a range based on a criteria you
bout the MAXIFS function
specify. They're a bit different from the other IF and IFS functions, in that they only
ate a drop-down list
e Excel have a criteria
training online range, and criteria. They don't evalute one range, then look in another
to summarize.
=COUNTIF(C50:C61,C64)
2 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:
This is the first This is the second
range to count range to count
=COUNTIFS(F50:F61,F64,G50:G61,G64)
SUMIF =SUMIF(C92:C103,C106,E92:E103)
SUMIFS =SUMIFS(E92:E103,C92:C103,C106,D92:D103,D106)
AVERAGEIF =AVERAGEIF(C92:C103,C106,E92:E103)
AVERAGEIFS =AVERAGEIFS(E92:E103,C92:C103,C106,D92:D92,D106)
COUNTIF =COUNTIF(C92:C103,C106)
COUNTIFS =COUNTIFS(C92:C103,C106,D92:D103,D106)
MAXIFS =MAXIFS(E92:E103,C92:C103,C106,D92:D103,D106)
MINIFS =MINIFS(E92:E103,C92:C103,C106,D92:D103,D106)
=SUMIF(D118:D122,">=50")
NOTE: If you find you are making a lot of conditional formulas, you might find that a
PivotTable is a better solution. See this PivotTable article for more information.
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
t from the other IF and IFS functions, in that they only have a criteria range, and criteria. They don't evalute one
EXPERT TIP range, then look in anothe
Each one of the Fruit and Type cells has
a drop-down list where you can select
different fruits. Try it, and watch the
formulas automatically update.
lution. See this PivotTable article for more information.
Item Amount
Bread 50
Donuts 100
Cookies 40
Cakes 50
Pies 20
200
Pange, then look in another to summarize.
Fruit and Type cells has
where you can select
Try it, and watch the
atically 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.
the bottom. As
the
you Search for a
enter each
function
section, the box,
and press
criteria forGO.
When you see
each argument
VLOOKUP
is listed at the
highlighted,
bottom of the
GOOD
click OKTOat the
form.
KNOW Press OK
bottom.
when When
you're
As
you you enter
select a
done, and Excel
Let the Function Wizard guide you
each
function
Let the in the Wizard guide you
Function
will enter the
argument's
list, Excel
formula will
for the name of the function you want, but you're not sure how to build it, you can use the Function Wizard to help yo
If you know
section,
CHECK
display the
THIS
its
you.
argument's
OUT
syntax.
description
You should end will
be
up displayed
with
toward theIf you know the name of the function you want, but you're not sure how to build it,
=VLOOKUP(C10
bottom of you
,C5:D8,2,FALSE)the can use the Function Wizard to help you out.
form, above
GOOD TO KNOW
the Formula
result. type 1
You can cell and range references, or select them with your mouse.
Previous
Next
More information on the web
Overview of formulas in Excel
2 (by category)
Excel functions
Excel functions (alphabetical)
Free Excel training online
Previous
If you know the name of the function you want, but you're not sure how to build it,
you can use the Function Wizard to help you out.
OD TO KNOW
can type 1 Select
cell and range cell D10, then
references, go to
or select Formulas
them with your>mouse.
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, Excel will display its syntax.
e information on the web
rview of formulas in Excel
2 (by category)
l functions Next, enter the function arguments in their respective text boxes. As you
enter each one, Excel will evaluate it, and show you its result, with the final
l functions (alphabetical)
result at the bottom. Press OK when you're done, and Excel will enter the
Excel training online
formula for you.
GOOD TO KNOW
As you enter each argument's section, the arg
toward the bottom of the form, above the Fo
Previous Next
Fruit Amount
Apples 50
Oranges 20
Bananas 60
Lemons 40
Apples 50
GOOD TO KNOW
You can type cell and range references, or select them
with your mouse.
TO KNOW
er each argument's section, the argument's description will be displayed
bottom of the form, above the Formula result.
Fixing
At some Fixing formula errors
formula errors
point in time, you'll run across a formula that has an error, which Excel will display with #ErrorName. Errors can be hel
Error checking - Go to Formulas > Error Checking. This will load a dialog that will tell you the general cause for your specific erro
GOOD TO At some point in time, you'll run across a formula that has an error, which Excel will
If you clickdisplay
KNOW Help onwith #ErrorName.
this Error, Errors
a help topic can be
specific helpful,
to the error because theyopen.
message will pointIf out
you when
click Show Calculation Steps, an Evalua
Clicking something's not working right, but they can be challenging to fix. Fortunately, there
Options will let
you
Eachset theare
time you several options
click Evaluate, thatwill
Excel can help
step you track
through down the
the formula onesource
sectionof
at the error,
a time. and fix
It won't it.
necessarily tell you why an erro
rules for when
errors in Excel
EXPERIMENT
are displayed
What's wrong here? Hint: We're trying to SUM up all the items.
or ignored.
Previous
Next 1
More 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
3
3
Previous
r 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
At some point in time, you'll run across a formula that has an error, which Excel will
u clickdisplay
Help onwith #ErrorName.
this Error, Errors
a help topic can be
specific helpful,
to the error because theyopen.
message will pointIf out
you when
click Show Calculation Steps, an Evaluate Formula dialo
something's not working right, but they can be challenging to fix. Fortunately, there
time are
you several options
click Evaluate, thatwill
Excel can help
step you track
through down the
the formula onesource
sectionof
at the error,
a time. and fix
It won't it.
necessarily tell you why an error occurs, but it w
ERIMENT
t's wrong here? Hint: We're trying to SUM up all the items.
1 Error checking - Go to Formulas > Error Checking. This will load a dialog
e information on that
thewill
webtell you the general cause for your specific error. In cell D9, the
#N/A error is caused because there is no value matching "Apple". You can
ct errors in formulas
to avoid broken fixformulas
this by using a value that does exist, suppress the error with IFERROR, or
ignore
uate a nested formula one it and
stepknow it will go away when you do use a value that exists.
at a time
Excel training online
2 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.
3 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.
3 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.
Previous Next
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.
EXPERIMENT
What's wrong here? Hint: We're trying to SUM
up all the items.
ng to fix. Fortunately, there are several options that can help you track down the source of the error, and fix it.
More questions about Excel?
Press ALT+Q and type what you want to know.
Keep going. There is more to learn with Excel:
LinkedIn Learning: Video courses for all levels—from beginner to advanced. Take at your own pace.
Community: Ask questions and connect with other Excel fans.
What else is new?Office 365 subscribers get continual updates and new features.
Give us feedback on this tour
More questions about Excel?
Press ALT+Q and type what you want to know.
More questions about Excel?
Keep going. There is more to learn with Excel:
LinkedIn Learning: Video courses for all levels—from beginner to advanced. Take at your own pace.
Community: Ask questions and connect with other Excel fans.
Give us feedbac
ow.
Learn more