excel formulas1
TRANSCRIPT
-
8/3/2019 Excel Formulas1
1/41
SUM
What Does It Do ?
Horizontal This function creates a total from a list o
100 200 300 =SUM(B5:D5) It can be used either horizontally or verti
The numbers can be in single cells, rang
Vertical
100 Syntax
200 =SUM(Range1,Range2,Range3... throug
300
=SUM(B8:B10) Formatting
No special formatting is needed.
100 300 =SUM(B14,C15,D14) Note
200 Many people use the =SUM() function in
This example shows how the SUM has b
100 400 The formula is actually doing more work
200 500 It should have been entered as either =
3000 600
=SUM(B18:B20,D18:D20) 100
200
300
100 400 600 =SUM(I21+I22+I23)
200 500 =SUM(I21:I23)
300 600 =I21+I22+I23
=SUM(AVERAGE(B24:B26),MAX(D24:D26))
Single Cells
Multiple Ranges
Functions
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
2/41
f numbers.
ically.
es are from other functions.
h to Range30).
correctly.
en combined with plus + symbols.
than needed.
48+C49+C50 or =SUM(C48:C50).
Wrong!
Correct
Correct
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
3/41
AUTOSUM
Instead of using the AutoSum button from the toolbar, you can press Alt and = to achieve the same result.
Try it here :
Move to a blank cell in the Total row or column, then pressAlt and =.
or
Select a row, column or all cells and then pressAlt and =.
Jan Feb Mar Total
North 10 50 90
South 20 60 100
East 30 70 200
West 40 80 300
Total
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
4/41
SUMIF
Item Date Cost What Does It Do ?
Brakes 1-Jan-98 80 This function adds the valu
Tyres 10-May-98 25
Brakes 1-Feb-98 80 Syntax
Service 1-Mar-98 150 =SUMIF(RangeOfThingsTo
Service 5-Jan-98 300
Window 1-Jun-98 50 =SUMIF(B5:B13,"Brakes",
Tyres 1-Apr-98 200
Tyres 1-Mar-98 100
Clutch 1-May-98 250
=SUMIF(D5:D13,">=100"
Total cost of all Brakes bought. =SUMIF(B5:B13,"Brakes",D5:D13)
Total cost of all Tyres bought. =SUMIF(B5:B13,"Tyres",D5:D13)
Total of items costing 100 or above. =SUMIF(D5:D13,">=100") Formatting
No special formatting is ne
Total of item typed in following cell. tyres =SUMIF(B5:B13,E19,D5:D13)
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
5/41
e of items which match criteria set by the user.
BeExamined,CriteriaToBeMatched,RangeOfValuesToTotal)
D5:D13) Examines the names of products in B5:B13.
Identifies the entries for Brakes.
Totals the respective figures in D5:D13
) Examines the values in D5:D13.
If value is >=100 the value is added to the total.
ded.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
6/41
COUNT
Count What Does It Do ?
10 20 30 3 =COUNT(B5:D5) This function counts the nu
10 0 30 3 =COUNT(B6:D6) It will ignore blanks, text a
10 -20 30 3 =COUNT(B7:D7)
10 1-Jan-88 30 3 =COUNT(B8:D8) Syntax
10 21:30 30 3 =COUNT(B9:D9) =COUNT(Range1,Range2,
10 0.25477289 30 3 =COUNT(B10:D10)
10 30 2 =COUNT(B11:D11) Formatting
10 Hello 30 2 =COUNT(B12:D12) No special formatting is ne
10 #DIV/0! 30 2 =COUNT(B13:D13)
Example
Item Jan Feb Mar The following table was us
Bricks 1,000 for various products in eac
Wood 5,000
Glass 2,000 1,000
Metal 1,000
Count
=COUNT(C16:C19)
Entries To Be Counted
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
7/41
mber of numeric entries in a list.
d errors.
ange3... through to Range30)
ded.
d by a builders merchant to calculate the number of sales
month.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
8/41
COUNTA
Count
10 20 30 =COUNTA(C5:E5) What Does
10 0 30 =COUNTA(C6:E6) This function
10 -20 30 =COUNTA(C7:E7) It will ignore
10 1-Jan-88 30 =COUNTA(C8:E8)
10 21:30 30 =COUNTA(C9:E9) Syntax
10 0.85483382 30 =COUNTA(C10:E10) =COUNTA(R
10 30 =COUNTA(C11:E11)
10 Hello 30 =COUNTA(C12:E12) Formatting
10 #DIV/0! 30 =COUNTA(C13:E13) No special fo
Maths English Art History
Exams Taken By
Each Pupil Example
Alan Fail 1 The following
Bob 2 1 3 Each exam p
Carol 1 1 1 A failure was
David Fail Fail
Elaine 1 3 2 Fail The school n
=COUNTA(C21:F21) The school al
Maths English Art History The =COUNT
=COUNTA(C17:C21)
Entries To Be Counted
How many pupils sat each Exam.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
9/41
It Do ?
counts the number of numeric or text entries in a list.
blanks.
nge1,Range2,Range3... through to Range30)
matting is needed.
table was used by a school to keep track of the examinations taken by each pupil.
ssed was graded as 1, 2 or 3.
entered as Fail.
eded to known how many pupils sat each exam.
so needed to know how many exams were taken by each pupil.
A() function has been used because of its ability to count text and numeric entries.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
10/41
COUNTBLANK
Range To Test Blanks What Does It Do ?
1 =COUNTBLANK(B5:B12) This function counts the nu
Hello
3 Syntax
0 =COUNTBLANK(RangeToT
1-Jan-98 Formatting
No special formatting is ne
5
Admin Accounts Production Personnel Example
Factory 1 Y N The following table was us
Factory 2 Y Y N the company should have
Factory 3 Each of the departments in
Factory 4 N N N The response to the questi
Factory 5 Y Y As the results of the vote
Factory 6 Y Y Y N The =COUNTBLANK() func
Factory 7 N Y have no yet registered a vo
Factory 8 N N Y Y
Factory 9 Y
Factory 10 Y N Y
=COUNTBLANK(C16:F25)Votes not yet registered :
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
11/41
mber of blank cells in a range.
st)
ded.
d by a company which was balloting its workers on whether
no smoking policy.
the various factories were questioned.
on could be Y or N.
ere collated they were entered in to the table.
ion has been used to calculate the number of departments which
te.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
12/41
COUNTIF
Item Date Cost What Does It Do ?
Brakes 1-Jan-98 80 This function counts the n
Tyres 10-May-98 25
Brakes 1-Feb-98 80 Syntax
Service 1-Mar-98 150 =COUNTIF(RangeOfThings
Service 5-Jan-98 300 The criteria can be typed i
Window 1-Jun-98 50 To match a specific numbe
Tyres 1-Apr-98 200 To match a piece of text ty
Tyres 1-Mar-98 100 To match using operators
Clutch 1-May-98 250
Formatting
=COUNTIF(B5:B13,"Brakes") No special formatting is ne
=COUNTIF(B5:B13,"Tyres")
=COUNTIF(D5:D13,">=100")
service =COUNTIF(B5:B13,E19)
How many Brake Shoes Have been bought.
How many Tyres have been bought.
How many items cost 100 or above.
Type the name of the item to count.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
13/41
mber of items which match criteria set by the user.
ToBeCounted,CriteriaToBeMatched)
any of the following ways.
r type the number, such as =COUNTIF(A1:A5,100)
pe the text in quotes, such as =COUNTIF(A1:A5,"Hello")
urround the expression with quotes, such as =COUNTIF(A1:A5,">100")
ded.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
14/41
Excel Function Dictionary
1998 - 2000 Peter Noneley
12
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
A B C D E F G H I J K L
AVERAGE
Mon Tue Wed Thu Fri Sat Sun Average
Temp 30 31 32 29 26 28 27 =AVERAGE(C5:I5)
Rain 0 0 0 4 6 3 1 =AVERAGE(C6:I6)
Mon Tue Wed Thu Fri Sat Sun Average
Temp 30 32 29 26 28 27 =AVERAGE(C9:I9)
Rain 0 0 4 6 3 1 =AVERAGE(C10:I10)
Mon Tue Wed Thu Fri Sat Sun Average
Temp 30 No 32 29 26 28 27 =AVERAGE(C13:I13)
Rain 0 Reading 0 4 6 3 1 =AVERAGE(C14:I14)
Mon Tue Wed Thu Fri Sat Sun Average
Temp 30 No 32 29 26 28 27 =SUM(C18:I18)/COUN
Rain 0 Reading 0 4 6 3 1 =SUM(C19:I19)/COUN
-
8/3/2019 Excel Formulas1
15/41
MAX
Values Maximum What Does It Do ?
120 800 100 120 250 =MAX(B5:F5) This function picks the hig
Dates Maximum Syntax
1-Jan-98 25-Dec-98 31-Mar-98 27-Dec-98 4-Jul-98 =MAX(B8:F8) =MAX(Range1,Range2,Ra
Formatting
No special formatting is ne
Sales Jan Feb Mar Region Max Example
North 5,000 6,000 4,500 =MAX(C14:E14) In the following example t
South 5,800 7,000 3,000 each region, month and ov
East 3,500 2,000 10,000
West 12,000 4,000 6,000
Month Max
=MAX(E14:E17)
Overall Max
=MAX(C14:E17)
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
16/41
est value from a list of data.
ge3... through to Range30)
ded.
e =MAX() function has been used to find the highest value for
erall.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
17/41
MIN
Values Minimum What Does It Do ?
120 800 100 120 250 =MIN(B5:F5) This function picks the low
Dates Maximum Syntax
1-Jan-98 25-Dec-98 31-Mar-98 27-Dec-98 4-Jul-98 =MIN(B8:F8) =MIN(Range1,Range2,Ran
Formatting
No special formatting is ne
Sales Jan Feb Mar Region Min Example
North 5,000 6,000 4,500 =MIN(C14:E14) In the following example t
South 5,800 7,000 3,000 each region, month and ov
East 3,500 2,000 10,000
West 12,000 4,000 6,000
Month MIN
=MIN(E14:E17)
Overall MIN
=MIN(C14:E17)
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
18/41
st value from a list of data.
ge3... through to Range30)
ded.
e =MIN() function has been used to find the lowest value for
erall.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
19/41
OR
Order No. Cost Payment TypeHandling
ChargeWhat Does It Do?
AB001 1000 Cash =IF(OR(D5="Visa",D5="Delta"),5,0) This function tests two or
AB002 1000 Visa =IF(OR(D6="Visa",D6="Delta"),5,0) It can be used to test that
AB003 2000 Cheque =IF(OR(D7="Visa",D7="Delta"),5,0) Normally the OR() function
AB004 5000 Delta =IF(OR(D8="Visa",D8="Delta"),5,0)
Syntax
=OR(Test1,Test2)
Note that there can be up
Formatting
When used by itself it will
Order No. Cost Payment Type HandlingCharge
Example
AB001 1000 Cash =IF(OR(D17="Visa",D17="Delta"),5,0) The following table shows
AB002 1000 Visa A handling charge of 5 is
AB003 2000 Cheque The =OR() function has be
AB004 5000 Delta
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
20/41
ore conditions to see if any of them are true.
at least one of a series of numbers meets certain conditions.
would be used in conjunction with a function such as =IF().
to 30 possible tests.
how TRUE or FALSE.
list of orders taken by a company.
made on all orders paid by Visa or Delta cards.
en used to determine whether the charge needs to be applied.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
21/41
AND
Result What Does It Do?
500 800 =AND(B5>=100,C5>=100) This function tests two or more conditio
500 25 =AND(B6>=100,C6>=100) It can be used to test that a series of nu
25 500 =AND(B7>=100,C7>=100) It can be used to test that a number or
12 =AND(C8>=1,C8=AVERAGE($C$18:$C$27),D27>=AVERAGE($D$18:$
Averages
Items To Test
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
22/41
s to see if they are all true.
mbers meet certain conditions.
date falls between an upper and lower limit.
ed in conjunction with a function such as =IF().
tests.
FALSE.
amination results.
scored above average in all three exams.
est that each score is above the average.
ho have scored above average in all three exams.
D$27),E27>=AVERAGE($E$18:$E$27))
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
23/41
IF
Name Sales Target Result What Does
Alan 1000 5000 Not Achieved =IF(C5>=D5,"Achieved","Not Achieved") This function
Bob 6000 5000 Achieved =IF(C6>=D6,"Achieved","Not Achieved") If the conditi
Carol 2000 4000 Not Achieved =IF(C7>=D7,"Achieved","Not Achieved") If the conditi
Depending u
Syntax
=IF(Conditio
The Conditio
The ActionIfT
Formatting
No special fo
Example 1
Name Sales Target Result The following
Alan 1000 5000 =IF(C20>=D20,"Achieved","Not Achieved") Each has thei
Bob 6000 5000 =IF(C21>=D21,"Achieved","Not Achieved") The =IF() fu
Carol 2000 4000 =IF(C22>=D22,"Achieved","Not Achieved") If the Sales a
If the Sales d
Note that the
Example 2
Name Sales Target Commission The following
Alan 1000 5000 =IF(C28>=D28,C28*10%,C28*5%) This time the
Bob 6000 5000 =IF(C29>=D29,C29*10%,C29*5%) If the Sales a
Carol 2000 4000 100 =IF(C30>=D30,C30*10%,C30*5%) If the Sales d
Example 3
Special Order This example
Offer Value Discount Total A builders me
Wood Yes 2,000 The discount
Glass No 2,000 is 1000 or a
Cement Yes 500 The =AND()
Turf Yes 3,000 the value of t
=IF(AND(C38="Yes",D38>=1000),D38*10%,0)
Product
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
24/41
t Do?
tests a condition.
n is met it is considered to be TRUE.
n is not met it is considered as FALSE.
on the result, one of two actions will be carried out.
n,ActionIfTrue,ActionIfFalse)
is usually a test of two cells, such as A1=A2.
rue and ActionIfFalse can be numbers, text or calculations.
matting is required.
table shows the Sales figures and Targets for sales reps.
r own target which they must reach.
ction is used to compare the Sales with the Target.
re greater than or equal to the Target the result of Achieved is shown.
o not reach the target the result of Not Achieved is shown.
text used in the =IF() function needs to be placed in double quotes "Achieved".
table is similar to that in Example 1.
Commission to be paid to the sales rep is calculated.
re greater than or equal to the Target, the Commission is 10% of Sales.
o not reach Target, the Commission is only 5% of Sales.
uses the =AND() within the =IF() function.
rchant gives 10% discount on certain product lines.
is only given on products which are on Special Offer, when the Order Value
bove.
unction is used with the =IF() to check that the product is on offer and that
he order is above 1000.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
25/41
VLOOKUP
The column numbers are not needed. What Does It Do ?
they are part of the illustration. This function scans down t
col 1 col 2 col 3 col 4 col 5 col 6 When the item is found, it
Jan 10 20 30 40 50
Feb 80 90 100 110 120 Syntax
Mar 97 69 45 51 77 =VLOOKUP(ItemToFind,Ra
The ItemToFind is a single
The RangeToLookIn is the
Feb The ColumnToPickFrom is
4 The Sorted/Unsorted is wh
Formatting
=VLOOKUP(F12,B7:G9,F13,FALSE) No special formatting is ne
Jan Feb Mar Example 1
Bob 10 80 97 This table is used to find a
Eric 20 90 69
Alan 30 100 45
Carol 40 110 51
David 50 120 77
Alan
3
=VLOOKUP(F25,$C$19:$F$23,F26,FALSE)
The result is :
Type a month to look for :
Which row needs to be picked out :
Type a month to look for :
Which column needs to be picked out :
The result is :
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
26/41
Student Average Grade Points Grade Example 2
A 50 45 F Use the Points and Grade
B 61.75 50 F
C 67.25 55 D
D 59.75 60 C
E 64.75 65 B
F 73.25 70 A
=VLOOKUP(C37,$F$32:$G$38,2,TRUE) 75 A+
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
27/41
e row headings at the side of a table to find a specified item.
hen scans across to pick a cell entry.
ngeToLookIn,ColumnToPickFrom,SortedOrUnsorted)
item specified by the user.
range of data with the row headings at the left hand side.
ow far across the table the function should look to pick from.
ether the column headings are sorted. TRUE for yes, FALSE for no.
ded.
value based on a specified individual and column.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
28/41
able to Lookup the respective grades for each student
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
29/41
HLOOKUP
Jan Feb Mar row 1 The row numbers are not needed. What Does
10 80 97 row 2 they are part of the illustration. This function
20 90 69 row 3 When the ite
30 100 45 row 4
40 110 51 row 5 Syntax
50 120 77 row 6 =HLOOKUP(I
The ItemToFi
Feb The RangeTo
4 The RowToPi
The Sorted/U
=HLOOKUP(F11,D4:F9,F12,FALSE)
Formatting
No special fo
Jan Feb Mar Example 1
Bob 10 80 97 This table is
Eric 20 90 69
Alan 30 100 45
Carol 40 110 51
David 50 120 77
Mar
4
The result is :
Which row needs to be picked out :
Type a month to look for :
Which row needs to be picked out :
The result is :
Type a month to look for :
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
30/41
=HLOOKUP(F25,$D$18:$F$23,F26,FALSE)
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
31/41
It Do ?
scans across the column headings at the top of a table to find a specified item.
is found, it then scans down the column to pick a cell entry.
temToFind,RangeToLookIn,RowToPickFrom,SortedOrUnsorted)
nd is a single item specified by the user.
LookIn is the range of data with the column headings at the top.
ckFrom is how far down the column the function should look to pick from.
nsorted is whether the column headings are sorted. TRUE for yes, FALSE for no.
matting is needed.
sed to find a value based on a specified month and row.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
32/41
LEFT
Text
Number Of
Characters
Required
Left String What Does It Do ?
Alan Jones 1 =LEFT(B5,C5) This function displays a specified numbe
Alan Jones 2 =LEFT(B6,C6) piece of text.
Alan Jones 3 =LEFT(B7,C7)
Cardiff 6 =LEFT(B8,C8) Syntax
ABC123 4 =LEFT(B9,C9) =LEFT(OriginalText,NumberOfCharacter
Formatting
No special formatting is needed.
Full Name First Name Example
Alan Jones =LEFT(B15,FIND(" ",B15)-1) The following table was used to extract tBob Smith =LEFT(B16,FIND(" ",B16)-1) The =FIND() function was used to locat
Carol Williams =LEFT(B17,FIND(" ",B17)-1) The length of the first name is therefore
The =LEFT() function can now extract t
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
33/41
of characters from the left hand side of a
Required)
he first name of a person from their full name.position of the space between the first and second name.
the position of the space minus one character.
e first name based on the position of the space.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
34/41
RIGHT
Original
Text
Number Of
Characters
Required
Right
String
Alan Jones 1 =RIGHT(B5,C5) What Does It Do ?
Alan Jones 2 =RIGHT(B6,C6) This function displays a specified numbe
Alan Jones 3 =RIGHT(B7,C7) piece of text.
Cardiff 6 =RIGHT(B8,C8)
ABC123 4 =RIGHT(B9,C9) Syntax
=RIGHT(OriginalText,NumberOfCharacte
Formatting
No special formatting is needed.
Full Name Second Name ExampleAlan Jones =RIGHT(B16,LEN(B16)-FIND(" ",B16)) The following table was used to extract t
Bob Smith =RIGHT(B17,LEN(B17)-FIND(" ",B17)) The =FIND() function locates the positio
Carol Williams =RIGHT(B18,LEN(B18)-FIND(" ",B18)) The length of the second name is calcula
the overall length of the full name.
The =RIGHT() function can then extract
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
35/41
of characters from the right hand side of a
rsRequired)
he second name of a person from their full name.
n of the space between the first and second name.
ted by subtracting the position of the space from
the second name.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
36/41
UPPER
Original Text Upper Case What Does It Do ?
alan jones =UPPER(B5) This function converts all characters in a
bob smith =UPPER(B6)
carOl wiLLiamS =UPPER(B7) Syntax
cardiff =UPPER(B8) =UPPER(TextToConvert)
abc123 =UPPER(B9)
Formatting
No special formatting is needed.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
37/41
piece of text to upper case.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
38/41
LOWER
Upper Case Text Lower Case What Does It Do ?
ALAN JONES =LOWER(B5) This function converts all characters in a piece of text
BOB SMITH =LOWER(B6)
CAROL WILLIAMS =LOWER(B7) Syntax
CARDIFF =LOWER(B8) =LOWER(TextToConvert)
ABC123 =LOWER(B9)
Formatting
No special formatting is needed.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
39/41
o lower case.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
40/41
PROPER
Original Text Proper What Does It Do ?
alan jones =PROPER(B5) This function converts the first letter of each word to
bob smith =PROPER(B6) are converted to lower case.
caRol wILLIAMS =PROPER(B7)
cardiff =PROPER(B8) Syntax
ABC123 =PROPER(B9) =PROPER(TextToConvert)
Formatting
No special formatting is needed.
Excel Training 14th September 2005 Rohan Fernandes
-
8/3/2019 Excel Formulas1
41/41
ppercase, and all subsequent letters