47 Excel Formulas
47 Excel Formulas
47 Excel Formulas
Split ForenameSurname
Page 1 of 139
D
First Name
Alan
Bob
Carol
=LEFT(C14,FIND(" ",C14,1))
=LEFT(C15,FIND(" ",C15,1))
=LEFT(C16,FIND(" ",C16,1))
Last Name
Jones
Smith
Williams
=RIGHT(C22,LEN(C22)-FIND(" ",C22))
=RIGHT(C23,LEN(C23)-FIND(" ",C23))
=RIGHT(C24,LEN(C24)-FIND(" ",C24))
Last Name
Jones
Smith
Williams
=RIGHT(C37,LEN(C37)-FIND("#",SUBSTITUTE(C37," ","#",LEN(C37)-LEN(SUBSTITUTE(C37," ","")))))
Middle Name
David
John
Susan
=LEFT(RIGHT(C45,LEN(C45)-FIND(" ",C45,1)),FIND(" ",RIGHT(C45,LEN(C45)-FIND(" ",C45,1)),1))
Percentages
Page 2 of 139
D
Percentages
There are no specific functions for calculating percentages.
You have to use the skills you were taught in your maths class at school!
Finding a percentage of a value
Initial value
% to find
Percentage value
120
25%
30 =D8*D9
Example 1
A company is about to give its staff a pay rise.
The wages department need to calculate the increases.
Staff on different grades get different pay rises.
Grade
A
B
C
% Rise
10%
15%
20%
Name
Alan
Bob
Carol
David
Elaine
Frank
Grade
A
B
C
B
C
A
Old Salary
Increase
10,000
1,000
20,000
3,000
30,000
6,000
25,000
3,750
32,000
6,400
12,000
1,200
=E23*LOOKUP(D23,$C$18:$C$20,$D$18:$D$20)
=E24*LOOKUP(D24,$C$18:$C$20,$D$18:$D$20)
=E25*LOOKUP(D25,$C$18:$C$20,$D$18:$D$20)
=E26*LOOKUP(D26,$C$18:$C$20,$D$18:$D$20)
=E27*LOOKUP(D27,$C$18:$C$20,$D$18:$D$20)
=E28*LOOKUP(D28,$C$18:$C$20,$D$18:$D$20)
120
25%
150 =D33*D34+D33
Example 2
A company is about to give its staff a pay rise.
The wages department need to calculate the new salary including the % increase.
Staff on different grades get different pay rises.
Grade
A
B
C
% Rise
10%
15%
20%
Name
Alan
Bob
Carol
David
Elaine
Frank
Grade
A
B
C
B
C
A
Old Salary
Increase
10,000
11,000
20,000
23,000
30,000
36,000
25,000
28,750
32,000
38,400
12,000
13,200
=E48*LOOKUP(D48,$C$18:$C$20,$D$18:$D$20)+E48
=E49*LOOKUP(D49,$C$18:$C$20,$D$18:$D$20)+E49
=E50*LOOKUP(D50,$C$18:$C$20,$D$18:$D$20)+E50
=E51*LOOKUP(D51,$C$18:$C$20,$D$18:$D$20)+E51
=E52*LOOKUP(D52,$C$18:$C$20,$D$18:$D$20)+E52
=E53*LOOKUP(D53,$C$18:$C$20,$D$18:$D$20)+E53
C
Value A
Value B
A as % of B
Percentages
Page 3 of 139
D
E
120
60
50% =D59/D58
Q3
2,000
4,000
8,000
9,000
23,000
Q4
9,000
9,000
7,000
6,000
31,000
Q3
13,500
13,500
10,500
9,000
46,500
7,000
5,000
3,000
5,000
20,000
Q4
7%
5%
3%
5%
20%
Total
100,000
=G74/$H$78
=G75/$H$78
=G76/$H$78
=G77/$H$78
=G78/$H$78
Q4
10,500 =G82*$E$88
7,500 =G83*$E$88
4,500 =G84*$E$88
7,500
Total
30,000 150,000
150
25%
120 =D100/(100%+D101)
Example 4
An employ has to submit an expenses claim for travelling and accommodation.
The claim needs to show the VAT tax portion of each receipt.
Unfortunately the receipts held by the employee only show the total amount.
The employee needs to split this total to show the original value and the VAT amount.
VAT rate
Receipt
Petrol
Hotel
Petrol
17.50%
Total
Actual Value Vat Value
10.00
8.51
1.49 =D113-D113/(100%+$D$110)
235.00
200.00
35.00
117.50
100.00
17.50
Percentages
Page 4 of 139
D
E
F
=D115/(100%+$D$110)
20
40
60
80
30
70
60
30
SUM_using_names
Page 6 of 139
D
North
South
East
West
Total
Jan
45
30
35
20
Feb
50
25
10
50
Mar
50
35
50
5
Instant Charts
Page 7 of 139
D
Instant Charts
You can create a chart quickly without having to use the chart button on
the toolbar by pressing the function key F11 while inside a range of data.
North
South
East
West
Jan
45
30
35
20
Feb
50
25
10
50
Mar
50
35
50
5
Brackets in formula
Page 8 of 139
Brackets in formula
Sometimes you will need to use brackets, (also known as 'braces'), in formula.
This is to ensure that the calculations are performed in the order that you need.
The need for brackets occurs when you mix plus or minus with divide or multiply.
Mathematically speaking the * and / are more important than + and - .
The * and / operations will be calculated before
+ and - .
Age Calculation
Page 9 of 139
C
Age Calculation
You can calculate a persons age based on their birthday and todays date.
The calculation uses the DATEDIF() function.
The DATEDIF() is not documented in Excel 5, 7 or 97, but it is in 2000.
(Makes you wonder what else Microsoft forgot to tell us!)
Birth date :
Years lived :
and the months :
and the days :
1-Jan-60
55
8
9
=DATEDIF(C8,TODAY(),"y")
=DATEDIF(C8,TODAY(),"ym")
=DATEDIF(C8,TODAY(),"md")
You can put this all together in one calculation, which creates a text version.
Age is 55 Years, 8 Months and 9 Days
="Age is "&DATEDIF(C8,TODAY(),"y")&" Years, "&DATEDIF(C8,TODAY(),"ym")&" Months and "&DATEDIF(C8,TODAY(),"md")&" Days"
1-Jan-60
55.69 =(TODAY()-C23)/365.25
North
South
East
West
Total
Jan
10
20
30
40
Feb
50
60
70
80
Mar
90
100
200
300
Total
ABS
Page 11 of 139
Number
10
-10
1.25
-1.25
Absolute Value
10
10
1.25
1.25
ABS
=ABS(C4)
=ABS(C5)
=ABS(C6)
=ABS(C7)
What Does it Do ?
This function calculates the value of a number, irrespective of whether it is positive or negative.
Syntax
=ABS(CellAddress or Number)
Formatting
The result will be shown as a number, no special formatting is needed.
Example
The following table was used by a company testing a machine which cuts timber.
The machine needs to cut timber to an exact length.
Three pieces of timber were cut and then measured.
In calculating the difference between the Required Length and the Actual Length it does
not matter if the wood was cut too long or short, the measurement needs to be expressed as
an absolute value.
Table 1 shows the original calculations.
The Difference for Test 3 is shown as negative, which has a knock on effect
when the Error Percentage is calculated.
Whether the wood was too long or short, the percentage should still be expressed
as an absolute value.
Table 1
Test
Cut
Test 1
Test 2
Test 3
Required
Length
120
120
120
Actual
Length
120
90
150
Difference
0
30
-30
=D36-E36
Error
Percentage
0%
25%
-25%
Table 2 shows the same data but using the =ABS() function to correct the calculations.
Table 2
Test
Cut
Test 1
Test 2
Test 3
Required
Length
120
120
120
Actual
Length
120
90
150
Error
Percentage
0
0%
30
25%
30
25%
=ABS(D45-E45)
Difference
ADDRESS
Page 12 of 139
ADDRESS
Type a column number :
Type a row number :
Type a sheet name :
2
3
Hello
$B$3
B$3
$B3
B3
=ADDRESS(F4,F3,1,TRUE)
=ADDRESS(F4,F3,2,TRUE)
=ADDRESS(F4,F3,3,TRUE)
=ADDRESS(F4,F3,4,TRUE)
R3C2
R3C[2]
R[3]C2
R[3]C[2]
=ADDRESS(F4,F3,1,FALSE)
=ADDRESS(F4,F3,2,FALSE)
=ADDRESS(F4,F3,3,FALSE)
=ADDRESS(F4,F3,4,FALSE)
Hello.$B$3
Hello.B$3
Hello.$B3
Hello.B3
=ADDRESS(F4,F3,1,TRUE,F5)
=ADDRESS(F4,F3,2,TRUE,F5)
=ADDRESS(F4,F3,3,TRUE,F5)
=ADDRESS(F4,F3,4,TRUE,F5)
What Does It Do ?
This function creates a cell reference as a piece of text, based on a row and column
numbers given by the user.
This type of function is used in macros rather than on the actual worksheet.
Syntax
=ADDRESS(RowNumber,ColNumber,Absolute,A1orR1C1,SheetName)
The RowNumber is the normal row number from 1 to 16384.
The ColNumber is from 1 to 256, cols A to IV.
The Absolute can be 1,2,3 or 4.
When 1 the reference will be in the form $A$1, column and row absolute.
When 2 the reference will be in the form A$1, only the row absolute.
When 3 the reference will be in the form $A1, only the column absolute.
When 4 the reference will be in the form A1, neither col or row absolute.
The A1orR1C1 is either TRUE of FALSE.
When TRUE the reference will be in the form A1, the normal style for cell addresses.
When FALSE the reference will be in the form R1C1, the alternative style of cell address.
The SheetName is a piece of text to be used as the worksheet name in the reference.
The SheetName does not actually have to exist.
AND
Page 13 of 139
D
AND
Items To Test
500
800
500
25
25
500
12
Result
1
0
0
1
=AND(C4>=100,D4>=100)
=AND(C5>=100,D5>=100)
=AND(C6>=100,D6>=100)
=AND(D7>=1,D7<=52)
Maths
80
50
60
90
20
40
10
80
30
10
English
75
30
70
85
30
60
90
70
10
20
Physics
85
40
50
95
Absent
80
80
60
20
30
Passed
1
0
0
1
0
0
0
1
0
0
=AND(C38>=AVERAGE($C$29:$C$38),D38>=AVERAGE($D$29:$D$38),E38>=AVERAGE($E$29:$E$38))
Averages
47
54
60
AVERAGE
Page 14 of 139
Temp
Rain
Mon
30
0
Tue
31
0
Mon
30
0
Tue
Temp
Rain
Temp
Rain
Mon
Tue
Wed Thu Fri Sat Sun Average
30
No
32 29 26 28 27 28.6667 =AVERAGE(D12:J12)
0 Reading
0
4 6 3
1 2.33333 =AVERAGE(D13:J13)
AVERAGE
What Does It Do ?
This function calculates the average from a list of numbers.
If the cell is blank or contains text, the cell will not be used in the average calculation.
If the cell contains zero 0, the cell will be included in the average calculation.
Syntax
=AVERAGE(Range1,Range2,Range3... through to Range30)
Formatting
No special formatting is needed.
Note
To calculate the average of cells which contain text or blanks use =SUM() to get the total and
then divide by the count of the entries using =COUNTA().
Temp
Rain
Mon
Tue
Wed Thu Fri Sat Sun Average
30
No
32 29 26 28 27 24.5714 =SUM(D31:J31)/COUNTA(D31:J31)
0 Reading
0
4 6 3
1
2
=SUM(D32:J32)/COUNTA(D32:J32)
Temp
Rain
Mon
30
0
Further Usage
Tue
CEILING
Page 15 of 139
Number
2.1
1.5
1.9
20
25
40
Raised Up
3
2
2
30
30
60
CEILING
=CEILING(C4,1)
=CEILING(C5,1)
=CEILING(C6,1)
=CEILING(C7,30)
=CEILING(C8,30)
=CEILING(C9,30)
What Does It Do ?
This function rounds a number up to the nearest multiple specified by the user.
Syntax
=CEILING(ValueToRound,MultipleToRoundUpTo)
The ValueToRound can be a cell address or a calculation.
Formatting
No special formatting is needed.
Example 1
The following table was used by a estate agent renting holiday apartments.
The properties being rented are only available on a weekly basis.
When the customer supplies the number of days required in the property the =CEILING()
function rounds it up by a multiple of 7 to calculate the number of full weeks to be billed.
Days Required
Customer 1
3
Customer 2
4
Customer 3
10
Days To
Be Billed
7
7
14
=CEILING(D28,7)
=CEILING(D29,7)
=CEILING(D30,7)
Example 2
The following table was used by a builders merchant delivering products to a construction site.
The merchant needs to hire trucks to move each product.
Each product needs a particular type of truck of a fixed capacity.
Table 1 calculates the number of trucks required by dividing the Units To Be Moved by
the Capacity of the truck.
This results of the division are not whole numbers, and the builder cannot hire just part
of a truck.
Table 1
Item
Bricks
Wood
Cement
Units To
Be Moved
1000
5000
2000
Truck
Capacity
300
600
350
Trucks
Needed
3.33
8.33
5.71
=D45/E45
=D46/E46
=D47/E47
Table 2 shows how the =CEILING() function has been used to round up the result of
the division to a whole number, and thus given the exact amount of trucks needed.
Table 2
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
C
Item
Bricks
Wood
Cement
CEILING
Page 16 of 139
D
Units To
Be Moved
1000
5000
2000
E
Truck
Capacity
300
600
350
F
Trucks
Needed
4
9
6
=CEILING(D54/E54,1)
=CEILING(D55/E55,1)
=CEILING(D56/E56,1)
Example 3
The following tables were used by a shopkeeper to calculate the selling price of an item.
The shopkeeper buys products by the box.
The cost of the item is calculated by dividing the Box Cost by the Box Quantity.
The shopkeeper always wants the price to end in 99 pence.
Table 1 shows how just a normal division results in varying Item Costs.
Table 1
Item
Plugs
Sockets
Junctions
Adapters
Box Qnty
11
7
5
16
Box Cost
20
18.25
28.10
28
=D69/C69
=D70/C70
=D71/C71
=D72/C72
Table 2 shows how the =CEILING() function has been used to raise the Item Cost to
always end in 99 pence.
Table 2
Item
Plugs
Sockets
Junctions
Adapters
In Box
11
7
5
16
Explanation
=INT(E83)
=MOD(E83,1)
=CEILING(MOD(E83),0.99)
Box Cost
20
18.25
28.10
28
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
CELL
Page 17 of 139
CELL
This is the cell and contents to test.
The cell address.
The column number.
The row number.
The actual contents of the cell.
The type of entry in the cell.
Shown as b for blank, l for text, v for value.
The alignment of the cell.
Shown as ' for left, ^ for centre, " for right.
Nothing is shown for numeric entries.
The width of the cell.
The number format fo the cell.
(See the table shown below)
17.50%
$D$3
4
3
0.175
=CELL("address",D3)
=CELL("col",D3)
=CELL("row",D3)
=CELL("contents",D3)
=CELL("type",D3)
=CELL("prefix",D3)
12
=CELL("width",D3)
P2
=CELL("format",D3)
0
=CELL("parentheses",D3)
Formatted for braces ( ) on positive values.
1 for yes, 0 for no.
Formatted for coloured negatives.
0
=CELL("color",D3)
1 for yes, 0 for no.
The type of cell protection.
1
=CELL("protect",D3)
1 for a locked, 0 for unlocked.
The filename containing the cell. 'file:///var/www/apps/conversion/tmp/scratch_1/284940313.xls'#$CELL
=CELL("filename",D3)
What Does It Do ?
This function examines a cell and displays information about the contents, position and formatting.
Syntax
=CELL("TypeOfInfoRequired",CellToTest)
The TypeOfInfoRequired is a text entry which must be surrounded with quotes " ".
Formatting
No special formatting is needed.
Codes used to show the formatting of the cell.
Numeric Format
General
0
#,##0
0.00
#,##0.00
$#,##0_);($#,##0)
$#,##0_);[Red]($#,##0)
$#,##0.00_);($#,##0.00)
$#,##0.00_);[Red]($#,##0.00)
0%
0.00%
0.00E+00
# ?/? or # ??/??
m/d/yy or m/d/yy h:mm or mm/dd/yy.
d-mmm-yy or dd-mmm-yy
d-mmm or dd-mmm
mmm-yy
mm/dd
h:mm AM/PM
h:mm:ss AM/PM
h:mm
h:mm:ss
Code
G
F0
,0
F2
,2
C0
C0C2
C2P0
P2
S2
G
D4
D1
D2
D3
D5
D7
D6
D9
D8
Example
The following example uses the =CELL() function as part of a formula which extracts the filename.
The name of the current file is : #VALUE!
=MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)
CHOOSE
Page 18 of 139
Index
Value
1
3
2
3
1
2
Result
Alan
Carol
Bob
18%
10%
15%
CHOOSE
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
=CHOOSE(C4,"Alan","Bob","Carol")
=CHOOSE(C5,"Alan","Bob","Carol")
=CHOOSE(C6,"Alan","Bob","Carol")
=CHOOSE(C7,10%,15%,18%)
=CHOOSE(C8,10%,15%,18%)
=CHOOSE(C9,10%,15%,18%)
Time
1:30
1:15
2:45
1:05
1:20
Position
Medal
2
Silver
=IF(D30<=3,CHOOSE(D30,"Gold","Silver","Bronze"),"unplaced")
4
unplaced =IF(D31<=3,CHOOSE(D31,"Gold","Silver","Bronze"),"unplaced")
1
Gold
=IF(D32<=3,CHOOSE(D32,"Gold","Silver","Bronze"),"unplaced")
5
unplaced =IF(D33<=3,CHOOSE(D33,"Gold","Silver","Bronze"),"unplaced")
3
Bronze =IF(D34<=3,CHOOSE(D34,"Gold","Silver","Bronze"),"unplaced")
=RANK(C34,C30:C34)
CLEAN
Page 19 of 139
Dirty Text
Hello
Hello
Hello
Clean Text
Hello
Hello
Hello
CLEAN
=CLEAN(C4)
=CLEAN(C5)
=CLEAN(C6)
COMBIN
Page 20 of 139
C
Pool Of Items
4
4
26
Items In A Group
2
3
2
Possible Groups
6
4
325
COMBIN
=COMBIN(C4,D4)
=COMBIN(C5,D5)
=COMBIN(C6,D6)
What Does It Do ?
This function calculates the highest number of combinations available based upon
a fixed number of items.
The internal order of the combination does not matter, so AB is the same as BA.
Syntax
=COMBIN(HowManyItems,GroupSize)
Formatting
No special formatting is required.
Example 1
This example calculates the possible number of pairs of letters available
from the four characters ABCD.
Total Characters
4
Group Size
2
The proof !
Combinations
6
=COMBIN(C25,D25)
ABCD
AB
AC
AD
BC
BD
CD
Example 2
A decorator is asked to design a colour scheme for a new office.
The decorator is given five colours to work with, but can only use three in any scheme.
How many colours schemes can be created ?
Available Colours Colours Per Scheme Totals Schemes
5
3
10
=COMBIN(C41,D41)
The colours
Red
Green
Blue
Yellow
Black
Scheme 1
Red
Green
Blue
Scheme 2
Red
Green
Yellow
Scheme 3
Red
Green
Black
Scheme 4
Red
Blue
Yellow
Scheme 5
Red
Blue
Black
Scheme 6
Green
Scheme 7
Green
Scheme 8
Green
Scheme 9
Blue
Scheme 10
??????
COMBIN
Page 21 of 139
C
Blue
Yellow
D
Blue
Black
E
Yellow
Black
F
Yellow
Black
CONCATENATE
Page 22 of 139
D
Name 2
Jones
Williams
Davies
Jones
Williams
Davies
Concatenated Text
AlanJones
BobWilliams
CarolDavies
Alan Jones
Williams, Bob
Davies, Carol
CONCATENATE
Name 1
Alan
Bob
Carol
Alan
Bob
Carol
=CONCATENATE(C4,D4)
=CONCATENATE(C5,D5)
=CONCATENATE(C6,D6)
=CONCATENATE(C7," ",D7)
=CONCATENATE(D8,", ",C8)
=CONCATENATE(D9,", ",C9)
Name 2
Jones
Williams
Davies
Jones
Williams
Davies
Concatenated Text
AlanJones
BobWilliams
CarolDavies
Alan Jones
Williams, Bob
Davies, Carol
=C25&D25
=C26&D26
=C27&D27
=C28&" "&D28
=D29&", "&C29
=D30&", "&C30
CONVERT
Page 23 of 139
C
Amount
To Convert
1
1
1
Converting
From
in
ft
yd
Converting
To
cm
m
m
1
1
1.5
0.5
yr
day
hr
mn
day
hr
mn
sec
CONVERT
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Converted
Amount
2.54
=CONVERT(C4,D4,E4)
0.3048 =CONVERT(C5,D5,E5)
0.9144 =CONVERT(C6,D6,E6)
365.25
24
90
30
=CONVERT(C8,D8,E8)
=CONVERT(C9,D9,E9)
=CONVERT(C10,D10,E10)
=CONVERT(C11,D11,E11)
What Does It Do ?
This function converts a value measure in one type of unit, to the same value expressed
in a different type of unit, such as Inches to Centimetres.
Syntax
=CONVERT(AmountToConvert,UnitToConvertFrom,UnitToConvertTo)
Formatting
No special formatting is needed.
Example
The following table was used by an Import / Exporting company to convert the weight
and size of packages from old style UK measuring system to European system.
Weight
Height
Length
Width
Pounds
Ounces
Kilograms
5
3
2.35301
=CONVERT(D28,"lbm","kg")+CONVERT(E28,"ozm","kg")
Feet
12
8
5
Inches
Metres
6
3.81
3
2.5146
2
1.5748
=CONVERT(D34,"ft","m")+CONVERT(E34,"in","m")
Abbreviations
This is a list of all the possible abbreviations which can be used to denote measuring systems.
Weight & Mass
Gram
Kilogram
Slug
Pound mass
U (atomic mass)
Ounce mass
g
kg
sg
lbm
u
ozm
Time
Year
Day
Hour
Minute
Second
yr
day
hr
mn
sec
Distance
Meter
Statute mile
Nautical mile
Inch
Foot
Yard
Angstrom
Pica (1/72 in.)
m
mi
Nmi
in
ft
yd
ang
Pica
Pressure
Pascal
Atmosphere
mm of Mercury
Pa
atm
mmHg
CONVERT
Page 24 of 139
Temperature
Degree Celsius
Degree Fahrenhei
Degree Kelvin
C
F
K
Force
Newton
Dyne
Pound force
Energy
Joule
Erg
Thermodynamic
calorie
IT calorie
Electron volt
Horsepower-hour
Watt-hour
Foot-pound
BTU
N
dyn
lbf
Liquid
Teaspoon
Tablespoon
Fluid ounce
Cup
Pint
Quart
Gallon
Liter
tsp
tbs
oz
cup
pt
qt
gal
l
J
e
Power
Horsepower
Watt
HP
W
Magnetism
Tesla
Gauss
T
ga
c
cal
eV
HPh
Wh
flb
BTU
Multiplier Abbreviation
1.00E+18
E
1.00E+15
P
1.00E+12
T
1.00E+09
G
1.00E+06
M
1.00E+03
k
1.00E+02
h
1.00E+01
e
Prefix
deci
centi
milli
micro
nano
pico
femto
atto
Multiplier
1.00E-01
1.00E-02
1.00E-03
1.00E-06
1.00E-09
1.00E-12
1.00E-15
1.00E-18
Abbreviation
d
c
m
u
n
p
f
a
CORREL
Page 25 of 139
D
CORREL
2
3
Table 1
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Month
Jan
Feb
Mar
Apr
May
Jun
Avg Temp
20
30
30
40
50
50
Table 2
Air Cond
Sales
100
200
300
200
400
400
Correlation 0.864
=CORREL(D5:D10,E5:E10)
Advertising
Costs
2,000
1,000
5,000
1,000
8,000
1,000
Sales
20,000
30,000
20,000
40,000
40,000
20,000
Correlation
28%
=CORREL(G5:G10,H5:H10)
What Does It Do ?
This function examines two sets of data to determine the degree of relationship
between the two sets.
The result will be a decimal between 0 and 1.
The larger the result, the greater the correlation.
In Table 1 the Monthly temperature is compared against the Sales of air conditioning units.
The correlation shows that there is an 0.864 realtionship between the data.
In Table 2 the Cost of advertising has been compared to Sales.
It can be formatted as percentage % to show a more meaning full result.
The correlation shows that there is an 28% realtionship between the data.
Syntax
=CORREL(Range1,Range2)
Formatting
The result will normally be shown in decimal format.
COUNT
Page 26 of 139
D
COUNT
Entries To Be Counted
10
20
30
10
0
30
10
-20
30
10
1-Jan-88
30
10
21:30
30
10
0.674926
30
10
30
10
Hello
30
10
#DIV/0!
30
Count
3
3
3
3
3
3
2
2
2
=COUNT(C4:E4)
=COUNT(C5:E5)
=COUNT(C6:E6)
=COUNT(C7:E7)
=COUNT(C8:E8)
=COUNT(C9:E9)
=COUNT(C10:E10)
=COUNT(C11:E11)
=COUNT(C12:E12)
What Does It Do ?
This function counts the number of numeric entries in a list.
It will ignore blanks, text and errors.
Syntax
=COUNT(Range1,Range2,Range3... through to Range30)
Formatting
No special formatting is needed.
Example
The following table was used by a builders merchant to calculate the number of sales
for various products in each month.
Item
Jan
Feb
Bricks
1,000
Wood
5,000
Glass
2,000
1,000
Metal
1,000
Count
3
2
=COUNT(D29:D32)
Mar
COUNTA
Entries To Be Counted
10
20
30
10
0
30
10
-20
30
10
1-Jan-88
30
10
21:30
30
10
0.380182
30
10
30
10
Hello
30
10
#DIV/0!
30
Count
3
3
3
3
3
3
2
3
3
=COUNTA(C4:E4)
=COUNTA(C5:E5)
=COUNTA(C6:E6)
=COUNTA(C7:E7)
=COUNTA(C8:E8)
=COUNTA(C9:E9)
=COUNTA(C10:E10)
=COUNTA(C11:E11)
=COUNTA(C12:E12)
What Does It Do ?
This function counts the number of numeric or text entries in a list.
It will ignore blanks.
Syntax
=COUNTA(Range1,Range2,Range3... through to Range30)
Formatting
No special formatting is needed.
Example
The following table was used by a school to keep track of the examinations taken by each pupil.
Each exam passed was graded as 1, 2 or 3.
A failure was entered as Fail.
The school needed to known how many pupils sat each exam.
The school also needed to know how many exams were taken by each pupil.
The =COUNTA() function has been used because of its ability to count text and numeric entries.
34
35
36
37
38
39
40
41
42
43
44
COUNTA
Page 27 of 139
Maths
Alan
Bob
Carol
David
Elaine
Fail
2
Fail
1
English
1
1
3
Art
History
1
3
1
Fail
2
1
Fail
Exams Taken
By Each Pupil
2
3
3
2
4
=COUNTA(D39:G39)
COUNTBLANK
Page 28 of 139
COUNTBLANK
Range To Test
1
Hello
3
0
Blanks
2
=COUNTBLANK(C4:C11)
1-Jan-98
5
What Does It Do ?
This function counts the number of blank cells in a range.
Syntax
=COUNTBLANK(RangeToTest)
Formatting
No special formatting is needed.
Example
The following table was used by a company which was balloting its workers on whether
the company should have a no smoking policy.
Each of the departments in the various factories were questioned.
The response to the question could be Y or N.
As the results of the vote were collated they were entered in to the table.
The =COUNTBLANK() function has been used to calculate the number of departments which
have no yet registered a vote.
Factory 1
Factory 2
Factory 3
Factory 4
Factory 5
Factory 6
Factory 7
Factory 8
Factory 9
Factory 10
Admin
Y
N
Y
Y
Accounts
N
Y
Y
N
N
Production
Personnel
N
Y
Y
Y
Y
Y
N
N
Y
Y
16
=COUNTBLANK(C32:F41)
14
=COUNTIF(C32:F41,"Y")
Votes for No :
10
=COUNTIF(C32:F41,"N")
COUNTIF
Page 29 of 139
Item
Brakes
Tyres
Brakes
Service
Service
Window
Tyres
Tyres
Clutch
Date
1-Jan-98
10-May-98
1-Feb-98
1-Mar-98
5-Jan-98
1-Jun-98
1-Apr-98
1-Mar-98
1-May-98
Cost
80
25
80
150
300
50
200
100
250
COUNTIF
2
3
5
=COUNTIF(C4:C12,"Brakes")
=COUNTIF(C4:C12,"Tyres")
=COUNTIF(E4:E12,">=100")
=COUNTIF(C4:C12,E18)
service
What Does It Do ?
This function counts the number of items which match criteria set by the user.
Syntax
=COUNTIF(RangeOfThingsToBeCounted,CriteriaToBeMatched)
The criteria can be typed in any of the following ways.
To match a specific number type the number, such as =COUNTIF(A1:A5,100)
To match a piece of text type the text in quotes, such as =COUNTIF(A1:A5,"Hello")
To match using operators surround the expression with quotes, such as =COUNTIF(A1:A5,">100")
Formatting
No special formatting is needed.
DATE
Page 30 of 139
E
Year
99
99
99
Date
DATE
Day Month
25
12
25
12
33
12
12/25/99 =DATE(E4,D4,C4)
25-Dec-99 =DATE(E5,D5,C5)
January 2, 2000 =DATE(E6,D6,C6)
DATEDIF
Page 31 of 139
FirstDate
1-Jan-60
1-Jan-60
1-Jan-60
1-Jan-60
1-Jan-60
1-Jan-60
SecondDate
10-May-70
10-May-70
10-May-70
10-May-70
10-May-70
10-May-70
Interval
days
months
years
yeardays
yearmonths
monthdays
Difference
3782
124
10
129
4
9
DATEDIF
=DATEDIF(C4,D4,"d")
=DATEDIF(C5,D5,"m")
=DATEDIF(C6,D6,"y")
=DATEDIF(C7,D7,"yd")
=DATEDIF(C8,D8,"ym")
=DATEDIF(C9,D9,"md")
Birth date :
Years lived :
and the month
and the days :
1-Jan-60
55 =DATEDIF(C8,TODAY(),"y")
8 =DATEDIF(C8,TODAY(),"ym")
9 =DATEDIF(C8,TODAY(),"md")
You can put this all together in one calculation, which creates a text version.
Age is 55 Years, 8 Months and 9 Days
="Age is "&DATEDIF(C8,TODAY(),"y")&" Years, "&DATEDIF(C8,TODAY(),"ym")&" Months and "&DATEDIF(C8,TODAY(),"md")&" Days"
DATEVALUE
Page 32 of 139
Date
25-dec-99
25/12/99
25-dec-99
25/12/99
Date Value
36519
Err:502
36519
Err:502
DATEVALUE
=DATEVALUE(C4)
=DATEVALUE(C5)
=DATEVALUE(C6)
=DATEVALUE(C7)
Property Ref.
BC100
FG700
TD200
HJ900
Days Until
Expiry Date
Expiry
25-dec-99
-5738
10-july/99
Err:502
13-sep-98
-6206
30/5/2000
Err:502
=DATEVALUE(E32)-TODAY()
DAY
Page 33 of 139
Full Date
25-Dec-98
10-Sep-15
10-Sep-15
The Day
25
Tue 9
10
DAY
=DAY(C4)
=DAY(C5)
=DAY(C6)
3/25/1962
Wednesday 24
=DAY(F21)
DAYS360
Page 34 of 139
C
StartDate
1-Jan-98
1-Jan-98
1-Jan-98
1-Jan-98
EndDate
5-Jan-98
1-Feb-98
31-Mar-98
31-Dec-98
DAYS360
Days Between * See the Note below.
4
=DAYS360(C4,D4,TRUE)
30
=DAYS360(C5,D5,TRUE)
89
=DAYS360(C6,D6,TRUE)
359
=DAYS360(C7,D7,TRUE)
DELTA
Page 35 of 139
Number1
10
50
17.5
17.5
17.50%
Hello
Number2
20
50
17.5
18
0.175
Hello
Delta
0
1
1
1
1
#VALUE!
1
DELTA
=DELTA(C4,D4)
=DELTA(C5,D5)
=DELTA(C6,D6)
=DELTA(C7,D7)
=DELTA(C8,D8)
=DELTA(C9,D9)
=DELTA(C10,D10)
What Does It Do ?
This function compares two values and tests whether they are exactly the same.
If the numbers are the same the result will be 1, otherwise the result is 0.
It only works with numbers, text values produce a result of #VALUE.
The formatting of the number is not significant, so numbers which appear rounded due
to the removal of decimal places will still match correctly with non rounded values.
Syntax
=DELTA(FirstNumber,SecondNumber)
Formatting
No special formatting is needed.
Example
The following table is used to determine how may pairs of similar numbers are in a list.
The =DELTA() function tests each pair and then the =SUM() function totals them.
Number1
10
50
30
17.5
12
100
150
Number2
20
50
30
18
8
100
125
Total Pairs
Delta
0
1
1
1
0
1
0
4
=DELTA(C30,D30)
=DELTA(C31,D31)
=DELTA(C32,D32)
=DELTA(C33,D33)
=DELTA(C34,D34)
=DELTA(C35,D35)
=DELTA(C36,D36)
=SUM(E30:E36)
1
2
3
4
5
6
7
8
EAST
Page 36 of 139
A
B
C
D
E
Eastern data.
Used by the example for the =INDIRECT() function.
Alan
Bob
Carol
Total
Jan
1000
4000
7000
12000
Feb
2000
5000
8000
15000
Mar
3000
6000
9000
18000
Total
6000
15000
24000
45000
EDATE
Page 37 of 139
C
Start Date
1-Jan-98
2-Jan-98
2-Jan-98
Plus Months
3
3
-3
End Date
1-Apr-98
2-Apr-98
2-Oct-97
EDATE
=EDATE(C4,D4)
=EDATE(C5,D5)
=EDATE(C6,D6)
Duration
3
3
4
3
3
3
3
End
Mon 06-Apr-98
Sun 12-Apr-98
Sat 09-May-98
Thu 09-Apr-98
Sun 19-Apr-98
Sun 26-Apr-98
Sun 12-Apr-98
=EDATE(C27,D27)
=EDATE(C28,D28)
=EDATE(C29,D29)
=EDATE(C30,D30)
=EDATE(C31,D31)
=EDATE(C32,D32)
=EDATE(C33,D33)
Duration
3
3
4
3
3
3
3
End
Mon 06-Apr-98
Fri 10-Apr-98
Fri 08-May-98
Thu 09-Apr-98
Fri 17-Apr-98
Fri 24-Apr-98
Fri 10-Apr-98
=EDATE(C48,D48)-IF(WEEKDAY(EDATE(C48,D48),2)>5,WEEKDAY(EDATE(C48,D48),2)-5,0)
EOMONTH
Page 38 of 139
StartDate
5-Jan-98
5-Jan-98
5-Jan-98
Plus Months
2
2
-2
End Of Month
35885
31-Mar-98
30-Nov-97
EOMONTH
=EOMONTH(C4,D4)
=EOMONTH(C5,D5)
=EOMONTH(C6,D6)
ERROR.TYPE
Page 39 of 139
0
3
3
13:00
The Error
#DIV/0!
#NAME?
#VALUE!
21:00
Error Type
532
525
519
#N/A
ERROR.TYPE
Data
10
10
10
10:00
=ERROR.TYPE(E4)
=ERROR.TYPE(E5)
=ERROR.TYPE(E6)
=ERROR.TYPE(E7)
EVEN
Page 40 of 139
Original Value
1
1.2
2.3
25
Evenly Rounded
2
2
4
26
EVEN
=EVEN(C4)
=EVEN(C5)
=EVEN(C6)
=EVEN(C7)
What Does It Do ?
This function round a number up the nearest even whole number.
Syntax
=EVEN(Number)
Formatting
No special formatting is needed.
Example
The following table is used by a garage which repairs cars.
The garage is repairing a fleet of cars from three manufactures.
Each manufacturer uses a different type of windscreen wiper which are only supplied in pairs.
Table 1 was used to enter the number of wipers required for each type of car
and then show how many pairs need to be ordered.
Table 1
Car
Vauxhall
Ford
Peugeot
Wipers To Order
5
9
7
Pairs to Order
3
=EVEN(D28)/2
5
=EVEN(D29)/2
4
=EVEN(D30)/2
EXACT
Page 41 of 139
Text1
Hello
Hello
Hello
Text2
Hello
hello
Goodbye
Result
1
0
0
EXACT
=EXACT(C4,D4)
=EXACT(C5,D5)
=EXACT(C6,D6)
red
No
(To stop you from cheating, the correct password has been entered as a series of =CHAR()
functions, which use the ANSI number of the characters rather than the character itself!)
Its still very easy though.
FACT
Page 42 of 139
Number
3
3.5
5
10
20
Factorial
FACT
6
6
120
3,628,800
2,432,902,008,176,640,000
=FACT(C4)
=FACT(C5)
=FACT(C6)
=FACT(C7)
=FACT(C8)
What Does It Do ?
This function calculates the factorial of a number.
The factorial is calculated as 1*2*3*4..etc.
The factorial of 5 is calculated as 1*2*3*4*5, which results in 120.
Decimal fractions of the number are ignored.
Syntax
=FACT(Number)
Formatting.
No special formatting is needed.
FIND
Page 43 of 139
Text
Hello
Hello
Hello
Alan Williams
Alan Williams
Alan Williams
Letter To Find
e
H
o
a
a
T
Position Of Letter
2
1
5
3
11
#VALUE!
=FIND(D4,C4)
=FIND(D5,C5)
=FIND(D6,C6)
=FIND(D7,C7)
=FIND(D8,C8,6)
=FIND(D9,C9)
FIND
FIXED
Page 44 of 139
D
FIXED
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Original Converted
Number
To Text
10
10.00
=FIXED(C4)
10
10
=FIXED(C5,0)
10
10.0
=FIXED(C6,1)
10
10.00
=FIXED(C7,2)
10.25
10.25
=FIXED(C8)
10.25
10
=FIXED(C9,0)
10.25
10.3
=FIXED(C10,1)
10.25
10.25
=FIXED(C11,2)
1000
1,000.00 =FIXED(C12)
1000.23
1,000
=FIXED(C13,0)
1000.23
1000
=FIXED(C14,0,TRUE)
What Does It Do ?
This function converts a numeric value to text.
During the conversion the value can be rounded to a specific number of decimal places,
and commas can be inserted at the 1,000's.
Syntax
=FIXED(NumberToConvert,DecimalPlaces,Commas)
If DecimalPlaces places is not specified the function will assume 2.
The Commas option can be TRUE for commas or FALSE for no commas.
If the Commas is not specified the function will assume TRUE.
Formatting
No special formatting is needed.
Note that any further formatting with the Format, Cells, Number command will not have any effect.
FLOOR
Page 45 of 139
Number
1.5
2.3
2.9
123
145
175
Rounded Down
1
2
2
100
100
150
FLOOR
=FLOOR(C4,1)
=FLOOR(C5,1)
=FLOOR(C6,1)
=FLOOR(C7,50)
=FLOOR(C8,50)
=FLOOR(C9,50)
What Does It Do ?
This function rounds a value down to the nearest multiple specified by the user.
Syntax
=FLOOR(NumberToRound,SignificantValue)
Formatting
No special formatting is needed.
Example
The following table was used to calculate commission for members of a sales team.
Commission is only paid for every 1000 of sales.
The =FLOOR() function has been used to round down the Actual Sales to the
nearest 1000, which is then used as the basis for Commission.
Name
Alan
Bob
Carol
Actual Sales
23,500
56,890
18,125
HLOOKUP
Page 46 of 139
D
Jan
10
20
30
40
50
Feb
80
90
100
110
120
Mar
97
69
45
51
77
row 1
row 2
HLOOKUP
Feb
4
The result is :
100
row 3
row 4
row 5
row 6
=HLOOKUP(F10,D3:F10,F11,FALSE)
What Does It Do ?
This function scans across the column headings at the top of a table to find a specified item.
When the item is found, it then scans down the column to pick a cell entry.
Syntax
=HLOOKUP(ItemToFind,RangeToLookIn,RowToPickFrom,SortedOrUnsorted)
The ItemToFind is a single item specified by the user.
The RangeToLookIn is the range of data with the column headings at the top.
The RowToPickFrom is how far down the column the function should look to pick from.
The Sorted/Unsorted is whether the column headings are sorted. TRUE for yes, FALSE for no.
Formatting
No special formatting is needed.
Example 1
This table is used to find a value based on a specified month and name.
The =HLOOKUP() is used to scan across to find the month.
The problem arises when we need to scan down to find the row adjacent to the name.
To solve the problem the =MATCH() function is used.
The =MATCH() looks through the list of names to find the name we require. It then calculates
the position of the name in the list. Unfortunately, because the list of names is not as deep
as the lookup range, the =MATCH() number is 1 less than we require, so and extra 1 is
added to compensate.
The =HLOOKUP() now uses this =MATCH() number to look down the month column and
picks out the correct cell entry.
The =HLOOKUP() uses FALSE at the end of the function to indicate to Excel that the
column headings are not sorted, even though to us the order of Jan,Feb,Mar is correct.
If they were sorted alphabetically they would have read as Feb,Jan,Mar.
Bob
Eric
Alan
Carol
David
Jan
10
20
30
40
50
Feb
80
90
100
110
120
Mar
97
69
45
51
77
feb
alan
HLOOKUP
Page 47 of 139
D
The result is :
100
=HLOOKUP(F54,D47:F54,MATCH(F55,C48:C52,0)+1,FALSE)
Example 2
This example shows how the =HLOOKUP() is used to pick the cost of a spare part for
different makes of cars.
The =HLOOKUP() scans the column headings for the make of car specified in column B.
When the make is found, the =HLOOKUP() then looks down the column to the row specified
by the =MATCH() function, which scans the list of spares for the item specified in column C.
The function uses the absolute ranges indicated by the dollar symbol $. This ensures that
when the formula is copied to more cells, the ranges for =HLOOKUP() and =MATCH() do
not change.
Maker
Vauxhall
VW
Ford
VW
Ford
Ford
Vauxhall
Ford
Spare
Ignition
GearBox
Engine
Steering
Ignition
CYHead
GearBox
Engine
Cost
50
Vauxhall
Ford
VW
600
GearBox
500
450
600
1,200
Engine
1000
1200
800
275
Steering
250
350
275
70
Ignition
50
70
45
290
CYHead
300
290
310
500
1,200
=HLOOKUP(B79,G72:I77,MATCH(C79,F73:F77,0)+1,FALSE)
Example 3
In the following example a builders merchant is offering discount on large orders.
The Unit Cost Table holds the cost of 1 unit of Brick, Wood and Glass.
The Discount Table holds the various discounts for different quantities of each product.
The Orders Table is used to enter the orders and calculate the Total.
All the calculations take place in the Orders Table.
The name of the Item is typed in column C.
The Unit Cost of the item is then looked up in the Unit Cost Table.
The FALSE option has been used at the end of the function to indicate that the product
names across the top of the Unit Cost Table are not sorted.
Using the FALSE option forces the function to search for an exact match. If a match is
not found, the function will produce an error.
=HLOOKUP(C127,E111:G112,2,FALSE)
The discount is then looked up in the Discount Table
If the Quantity Ordered matches a value at the top of the Discount Table the =HLOOKUP will
look down the column to find the correct discount.
The TRUE option has been used at the end of the function to indicate that the values
across the top of the Discount Table are sorted.
Using TRUE will allow the function to make an approximate match. If the Quantity Ordered does
not match a value at the top of the Discount Table, the next lowest value is used.
Trying to match an order of 125 will drop down to 100, and the discount from
the 100 column is used.
=HLOOKUP(D127,E115:G118,MATCH(C127,D116:D118,0)+1,TRUE)
Unit Cost Table
HLOOKUP
Page 48 of 139
D
Brick
Wood
Glass
Item
Brick
Wood
Glass
Brick
Wood
Glass
Units
100
200
150
225
50
500
E
Brick
2
F
Wood
1
Discount Table
1
100
0%
6%
0%
3%
0%
12%
Orders Table
Unit Cost Discount
2
6%
1
3%
3
12%
2
6%
1
0%
3
15%
G
Glass
3
300
8%
5%
15%
Total
188
194
396
423
50
1,275
Unit Cost
=HLOOKUP(C127,E111:G112,2,FALSE)
Discount
=HLOOKUP(D127,E115:G118,MATCH(C127,D116:D118,0)+1,TRUE)
HOUR
Page 49 of 139
C
Number
21:15
0.25
Hour
21
6
=HOUR(C4)
=HOUR(C5)
HOUR
IF
Page 50 of 139
Name
Alan
Bob
Carol
Sales
1000
6000
2000
Target
5000
5000
4000
IF
Result
Not Achieved =IF(C4>=D4,"Achieved","Not Achieved")
Achieved
=IF(C5>=D5,"Achieved","Not Achieved")
Not Achieved =IF(C6>=D6,"Achieved","Not Achieved")
Sales
1000
6000
2000
Target
5000
5000
4000
Result
Not Achieved =IF(C31>=D31,"Achieved","Not Achieved")
Achieved
=IF(C32>=D32,"Achieved","Not Achieved")
Not Achieved =IF(C33>=D33,"Achieved","Not Achieved")
Example 2
The following table is similar to that in Example 1.
This time the Commission to be paid to the sales rep is calculated.
If the Sales are greater than or equal to the Target, the Commission is 10% of Sales.
If the Sales do not reach Target, the Commission is only 5% of Sales.
Name
Alan
Bob
Carol
Sales
1000
6000
2000
Target
5000
5000
4000
Commission
50
=IF(C43>=D43,C43*10%,C43*5%)
600
=IF(C44>=D44,C44*10%,C44*5%)
100
=IF(C45>=D45,C45*10%,C45*5%)
Example 3
This example uses the =AND() within the =IF() function.
A builders merchant gives 10% discount on certain product lines.
The discount is only given on products which are on Special Offer, when the Order Value
is 1000 or above.
The =AND() function is used with the =IF() to check that the product is on offer and that
the value of the order is above 1000.
Product
Wood
Special
Offer
Yes
Order
Value
2,000
Discount
200
Total
1,800
B
Glass
Cement
Turf
C
No
Yes
Yes
IF
Page 51 of 139
D
2,000
500
3,000
E
F
G
H
2,000
500
300
2,700
=IF(AND(C61="Yes",D61>=1000),D61*10%,0)
INDEX
Page 52 of 139
D
INDEX
Holiday booking price list.
People
Weeks
1
2
3
1
500.00
600.00
700.00
2
300.00
400.00
500.00
3
250.00
300.00
350.00
How many weeks required :
How many people in the party :
Cost per person is :
4
200.00
250.00
300.00
2
4
250
=INDEX(D7:G9,G11,G12)
What Does It Do ?
This function picks a value from a range of data by looking down a specified number
of rows and then across a specified number of columns.
It can be used with a single block of data, or non-continuos blocks.
Syntax
There are various forms of syntax for this function.
Syntax 1
=INDEX(RangeToLookIn,Coordinate)
This is used when the RangeToLookIn is either a single column or row.
The Co-ordinate indicates how far down or across to look when picking the data from the range.
Both of the examples below use the same syntax, but the Co-ordinate refers to a row when
the range is vertical and a column when the range is horizontal.
Colours
Red
Green
Blue
Size
Type either 1, 2 or 3 :
2
The colour is :
Green
=INDEX(D32:D34,D36)
Large
Medium
Type either 1, 2 or 3 :
2
The size is : Medium
=INDEX(G34:I34,H36)
Syntax 2
=INDEX(RangeToLookIn,RowCoordinate,ColumnColumnCordinate)
This syntax is used when the range is made up of rows and columns.
Country
England
France
Germany
Spain
Currency
Sterling
Franc
DM
Peseta
Population
50 M
40 M
60 M
30 M
Capitol
London
Paris
Bonn
Barcelona
2
3
Paris
=INDEX(D45:F48,F50,F51)
Syntax 3
=INDEX(NamedRangeToLookIn,RowCoordinate,ColumnColumnCordinate,AreaToPickFrom)
Using this syntax the range to look in can be made up of multiple areas.
The easiest way to refer to these areas is to select them and give them a single name.
The AreaToPickFrom indicates which of the multiple areas should be used.
In the following example the figures for North and South have been named as one
range called NorthAndSouth.
NORTH
Bricks
Wood
Qtr1
1,000.00
5,000.00
Qtr2
2,000.00
6,000.00
Qtr3
3,000.00
7,000.00
Qtr4
4,000.00
8,000.00
Small
INDEX
Page 53 of 139
C
Glass
D
9,000.00
E
10,000.00
SOUTH
Bricks
Wood
Glass
Qtr1
1,500.00
5,500.00
9,500.00
Qtr2
2,500.00
6,500.00
10,500.00
Qtr3
11,000.00
G
12,000.00
3,500.00
7,500.00
11,500.00
Qtr4
4,500.00
8,500.00
12,500.00
Err:504
EAST
Bricks
Wood
Glass
Qtr1
1,000.00
5,000.00
9,000.00
Qtr2
2,000.00
6,000.00
10,000.00
Qtr3
WEST
Bricks
Wood
Glass
Qtr1
1,500.00
5,500.00
9,500.00
Qtr2
2,500.00
6,500.00
10,500.00
Qtr3
The result is :
1
3
2
=INDEX(NorthAndSouth,F76,F77,F78)
Example
This is an extended version of the previous example.
It allows the names of products and the quarters to be entered.
The =MATCH() function is used to find the row and column positions of the names entered.
These positions are then used by the =INDEX() function to look for the data.
3,000.00
7,000.00
11,000.00
Qtr4
4,000.00
8,000.00
12,000.00
3,500.00
7,500.00
11,500.00
Qtr4
4,500.00
8,500.00
12,500.00
wood
qtr2
west
Err:504
=INDEX(EastAndWest,MATCH(F100,C91:C93,0),MATCH(F101,D90:G90,0),IF(F102=C90,1,IF(F102=C95,2)))
INDIRECT
Page 54 of 139
D
North
South
East
West
Jan
10
40
70
100
Feb
20
50
80
110
Mar
30
60
90
120
INDIRECT
G6
80
=INDIRECT(H9)
What Does It Do ?
This function converts a plain piece of text which looks like a cell address into a usable
cell reference.
The address can be either on the same worksheet or on a different worksheet.
Syntax
=INDIRECT(Text)
Formatting
No special formatting is needed.
Example 1
This example shows how data can be picked form other worksheets by using
the worksheet name and a cell address.
The example uses three other worksheets named NORTH, SOUTH and EAST.
The data on these three sheets is laid out in the same cells on each sheet.
When a reference to a sheet is made the exclamation symbol ! needs to be placed
between the sheet name and cell address acting as punctuation.
Type the name of the sheet, such as North :
Type the cell to pick data from, such as C8 :
The contents of the cell C8 on North is :
North
C8
#REF!
=INDIRECT(G33&"!"&G34)
Example 2
This example uses the same data as above, but this time the =SUM() function is
used to calculate a total from a range of cells.
Type the name of the sheet, such as South :
South
Type the start cell of the range, such as C5 :
C5
Type the end cell of the range, such as C7 :
C7
The sum of the range C5:C7 on South is :
#REF!
=SUM(INDIRECT(G44&"!"&G45&":"&G46))
The =INDIRECT() created a reference to =SUM(SOUTH!C5:C7)
INFO
Page 55 of 139
B
INFO
Current directory
Available bytes of memory
Memory in use
Total bytes of memory
Number of active worksheets
Cell currently in the top left of the window
Operating system
Recalculation mode
Excel version
Name of system. (PC or Mac)
System Information
Err:502
Err:502
Err:502
Err:502
1
Err:502
Windows (32-bit) NT 5.01
Automatic
420m0(Build:2)
LINUX
=INFO("directory")
=INFO("memavail")
=INFO("memused")
=INFO("totmem")
=INFO("numfile")
=INFO("origin")
=INFO("osversion")
=INFO("recalc")
=INFO("release")
=INFO("system")
INT
Page 56 of 139
D
INT
Number
1.5
2.3
10.75
-1.47589
Integer
1
2
10
-2
=INT(C4)
=INT(C5)
=INT(C6)
=INT(C7)
What Does It Do ?
This function rounds a number down to the nearest whole number.
Syntax
=INT(Number)
Formatting
No special formatting is needed.
Example
The following table was used by a school to calculate the age a child when the
school year started.
A child can only be admitted to school if they are over 8 years old.
The Birth Date and the Term Start date are entered and the age calculated.
Table 1 shows the age of the child with decimal places
Table 1
Birth Date
1-Jan-80
5-Feb-81
20-Oct-79
1-Mar-81
Term Start
1-Sep-88
1-Sep-88
1-Sep-88
1-Sep-88
Age
8.668035592 =(D27-C27)/365.25
7.570157426
8.8678987
7.504449008
Table 2 shows the age of the child with the Age formatted with no decimal places.
This has the effect of increasing the child age.
Table 2
Birth Date
1-Jan-80
5-Feb-81
20-Oct-79
1-Mar-81
Term Start
1-Sep-88
1-Sep-88
1-Sep-88
1-Sep-88
Age
9
8
9
8
=(D38-C38)/365.25
Table 3 shows the age of the child with the Age calculated using the =INT() function to
remove the decimal part of the number to give the correct age.
Table 3
Birth Date
1-Jan-80
5-Feb-81
20-Oct-79
1-Mar-81
Term Start
1-Sep-88
1-Sep-88
1-Sep-88
1-Sep-88
Age
8
7
8
7
=INT((D49-C49)/365.25)
Note
The age is calculated by subtracting the Birth Date from the Term Start to find the
age of the child in days.
The number of days is then divided by 365.25
B
C
D
E
F
The reason for using 365.25 is to take account of the leap years.
INT
Page 57 of 139
G
ISBLANK
Page 58 of 139
Data
1
Hello
ISBLANK
0
0
1
0
###
=ISBLANK(C4)
=ISBLANK(C5)
=ISBLANK(C6)
=ISBLANK(C7)
Date
Received
1-Jan-98
1-Jan-98
2-Jan-98
3-Jan-98
4-Jan-98
Amount
100
200
50
1,000
250
Date
Cleared
2-Jan-98
7-Jan-98
Banked Outstanding
100
0
200
0
0
50
0
1000
6-Jan-98
250
0
=IF(ISBLANK(F36),0,E36)
=IF(ISBLANK(F36),E36,0)
Totals
550
1050
ISERR
Page 59 of 139
D
Cell to test
3
#DIV/0!
#NAME?
#VALUE!
#VALUE!
#VALUE!
#N/A
Result
ISERR
0
1
1
1
1
1
0
=ISERR(D4)
=ISERR(D5)
=ISERR(D6)
=ISERR(D7)
=ISERR(D8)
=ISERR(D9)
=ISERR(D10)
What Does It Do ?
This function tests a cell and shows TRUE if there is an error value in the cell.
It will show FALSE if the contents of the cell calculate without an error, or if the error
is the #NA message.
Syntax
=ISERR(CellToTest)
The CellToTest can be a cell reference or a calculation.
Formatting
No special formatting is needed.
Example
The following tables were used by a publican to calculate the cost of a single bottle
of champagne, by dividing the cost of the crate by the quantity of bottles in the crate.
Table 1 shows what happens when the value zero 0 is entered as the number of bottles.
The #DIV/0 indicates that an attempt was made to divide by zero 0, which Excel does not do.
Table 1
Cost Of Crate :
Bottles In Crate :
Cost of single bottle :
24
0
#DIV/0!
=E32/E33
Table 2 shows how this error can be trapped by using the =ISERR() function.
Table 2
Cost Of Crate :
Bottles In Crate :
Cost of single bottle :
24
0
Try again!
=IF(ISERR(E40/E41),"Try again!",E40/E41)
ISERROR
Page 60 of 139
C
Cell to test
3
#DIV/0!
#NAME?
#VALUE!
#VALUE!
#VALUE!
#N/A
Result
ISERROR
0
1
1
1
1
1
1
=ISERROR(D4)
=ISERROR(D5)
=ISERROR(D6)
=ISERROR(D7)
=ISERROR(D8)
=ISERROR(D9)
=ISERROR(D10)
What Does It Do ?
This function tests a cell or calculation to determine whether an error has been generated.
It will show TRUE for any type of error and FALSE if no error is found.
Syntax
=ISERROR(CellToTest)
The CellToTest can be a cell reference or a formula.
Formatting
No special formatting is needed.
Example
The following tables was used to calculate the difference between two dates.
Table 1 shows an error due to the fact that the first entry was entered using an inappropriate
date format.
Table 1
Start date : Jan 01 98
End date :
5-Jan-98
Difference :
3-Jan-00 =D31-D30
Table 2 shows how the =ISERROR() function has been used to trap the error and inform the
user that there has been an error in the data entry.
Table 2
Start date : Jan 01 98
End date :
5-Jan-98
Difference :
3-Jan-00
=IF(ISERROR(D40-D39),"Error in data entry",D40-D39)
ISEVEN
Page 61 of 139
Number
1
2
2.5
2.6
3.5
3.6
Hello
1-Feb-98
1-Feb-96
Is it Even
0
1
1
1
0
0
#VALUE!
0
1
=ISEVEN(C4)
=ISEVEN(C5)
=ISEVEN(C6)
=ISEVEN(C7)
=ISEVEN(C8)
=ISEVEN(C9)
=ISEVEN(C10)
=ISEVEN(C11)
=ISEVEN(C12)
ISEVEN
What Does It Do ?
This function tests a number to determine whether it is even.
An even number is shown as TRUE an odd number is shown as FALSE.
Note that decimal fractions are ignored.
Note that dates can be even or odd.
Note that text entries result in the #VALUE! error.
Syntax
=ISEVEN(CellToTest)
Formatting
No special formatting is required.
ISLOGICAL
Page 62 of 139
Cell To Test
0
1
Result
0
0
0
0
0
0
0
ISLOGICAL
20
1-Jan-98
Hello
#DIV/0!
=ISLOGICAL(D4)
=ISLOGICAL(D5)
=ISLOGICAL(D6)
=ISLOGICAL(D7)
=ISLOGICAL(D8)
=ISLOGICAL(D9)
=ISLOGICAL(D10)
What Does It Do ?
This function tests a cell to determine whether the cell contents are logical.
The logical values can only be TRUE or FALSE.
If the cell does contain a logical value, the result TRUE is shown.
If the cell does not contain a logical value, the result FALSE is shown.
Syntax
=ISLOGICAL(CellToTest)
Formatting
No special formatting is needed.
ISNA
Page 63 of 139
Number
1
Hello
Result
0
0
0
0
1
ISNA
1-Jan-98
#N/A
=ISNA(C4)
=ISNA(C5)
=ISNA(C6)
=ISNA(C7)
=ISNA(C8)
ISNONTEXT
Page 64 of 139
Item To Test
10
Hello
Is It A Number?
1
0
1
1
0
ISNONTEXT
1-Jan-98
1OO
=ISNONTEXT(C4)
=ISNONTEXT(C5)
=ISNONTEXT(C6)
=ISNONTEXT(C7)
=ISNONTEXT(C8)
Buying Price
400
800
3OO
Mark-up
150%
200%
150%
Profit
600
1600
#VALUE!
33
34
35
36
37
38
39
40
41
Table 2 shows how the error is trapped using the =ISNONTEXT function and
the =IF() function in the calculation.
Table 2
Item
Radio
TV
Video
Buying Price
Mark-up
Profit
400
150%
600
800
200%
1600
3OO
150%
Retype the Price
=IF(ISNONTEXT(D40),D40*E40,"Retype the Price")
=D32*E32
ISNUMBER
Page 65 of 139
D
Cell Entry
1
1-Jan-98
Result
1
1
0
0
0
ISNUMBER
#DIV/0!
Hello
=ISNUMBER(D4)
=ISNUMBER(D5)
=ISNUMBER(D6)
=ISNUMBER(D7)
=ISNUMBER(D8)
What Does It Do ?
This function examines a cell or calculation to determine whether it is a numeric value.
If the cell or calculation is a numeric value the result TRUE is shown.
If the cell or calculation is not numeric, or is blank, the result FALSE is shown.
Syntax
=ISNUMBER(CellToTest)
The cell to test can be a cell reference or a calculation.
Formatting
No special formatting is needed.
Example
The following table was used by a personnel department to lookup the salary of an employee.
The employee can be entered as a Name or as a Numeric value.
The =ISNUMBER() function has been used to identify the type of entry made, and then
the =IF() decides which VLOOKUP to perform.
ID No.
1
2
3
4
5
Name
Alan
Eric
Carol
Bob
David
Salary
10,000
12,000
8,000
15,000
12,000
ISODD
Page 66 of 139
Number
1
2
2.5
2.6
3.5
3.6
Hello
1-Feb-98
1-Feb-96
Is it Odd
1
0
0
0
1
1
#VALUE!
1
0
=ISODD(C4)
=ISODD(C5)
=ISODD(C6)
=ISODD(C7)
=ISODD(C8)
=ISODD(C9)
=ISODD(C10)
=ISODD(C11)
=ISODD(C12)
ISODD
What Does It Do ?
This function tests a number to determine whether it is odd.
An odd number is shown as TRUE an even number is shown as FALSE.
Note that decimal fractions are ignored.
Note that dates can be odd or even.
Note that text entries result in the #VALUE! error.
Syntax
=ISODD(CellToTest)
Formatting
No special formatting is required.
ISREF
Page 67 of 139
D
ISREF
#NAME?
#NAME?
1 =ISREF(A1)
0 =ISREF(B99)
=ISREF(Hello)
0 =ISREF(10)
0 =ISREF(NOW())
0 =ISREF("A1")
=ISREF(XX99)
What Does It Do ?
This function shows TRUE if given a cell address, or FALSE for any other type of value.
Its a bit of an odd one, and is normally used in macros rather than on the worksheet.
Syntax
=ISREF(ValueToTest)
The ValueToTest can be any type of data, but when used on the worksheet, it cannot be a
reference to the contents of another cell, as the reference will itself be evaluated by the function.
Formatting
No special formatting is needed.
ISTEXT
Page 68 of 139
D
Cell To Test
Hello
1
25-Dec-98
Result
1
0
0
0
ISTEXT
=ISTEXT(D4)
=ISTEXT(D5)
=ISTEXT(D6)
=ISTEXT(D7)
What Does It Do ?
This functions tests an entry to determine whether it is text.
If the entry is text is shows TRUE.
If the entry is any other type it shows FALSE.
Syntax
=ISTEXT(CellToTest)
Formatting
No special formatting is needed.
Example
The following table was used by a personnel department to lookup the salary of an employee.
The employee can be entered as a Name or as a Numeric value.
The =ISTEXT() function has been used to identify the type of entry made, and then
the =IF() decides which VLOOKUP to perform.
ID No.
1
2
3
4
5
Name
Alan
Eric
Carol
Bob
David
Salary
10,000
12,000
8,000
15,000
12,000
LARGE
Page 69 of 139
D
Highest Value
2nd Highest Value
3rd Highest Value
4th Highest Value
5th Highest Value
800
250
120
120
100
LARGE
Values
120
800
100
120
250
=LARGE(C4:C8,1)
=LARGE(C4:C8,2)
=LARGE(C4:C8,3)
=LARGE(C4:C8,4)
=LARGE(C4:C8,5)
What Does It Do ?
This function examines a list of values and picks the value at a user specified position
in the list.
Syntax
=LARGE(ListOfNumbersToExamine,PositionToPickFrom)
Formatting
No special formatting is needed.
Example
The following table was used to calculate the top 3 sales figures between Jan, Feb and Mar.
Sales
North
South
East
West
Jan
5,000.00
5,800.00
3,500.00
12,000.00
Highest Value
2nd Highest Value
3rd Highest Value
Feb
6,000.00
7,000.00
2,000.00
4,000.00
Mar
4,500.00
3,000.00
10,000.00
6,000.00
12,000.00
10,000.00
7,000.00
=LARGE(D24:F27,1)
=LARGE(D24:F27,2)
=LARGE(D24:F27,3)
Note
Another way to find the Highest and Lowest values would have been to use
the =MAX() and =MIN() functions.
Highest
Lowest
12,000.00
2,000.00
=MAX(D24:F27)
=MIN(D24:F27)
LEFT
Page 70 of 139
LEFT
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Text
Alan Jones
Alan Jones
Alan Jones
Cardiff
ABC123
Number Of
Characters
Required Left String
1
A
2
Al
3
Ala
6
Cardif
4
ABC1
=LEFT(C4,D4)
=LEFT(C5,D5)
=LEFT(C6,D6)
=LEFT(C7,D7)
=LEFT(C8,D8)
What Does It Do ?
This function displays a specified number of characters from the left hand side of a
piece of text.
Syntax
=LEFT(OriginalText,NumberOfCharactersRequired)
Formatting
No special formatting is needed.
Example
The following table was used to extract the first name of a person from their full name.
The =FIND() function was used to locate position of the space between the first and second name.
The length of the first name is therefore the position of the space minus one character.
The =LEFT() function can now extract the first name based on the position of the space.
Full Name
First Name
Alan Jones
Alan
Bob Smith
Bob
Carol Williams
Carol
=LEFT(C27,FIND(" ",C27)-1)
=LEFT(C28,FIND(" ",C28)-1)
=LEFT(C29,FIND(" ",C29)-1)
LEN
Page 71 of 139
Text
Alan Jones
Bob Smith
Carol Williams
Cardiff
ABC123
Length
10
9
14
7
6
=LEN(C4)
=LEN(C5)
=LEN(C6)
=LEN(C7)
=LEN(C8)
LEN
What Does It Do ?
This function counts the number of characters, including spaces and numbers, in a piece of text.
Syntax
=LEN(Text)
Formatting
No Special formatting is needed.
Example
This example shows how the =LEN() function is used in a formula which extracts the
second name from a text entry containing both first and second names.
Original Text
Carol Williams
=FIND(" ",C24)
This is the position of the space.
Carol Williams
=LEN(C24)-FIND(" ",C24)
This is the length of the second name.
Calculated by taking the overall length of the complete
name and subtracting the position of the space.
=RIGHT(C24,LEN(C24)-FIND(" ",C24))
This is just the second name.
Calculated by using the =RIGHT() function to extract
the rightmost characters up to the length of
the second name.
LOOKUP (Array)
Page 72 of 139
D
Name
Alan
Bob
Carol
David
Eric
Francis
Gail
Jan
10
20
30
40
50
60
70
Feb
80
90
100
110
120
130
140
Mar
97
69
45
51
77
28
73
LOOKUP (Array)
Eric
77
=LOOKUP(F12,D4:G10)
What Does It Do ?
This function looks for a piece of information in a list, and then picks an item from the
last cell in the adjacent row or column.
It always picks the data from the end of the row or column, so it is no good if you need
to pick data from part way across a list, (use VLOOKUP or HLOOKUP).
The way in which the function decides whether to pick from the row or column is based
on the size of the table.
If the table has more rows than columns :
Syntax
=LOOKUP(WhatToLookFor,RangeToLookIn)
The WhatToLookFor should be a single item.
The RangeToLook in can be either horizontal or vertical.
Be careful not to include unnecessary heading in the range as these will cause errors.
Example 1
In this table there are more
rows than columns, so the
Example 2
In this table there are more columns than rows, so
the row heading of Jan is not included in the
LOOKUP (Array)
Page 73 of 139
B
C
D
column heading of Jan is
not included in the lookup
range.
Jan
Alan
100
Bob
100
Carol
100
David
100
Eric
100
Fred
100
F
G
lookup range.
Jan
Alan
100
Bob
100
Carol
100
David
100
Formatting
No special formatting is needed.
Problems
The list of information to be looked through must be sorted in ascending order, otherwise errors
will occur, either as #N/A or incorrect results.
Table 1 shows the Name column sorted alphabetically, the results of using =LOOKUP() will
be correct.
Table 2 shows the same data, but not sorted. Sometimes the results will be correct, but other
times the result will be an #N/A error or incorrect figure.
Table 1
Name
Alan
Bob
Carol
David
Eric
Francis
Gail
Jan
10
20
30
40
50
60
70
Name :
Eric
Value :
Feb
80
90
100
110
120
130
140
Mar
97
69
45
51
77
28
73
77
=LOOKUP(C88,B80:E86)
Table 2
Name
David
Eric
Alan
Bob
Carol
Francis
Gail
Jan
40
50
10
20
30
60
70
Name :
Eric
Value :
Feb
110
120
80
90
100
130
140
Mar
51
77
97
69
45
28
73
77
=LOOKUP(H88,G80:J86)
LOOKUP (Vector)
Page 74 of 139
Name
Alan
Bob
Carol
David
Eric
Francis
Gail
Jan
10
20
30
40
50
60
70
Feb
80
90
100
110
120
130
140
Mar
97
69
45
51
77
28
73
LOOKUP (Vector)
Eric
120
=LOOKUP(F12,D4:G10,F4:F10)
What Does It Do ?
This function looks for a piece of information in a list, and then picks an item from
a second range of cells.
Syntax
=LOOKUP(WhatToLookFor,RangeToLookIn,RangeToPickFrom)
The WhatToLookFor should be a single item.
The RangeToLook in can be either horizontal or vertical.
The RangeToPickFrom must have the same number of cells in it as the RangeToLookin.
Be careful not to include unnecessary heading in the ranges as these will cause errors.
Formatting
No special formatting is needed.
Example
The following example shows how the =LOOKUP() function was used to match a name typed
in cell G41 against the list of names in C38:C43. When a match is found the =LOOKUP() then
picks from the second range E38:J38.
If the name Carol is used, the match is made in the third cell of the list of names, and then
the function picks the third cell from the list of values.
RangeToLookIn
Alan
Bob
Carol
David
Eric
Fred
10
Type a name :
Value :
RangeToPickFrom
15
20
25
Carol
15
=LOOKUP(G41,C38:C43,E38:J38)
Problems
The list of information to be looked through must be sorted in ascending order, otherwise errors
will occur, either as #N/A or incorrect results.
30
LOWER
Page 75 of 139
C
Lower Case
alan jones
bob smith
carol williams
cardiff
abc123
LOWER
=LOWER(C4)
=LOWER(C5)
=LOWER(C6)
=LOWER(C7)
=LOWER(C8)
What Does It Do ?
This function converts all characters in a piece of text to lower case.
Syntax
=LOWER(TextToConvert)
Formatting
No special formatting is needed.
MATCH
Page 76 of 139
D
MATCH
Names
Bob
Alan
David
Carol
Type a name to look for :
Values
250
600
1000
4000
Alan
Type a value :
1000
Value position :
3
=MATCH(I9,I4:I7,1)
What Does It Do ?
This function looks for an item in a list and shows its position.
It can be used with text and numbers.
It can look for an exact match or an approximate match.
Syntax
=MATCH(WhatToLookFor,WhereToLook,TypeOfMatch)
The TypeOfMatch either 0, 1 or -1.
Using 0 will look for an exact match. If no match is found the #NA error will be shown.
Using 1 will look for an exact match, or the next lowest number if no exact match exists.
If there is no match or next lowest number the error #NA is shown.
The list of values being examined must be sorted for this to work correctly.
Using -1 will look for an exact match, or the next highest number if no exact match exists.
If there is no exact match or next highest number the error #NA is shown.
The list must be sorted for this to work properly.
Examples 1
Using the 0 option suitable for an exact match.
The Ascending list gives the exact match.
The Descending list gives the exact match.
The Wrong Value list cannot find an exact match, so the #NA is shown.
Ascending
10
20
30
40
Descending
40
30
20
10
Wrong Value
10
20
30
40
20
2
20
3
=MATCH(G45,G40:G43,0)
25
#N/A
Example 2
Using the 1 option suitable for a ascending list to find an exact or next lowest match.
The Ascending list gives the exact match.
The Descending list gives the #NA error.
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
MATCH
Page 77 of 139
A B
C
D
E
F
The Wrong Value list finds the next lowest number..
Ascending
10
20
30
40
Descending
40
30
20
10
20
2
20
#N/A
Wrong Value
10
20
30
40
25
2
=MATCH(G62,G57:G60,1)
Example 3
Using the -1 option suitable for a descending list to find an exact or next highest match.
The Ascending list gives the #NA error.
The Descending list gives the exact match.
The Wrong Value list finds the next highest number.
Ascending
10
20
30
40
Descending
40
30
20
10
20
2
20
3
Wrong Value
40
30
20
10
25
2
=MATCH(G79,G74:G77,-1)
Example 4
The tables below were used to by a bus company taking booking for bus tours.
They need to allocate a bus with enough seats for the all the passengers.
The list of bus sizes has been entered in a list.
The number of passengers on the tour is then entered.
The =MATCH() function looks down the list to find the bus with enough seats.
If the number of passengers is not an exact match, the next biggest bus will be picked.
After the =MATCH() function has found the bus, the =INDEX() function has been used
to look down the list again and pick out the actual bus size required.
Bus 1
Bus 2
Bus 3
Bus 4
Bus 5
Bus Size
54
50
22
15
6
Example 5
The tables below were used by a school to calculate the exam grades for pupils.
The list of grade breakpoints was entered in a list.
The pupils scores were entered in another list.
The pupils scores are compared against the breakpoints.
107
108
109
110
111
112
113
114
115
MATCH
Page 78 of 139
A B
C
D
E
F
G
If an exact match is not found, the next lowest breakpoint is used.
The =INDEX() function then looks down the Grade list to find the grade.
Exam Score
Grade
0
Fail
50
Pass
90
Merit
95
Distinction
Pupil Score
Grade
Alan
60
Pass
Bob
6
Fail
Carol
97
Distinction
David
89
Pass
=INDEX(D111:D114,MATCH(G114,C111:C114,1),0)
MAX
Page 79 of 139
Values
120
800
100
120
250
Maximum
800
=MAX(C4:G4)
4-Jul-98
Maximum
27-Dec-98
=MAX(C7:G7)
MAX
Dates
1-Jan-98 25-Dec-98 31-Mar-98 27-Dec-98
What Does It Do ?
This function picks the highest value from a list of data.
Syntax
=MAX(Range1,Range2,Range3... through to Range30)
Formatting
No special formatting is needed.
Example
In the following example the =MAX() function has been used to find the highest value for
each region, month and overall.
Sales
North
South
East
West
Jan
5,000
5,800
3,500
12,000
Feb
6,000
7,000
2,000
4,000
Mar
4,500
3,000
10,000
6,000
Month Max
12,000
7,000
10,000
=MAX(E23:E26)
Region Max
6,000
=MAX(C23:E23)
7,000
10,000
12,000
MEDIAN
Page 80 of 139
Value1
20
Value2
50
Value3
10
Value4
30
Value5
40
Median
30
=MEDIAN(C4:G4)
2000
1000
10
20
8000
1000
=MEDIAN(C6:G6)
10
20
40
40
40
40
=MEDIAN(C8:G8)
Value1
20
Value2
40
Value3
30
Value4
10
Median
25
=MEDIAN(C11:F11)
20
20
40
20
20
=MEDIAN(C13:F13)
MEDIAN
What Does It Do ?
This function finds the median value of a group of values.
The median is not the average, it is the half way point where half the numbers in the group are
larger than it and half the numbers are less than it.
If there is no exact median number in the group, the two nearest the half way point are
added and their average is used as the median.
Syntax
=MEDIAN(Range1,Range2,Range3... through to Range30)
Formatting
No special formatting is needed.
MID
Page 81 of 139
C
Text
ABCDEDF
ABCDEDF
ABCDEDF
Start
Position
1
2
5
ABC-100-DEF
ABC-200-DEF
ABC-300-DEF
100
200
300
Large
Medium
Small
MID
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
How Many
Characters Mid String
3
ABC
=MID(C4,D4,E4)
3
BCD
=MID(C5,D5,E5)
2
ED
=MID(C6,D6,E6)
=MID(C8,5,3)
=MID(C9,5,3)
=MID(C10,5,3)
=MID(C12,12,99)
=MID(C13,12,99)
=MID(C14,12,99)
What Does It Do ?
This function picks out a piece of text from the middle of a text entry.
The function needs to know at what point it should start, and how many characters to pick.
If the number of characters to pick exceeds what is available, only the available characters
will be picked.
Syntax
=MID(OriginalText,PositionToStartPicking,NumberOfCharactersToPick)
Formatting
No special formatting is needed.
Example 1
The following table uses the =MID() function to extract a post code from a branch ID used
by a company.
It is assumed that all branch ID's follow the same format with the letters identifying the
postal region being in the 5th and 6th positions.
Branch ID
DRS-CF-476
DRS-WA-842
HLT-NP-190
Postal Region
CF
=MID(C35,5,2)
WA
=MID(C36,5,2)
NP
=MID(C37,5,2)
Example 2
This example shows how to extract an item which is of variable length, which is inside
a piece of text which has no standard format, other than the required text is always
between two slash / symbols.
Full Branch Code
Postal Region
DRS/STC/872
STC
HDRS/FC/111
FC
S/NORTH/874
NORTH
HQ/K/875
K
SPECIAL/UK & FR/876
UK & FR
=MID(C50,FIND("/",C50)+1,FIND("/",C50,FIND("/",C50)+1)-FIND("/",C50)-1)
C
D
E
F
Find the first /, plus 1 for the Start of the code.
Find the second /, occurring after the first /
Calculate the length of the text to extract, by subtracting the position
of the first / from the position of the second /
MID
Page 82 of 139
G
MIN
Page 83 of 139
C
Values
120
800
100
120
250
Minimum
100
=MIN(C4:G4)
Dates
1-Jan-98
25-Dec-98
31-Mar-98
27-Dec-98
4-Jul-98
Maximum
1-Jan-98
=MIN(C7:G7)
MIN
What Does It Do ?
This function picks the lowest value from a list of data.
Syntax
=MIN(Range1,Range2,Range3... through to Range30)
Formatting
No special formatting is needed.
Example
In the following example the =MIN() function has been used to find the lowest value for
each region, month and overall.
Sales
North
South
East
West
Jan
5,000.00
5,800.00
3,500.00
12,000.00
Feb
6,000.00
7,000.00
2,000.00
4,000.00
Mar
4,500.00
3,000.00
10,000.00
6,000.00
Month MIN
3,500.00
2,000.00
3,000.00
=MIN(E23:E26)
Overall MIN
2,000.00
=MIN(C23:E26)
Region Min
4,500
=MIN(C23:E23)
3,000
2,000
4,000
MOD
Page 84 of 139
Number
12
20
18
9
24
Divisor
5
7
3
2
7
Remainder
2
6
0
1
3
=MOD(C4,D4)
=MOD(C5,D5)
=MOD(C6,D6)
=MOD(C7,D7)
=MOD(C8,D8)
MOD
What Does It Do ?
This function calculates the remainder after a number has been divided by another number.
Syntax
=MOD(Number,Divisor)
Formatting
No special formatting is needed.
MODE
Page 85 of 139
Value1
20
Value2
50
Value3
10
Value4
10
Value5
40
Mode
10
=MODE(C4:G4)
40
20
40
10
40
40
=MODE(C6:G6)
10
20
10
10
20
20
99
99
20
20
10
99
20
10
10
10
10
10
=MODE(C8:G8)
=MODE(C9:G9)
=MODE(C10:G10)
10
20
30
40
50
MODE
#VALUE! =MODE(C12:G12)
What Does It Do ?
This function displays the most frequently occurring number in a group of numbers.
For it to work correctly there must be at least two numbers which are the same.
If all the values in the group are unique the function shows the error #N/A.
When there is more than one set of duplicates, the number closest to the beginning
of the group will be used. (Which is not really an accurate answer!)
Syntax
=MODE(Range1,Range2,Range3... through to Range30)
Formatting
No special formatting is needed.
Example
The following table shows garments sold in a clothes shop.
The shopkeeper wants to keep track of the most commonly sold size.
The =MODE() function has been used to calulate this.
Order
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
Garmet
Blouse
Skirt
Shirt
Blouse
Skirt
Dress
Shirt
Blouse
Dress
Shirt
Dress
Skirt
Skirt
Shirt
Dress
Shirt
Blouse
Blouse
Dress
Skirt
Size
10
10
8
10
12
8
10
10
8
10
12
12
10
10
8
10
10
8
10
8
10
=MODE(D33:D52)
Count of size 8 :
6
=COUNTIF(D33:D52,"8")
Count of size 10 :
11
=COUNTIF(D33:D52,"10")
Count of size 12 :
3
=COUNTIF(D33:D52,"12")
MODE
Page 86 of 139
B
C
D
E
F
G
H
I
Note
If the =AVERAGE() function had been used the answer would have been :
9.7
This figure is of no benefit to the shopkeeper as there are no garmets of this size!
MONTH
Page 87 of 139
C
Original Date
1-Jan-98
1-Jan-98
Month
1
December
MONTH
=MONTH(C4)
=MONTH(C5)
3/25/1962
January
=MONTH(F20)
MROUND
Page 88 of 139
Number
110
120
150
160
170
Multiple
50
50
50
50
50
Rounded
Value
100
100
150
150
150
MROUND
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
=MROUND(C4,D4)
=MROUND(C5,D5)
=MROUND(C6,D6)
=MROUND(C7,D7)
=MROUND(C8,D8)
What Does It Do ?
This function rounds a number up or down to the nearest multiple specified by the user.
Syntax
=MROUND(NumberToRound,MultipleToUse)
Formatting
No special formatting is needed.
N
Page 89 of 139
D
N
Original Converted
1
1
=N(C4)
3 1/2
3.5
=N(C5)
3.5
3.5
=N(C6)
3.50%
0.035
=N(C7)
25-Dec-98
36154
=N(C8)
1
1
=N(C9)
0
0
=N(C10)
Hello
0
=N(C11)
0
=N(C12)
What Does It Do ?
This function converts a numeric entry to its mathematical value.
Anything which will not convert is shown as 0 zero.
Excel does not really need this function, due to the fact that Excel calculates in this way
naturally. The function is included for compatibility with other spreadsheet programs.
Syntax
=N(NumericEntry)
Formatting
No special formatting is needed.
NA
Page 90 of 139
C
NA
#N/A =NA()
Value
10
30
Test
11
#N/A
31
North
South
East
West
Total
Sales
100
#N/A
#N/A
200
#N/A
=IF(ISBLANK(C6),NA(),C6+1)
=IF(ISBLANK(C7),NA(),C7+1)
=IF(ISBLANK(C8),NA(),C8+1)
=NA()
=NA()
=SUM(D11:D14)
What Does It Do ?
This function is a place marker used to indicate that required information is Not Available.
It can be type directly in to a cell as =NA() or it can be used as part of a calculation.
When the =NA() is used, any calculations which depend upon the cell will also show #NA.
It is used to indicate that all the data has not yet been entered in to the spreadsheet.
Syntax
=NA()
Formatting
No special formatting is required.
Example
The following table was used by a company to calculate the monthly Wage of an employee.
The Salary and Tax percentage are entered.
The Tax is then deducted from the Salary to calculate the Wage.
Table 1 shows that when the Tax is not entered, the Wage is still calculated.
On a large spreadsheet this may go unnoticed and the wrong Wage paid.
Table 1
Alan
Bob
Carol
Salary
1000
1000
1000
Tax %
25%
20%
Pay
750
1000
800
=C39-C39*D39
=C40-C40*D40
=C41-C41*D41
Table 2 shows how the =NA() has been inserted in the unknown Tax to act as a
reminder that the Tax still needs to be entered.
Table 2
Alan
Bob
Carol
Salary
1000
1000
1000
Tax %
25%
#N/A
20%
Pay
750
#N/A
800
=C49-C49*D49
=C50-C50*D50
=C51-C51*D51
NETWORKDAYS
Page 91 of 139
Start Date
1-Mar-98
25-Apr-98
24-Dec-98
End Date
7-Mar-98
30-Jul-98
5-Jan-99
Work Days
5
69
9
NETWORKDAYS
=NETWORKDAYS(C4,D4)
=NETWORKDAYS(C5,D5)
=NETWORKDAYS(C6,D6)
Bank Holiday
Xmas
New Year
New Year
New Year
End Date
Fri 06-Mar-98
Fri 13-Mar-98
Fri 01-May-98
Holidays
1-May-98
25-Dec-98
1-Jan-97
1-Jan-98
1-Jan-99
Work Days
5
10
4
=NETWORKDAYS(B28,C28,C33:C37)
=NETWORKDAYS(B29,C29,C33:C37)
=NETWORKDAYS(B30,C30,C33:C37)
1
2
3
4
5
6
7
8
9
A
B
C
D
E
Northern data.
Used by the example for the =INDIRECT() function.
Alan
Jan
Feb
Mar
Alan
10
20
30
Bob
40
50
60
Carol
70
80
90
Total
120
150
180
NORTH
Page 92 of 139
F
Total
60
150
240
450
NOT
Page 93 of 139
D
NOT
Cells To Test
10
20
10
20
10
20
1-Jan-98 1-Feb-98
Hello
Goodbye
Hello
Hello
Result
1
1
0
1
1
0
=NOT(C4>D4)
=NOT(C5=D5)
=NOT(C6<D6)
=NOT(C7>D7)
=NOT(C8=D8)
=NOT(C9=D9)
What Does It Do ?
This function performs a test to see if the test fails. (A type of reverse logic).
If the test fails, the result is TRUE.
If the test is met, then the result is FALSE.
Syntax
=NOT(TestToPerform)
The TestToPerform can be reference to cells or another calculation.
Formatting
No special formatting is needed.
Example
The following table was used by a library to track books borrowed.
The date the book was Taken out is entered.
The period of the Loan is entered.
The date the book was returned is entered.
The =NOT() function has been used to calculate whether the book was returned within
the correct time, by adding the Loan value to the Taken date.
If the book was not returned on time the result Overdue is shown, otherwise OK is shown.
Taken
1-Jan-98
1-Jan-98
1-Jan-98
Loan
14
14
14
Returned
Status
5-Jan-98
OK
15-Jan-98
OK
20-Jan-98 Overdue
=IF(NOT(D33<=B33+C33),"Overdue","OK")
=IF(NOT(D34<=B34+C34),"Overdue","OK")
=IF(NOT(D35<=B35+C35),"Overdue","OK")
NOW
Page 94 of 139
C
NOW
The current Date and Time
9/10/2015 9:58
42257.4154388259
=NOW()
=NOW()
ODD
Page 95 of 139
Number
2
2.4
2.9
3
3.4
3.9
Rounded To
Next Odd
3
3
3
3
5
5
=ODD(C4)
=ODD(C5)
=ODD(C6)
=ODD(C7)
=ODD(C8)
=ODD(C9)
ODD
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
What Does It Do ?
This function rounds a number up to the next highest whole odd number.
Syntax
=ODD(NumberToBeRounded)
Formatting
No special formatting is needed.
OR
Page 96 of 139
Order No.
AB001
AB002
AB003
AB004
Cost
1000
1000
2000
5000
Payment
Type
Cash
Visa
Cheque
Delta
Handling
Charge
5.00
5.00
OR
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
=IF(OR(E4="Visa",E4="Delta"),5,0)
=IF(OR(E5="Visa",E5="Delta"),5,0)
=IF(OR(E6="Visa",E6="Delta"),5,0)
=IF(OR(E7="Visa",E7="Delta"),5,0)
Order No.
AB001
AB002
AB003
AB004
Cost
1000
1000
2000
5000
Payment
Type
Cash
Visa
Cheque
Delta
Handling
Charge
=IF(OR(E27="Visa",E27="Delta"),5,0)
PROPER
Page 97 of 139
C
Original Text
alan jones
bob smith
caRol wILLIAMS
cardiff
ABC123
Proper
Alan Jones
Bob Smith
Carol Williams
Cardiff
Abc123
PROPER
=PROPER(C4)
=PROPER(C5)
=PROPER(C6)
=PROPER(C7)
=PROPER(C8)
What Does It Do ?
This function converts the first letter of each word to uppercase, and all subsequent letters
are converted to lower case.
Syntax
=PROPER(TextToConvert)
Formatting
No special formatting is needed.
QUARTILE
Page 98 of 139
E
QUARTILE
Values
1
25
50
75
100
Values
817
748
372
487
140
104
756
993
384
607
640
369
294
185
894
767
703
261
491
182
What Does It Do ?
This function examines a group of values and then shows the values which are of the
upper limits of the 1st, 2nd, 3rd and 4th quarters of the data.
The Quartile of 0 (zero) is actually lowest value, which can be obtained using the =MIN() function.
The Quartile of 4 is actually highest value, which can be obtained using the =MAX() function.
Syntax
=QUARTILE(RangeToBeExamined,QuartileValue)
The QuartileValue can only be 0,1,2,3 or 4.
Formatting
No special formatting is needed.
QUOTIENT
Page 99 of 139
Number
12
20
46
Divisor
5
3
15
Result
2
6
3
QUOTIENT
=QUOTIENT(C4,D4)
=QUOTIENT(C5,D5)
=QUOTIENT(C6,D6)
What Does It Do ?
This function calculates the number of times a number can be divided by another number.
It ignores any remainder, only showing the whole number.
Syntax
=QUOTIENT(NumberToBeDivided,Divisor)
Formatting
No special formatting is needed.
Example
The following example was used by a drinks merchant to calculate the number of
crates which could be packed using bottles in stock.
The merchant can only sell full crates.
Table 1 calculates the crates by simple division. This however shows
decimal fractions which are not needed.
Table 1
Item
Wine
Champagne
Rum
Beer
Bottles
To Pack
126
200
15
250
Bottles
Per Crate
12
8
4
20
Crates Needed
10.5
25
3.75
12.5
=D28/E28
Bottles
To Pack
126
200
15
250
Bottles
Per Crate
12
8
6
20
Crates Needed
10
25
2
12
=QUOTIENT(D39,E39)
RAND
Page 100 of 139
D
RAND
Random greater than or equal to 0 but less than 1.
0.197648766 =RAND()
Random greater than or equal to 0 but less than 10
7.21959617
=RAND()*10
Random
0.16358
0.155149
0.45188
0.5914
0.417473
0.606088
0.230491
0.939291
0.402606
0.482817
0.71379
0.44219
0.822793
0.148279
0.33907
0.373172
0.232132
0.944473
0.879991
0.462208
0.591911
Lottery
29
34
30
41
40
37
26
32
21
19
7
10
16
8
48
43
44
4
3
45
47
Random
0.47129699
0.33975267
0.013708958
0.855374452
0.430636358
0.114969919
0.023597422
0.718733057
0.861917419
0.47991311
0.54123533
0.834344287
0.392121732
0.262472594
0.583560587
0.28510219
0.387260519
0.533504628
0.173652604
0.563475906
0.771578415
C
Clubs 12
Hearts 10
Hearts 13
Spades 7
Spades 6
Diamond 12
Hearts 3
Hearts 5
Hearts 8
Hearts 1
Diamond 13
Hearts 9
Clubs 4
Diamond 5
Spades 4
Clubs 1
Spades 8
Hearts 7
Diamond 1
Clubs 2
Hearts 2
Diamond 11
Clubs 7
Spades 12
Spades 10
Clubs 11
Diamond 2
Diamond 10
Spades 9
Spades 11
Hearts 12
RAND
Page 101 of 139
D
0.547332
0.028232
0.042206
0.522512
0.377669
0.136147
0.950131
0.39235
0.552871
0.858842
0.374683
0.099233
0.061578
0.823446
0.791071
0.890193
0.684418
0.459932
0.092829
0.119543
0.983464
0.80126
0.167902
0.356165
0.813554
0.478619
0.03047
0.122451
0.191176
0.317527
0.616804
F
49
35
27
1
13
31
5
18
39
23
12
11
20
33
42
24
2
14
25
9
38
15
28
17
6
22
46
36
G
0.92768505
0.728709309
0.15515582
0.142320003
0.92753139
0.851620582
0.661773396
0.724301453
0.221948494
0.452408057
0.3111071477
0.985516867
0.115647685
0.234046676
0.86517816
0.8277153
0.319313365
0.523651988
0.884475019
0.761073248
0.703740575
0.734329506
0.44383894
0.739510547
0.152100317
0.9051118453
0.549277329
0.764363387
RANK
Page 102 of 139
Values
7
4
25
8
16
Ranking Position
High to Low
4
5
1
3
2
=RANK(C4,C4:C8)
=RANK(C5,C4:C8)
=RANK(C6,C4:C8)
=RANK(C7,C4:C8)
=RANK(C8,C4:C8)
Values
7
4
25
8
16
Ranking Position
Low to High
2
1
5
3
4
=RANK(C11,C11:C15,1)
=RANK(C12,C11:C15,1)
=RANK(C13,C11:C15,1)
=RANK(C14,C11:C15,1)
=RANK(C15,C11:C15,1)
Values
10
30
20
30
40
Ranking Position
High to Low
5
2
4
2
1
=RANK(C18,C18:C22)
=RANK(C19,C18:C22)
=RANK(C20,C18:C22)
=RANK(C21,C18:C22)
=RANK(C22,C18:C22)
RANK
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
What Does It Do ?
This function calculates the position of a value in a list relative to the other values in the list.
A typical usage would be to rank the times of athletes in a race to find the winner.
The ranking can be done on an ascending (low to high) or descending (high to low) basis.
If there are duplicate values in the list, they will be assigned the same rank. Subsequent ranks
would not follow on sequentially, but would take into account the fact that there were duplicates.
If the numbers 30, 20, 20 and 10 were ranked, 30 is ranked as 1, both 20's are ranked as 2, and
the 10 would be ranked as 4.
Value
30
20
20
10
Rank
1
2
2
4
=RANK(B34,B34:B37)
=RANK(B35,B34:B37)
=RANK(B36,B34:B37)
=RANK(B37,B34:B37)
Syntax
=RANK(NumberToRank,ListOfNumbers,RankOrder)
The RankOrder can be 0 zero or 1.
Using 0 will rank larger numbers at the top. (This is optional, leaving it out has the same effect).
Using 1 will rank small numbers at the top.
Formatting
No special formatting is needed.
Example
RANK
Page 103 of 139
B
C
D
E
F
G
H
I
The following table was used to record the times for athletes competing in a race.
The =RANK() function was then used to find their race positions based upon the finishing times.
Athlete
John
Alan
David
Brian
Sue
Alex
Time
1:30
1:45
1:02
1:36
1:27
1:03
Race Position
4
6
1
5
3
2
=RANK(C53,C53:C58,1)
=RANK(C54,C53:C58,1)
=RANK(C55,C53:C58,1)
=RANK(C56,C53:C58,1)
=RANK(C57,C53:C58,1)
=RANK(C58,C53:C58,1)
REPLACE
Page 104 of 139
D
REPLACE
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Start Characters
New
Modified
Original Text Position To Replace Character
Text
ABCDEFGH
2
1
x
AxCDEFGH =REPLACE(C4,D4,E4,F4)
ABCDEFGH
2
5
x
AxGH
=REPLACE(C5,D5,E5,F5)
ABCDEFGH
2
1
hello
AhelloCDEFGH =REPLACE(C6,D6,E6,F6)
ABCDEFGH
2
5
hello
AhelloGH
=REPLACE(C7,D7,E7,F7)
What Does It Do ?
This function replaces a portion of text with a new piece of text.
You need to specify where the replacement should start, how many characters to
remove and what the new replacement text should be.
Syntax
=REPLACE(OriginalText,StartPosition,NumberOfCharactersToReplace,NewText)
Formatting
No special formatting is needed.
RIGHT
Page 105 of 139
Original
Text
Alan Jones
Alan Jones
Alan Jones
Cardiff
ABC123
Number Of
Characters
Required
1
2
3
6
4
Right
String
s
es
nes
ardiff
C123
RIGHT
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
=RIGHT(C4,D4)
=RIGHT(C5,D5)
=RIGHT(C6,D6)
=RIGHT(C7,D7)
=RIGHT(C8,D8)
What Does It Do ?
This function displays a specified number of characters from the right hand side of a
piece of text.
Syntax
=RIGHT(OriginalText,NumberOfCharactersRequired)
Formatting
No special formatting is needed.
Example
The following table was used to extract the second name of a person from their full name.
The =FIND() function locates the position of the space between the first and second name.
The length of the second name is calculated by subtracting the position of the space from
the overall length of the full name.
The =RIGHT() function can then extract the second name.
Full Name
Second Name
Alan Jones
Jones
Bob Smith
Smith
Carol Williams
Williams
=RIGHT(C28,LEN(C28)-FIND(" ",C28))
=RIGHT(C29,LEN(C29)-FIND(" ",C29))
=RIGHT(C30,LEN(C30)-FIND(" ",C30))
ROMAN
Page 106 of 139
Number
1
2
3
5
10
1998
1998
1998
1998
1998
1998
1998
1998
Roman
I
II
III
V
X
MCMXCVIII
MCMXCVIII
MLMVLIII
MXMVIII
MVMIII
MVMIII
MLMVLIII
MCMXCVIII
ROMAN
=ROMAN(C4)
=ROMAN(C5)
=ROMAN(C6)
=ROMAN(C7)
=ROMAN(C8)
=ROMAN(C9)
=ROMAN(C10,0)
=ROMAN(C11,1)
=ROMAN(C12,2)
=ROMAN(C13,3)
=ROMAN(C14,4)
=ROMAN(C15,TRUE)
=ROMAN(C16,FALSE)
What Does It Do ?
This function produces a number shown as Roman numerals in various formats.
Syntax
=ROMAN(NormalNumber,RomanNumberFormat)
The RomanNumberFormat can be any of the following.
0 is Classic. This is used if no format is specified.
1 is more Concise.
2 is even more Concise.
3 is even more Concise still.
4 is Simplified.
TRUE is Classic
FALSE is Simplified
Formatting
No special formatting is needed.
Note
There is no function to do the opposite calculation of Roman to normal.
ROUND
Page 107 of 139
C
ROUND
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Number
1.47589
1.47589
1.47589
13643.47589
13643.47589
13643.47589
Places To Rounded
Round
Number
0
1 =ROUND(C4,D4)
1
1.5 =ROUND(C5,D5)
2
1.48 =ROUND(C6,D6)
-1
13640 =ROUND(C7,D7)
-2
13600 =ROUND(C8,D8)
-3
14000 =ROUND(C9,D9)
What Does It Do ?
This function rounds a number to a specified amount od decimal places.
If 0 is used the number is rounded to the nearest whole number.
If a negative amount of rounding is used the figures to the left of the decimal point are rounded.
Syntax
=ROUND(NumberToRound,DecimalPlacesToUse)
Formatting
No special formatting is needed.
ROUNDDOWN
Page 108 of 139
D
ROUNDDOWN
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Number
1.47589
1.47589
1.47589
13643.48
13643.48
13643.48
Places To Rounded
Round
Down
0
1 =ROUNDDOWN(C4,D4)
1
1.4 =ROUNDDOWN(C5,D5)
2
1.47 =ROUNDDOWN(C6,D6)
-1
13640 =ROUNDDOWN(C7,D7)
-2
13600 =ROUNDDOWN(C8,D8)
-3
13000 =ROUNDDOWN(C9,D9)
What Does It Do ?
This function rounds a number down to a specified amount of decimal places.
If 0 is used the number is rounded down to the nearest whole number.
If a negative amount of rounding is used the figures to the left of the decimal point are rounded.
Syntax
=ROUNDDOWN(NumberToRound,DecimalPlacesToUse)
Formatting
No special formatting is needed.
ROUNDUP
Page 109 of 139
D
ROUNDUP
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Number
1.47589
1.47589
1.47589
13643.48
13643.48
13643.48
Places To Rounded
Round
Up
0
2 =ROUNDUP(C4,D4)
1
1.5 =ROUNDUP(C5,D5)
2
1.48 =ROUNDUP(C6,D6)
-1
13650 =ROUNDUP(C7,D7)
-2
13700 =ROUNDUP(C8,D8)
-3
14000 =ROUNDUP(C9,D9)
What Does It Do ?
This function rounds a number up to a specified amount of decimal places.
If 0 is used the number is rounded up to the nearest whole number.
If a negative amount of rounding is used the figures to the left of the decimal point are rounded.
Syntax
=ROUNDUPNumberToRound,DecimalPlacesToUse)
Formatting
No special formatting is needed.
SECOND
Page 110 of 139
C
Number
10/Sep/15 09:58:14
12:00:00 PM
0.50
0.51
1.51
Second
14
0
0
24
24
SECOND
=SECOND(C4)
=SECOND(C5)
=SECOND(C6)
=SECOND(C7)
=SECOND(C8)
Duration
0:01:08
0:02:03
0:01:47
0.01
Billed Duration
Minutes
Seconds
Cost
1
10
0.70
2
5
1.25
1
50
1.10
=CEILING(SECOND(C36),5)
SIGN
Page 111 of 139
Value
10
20
0
-10
-20
Positive or
Negative
1
1
0
-1
-1
SIGN
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
=SIGN(C4)
=SIGN(C5)
=SIGN(C6)
=SIGN(C7)
=SIGN(C8)
What Does It Do ?
This function tests a value to determine whether it is positive or negative.
If the value is positive the result is 1.
If the value is negative the result is -1.
If the value is zero 0 the result is 0.
Syntax
=SIGN(CellToTest)
The CellToTest can be a cell or a calculation.
Formatting
No special formatting is needed.
SMALL
Page 112 of 139
D
SMALL
Values
120
800
100
120
250
Lowest Value
2nd Lowest Value
3rd Lowest Value
4th Lowest Value
5th Lowest Value
100
120
120
250
800
=SMALL(C4:C8,1)
=SMALL(C4:C8,2)
=SMALL(C4:C8,3)
=SMALL(C4:C8,4)
=SMALL(C4:C8,5)
What Does It Do ?
This function examines a list of values and picks the value at a user specified position
in the list.
Syntax
=SMALL(ListOfNumbersToExamine,PositionToPickFrom)
Formatting
No special formatting is needed.
Example
The following table was used to calculate the bottom 3 sales figures between Jan, Feb and Mar.
Sales
North
South
East
West
Jan
5,000
5,800
3,500
12,000
Lowest Value
2nd Lowest Value
3rd Lowest Value
Feb
6,000
7,000
2,000
4,000
Mar
4,500
3,000
10,000
6,000
2,000
3,000
3,500
=SMALL(D24:F27,1)
=SMALL(D24:F27,2)
=SMALL(D24:F27,3)
Note
Another way to find the Highest and Lowest values would have been to use
the =MAX() and =MIN() functions.
Highest
Lowest
12,000
2,000
=MAX(D24:F27)
=MIN(D24:F27)
1
2
3
4
5
6
7
8
SOUTH
Page 113 of 139
A
B
C
D
E
Southern data.
Used by the example for the =INDIRECT() function.
Alan
Bob
Carol
Total
Jan
100
400
700
1200
Feb
200
500
800
1500
Mar
300
600
900
1800
Total
600
1500
2400
4500
STDEV
Page 114 of 139
STDEV
Values
10
10
9
10
Values
10
10
11
10
Values
10
11
9
12
0.5
=STDEV(C4:C7)
0.5
=STDEV(E4:E7)
1.2909944
=STDEV(G4:G7)
What Does It Do ?
This function calculates the sample population standard deviation of a list of values.
A sample population is used when the list of values represents a sample of a population.
Syntax
=STDEV(Range1,Range2,Range3 through to Range30)
Formatting
No special formatting is needed.
Example
The table below was used by a company interested in buying a new machine
to pack washing powder.
Three machines were short listed and allow to run for a day.
At the end of the day four boxes of soap powder were picked at random from the production
of each machine.
The boxes were weighed and the =STDEV() function used as these boxes only represented
a sample of the complete days production.
The machine with the smallest deviation was the most consistent.
Machine 1
Machine 2
Machine 3
0.0500
=STDEV(D34:G34)
=STDEV(D35:G35)
=STDEV(D36:G36)
=MIN(H34:H36)
STDEVP
Page 115 of 139
STDEVP
Values
10
10
9
10
Values
10
10
11
10
Values
10
11
9
12
0.433013
=STDEVP(C4:C7)
0.433013
=STDEVP(E4:E7)
1.118034
=STDEVP(G4:G7)
What Does It Do ?
This function calculates the standard deviation of a list of values.
The result is calculated on the basis that the values represent the entire population.
Syntax
=STDEVP(Range1,Range2,Range3 through to Range30)
Formatting
No special formatting is needed.
Example
The table below was used by a company interested in buying a new machine
to pack washing powder.
A trial run of just four boxes per machine were produced.
The boxes were weighed and the =STDEVP() function used as these boxes
represented the entire test run.
The machine with the smallest variance was the most consistent. ????????????????????
Machine 1
Machine 2
Machine 3
0.0433
=STDEVP(D32:G32)
=STDEVP(D33:G33)
=STDEVP(D34:G34)
=MIN(H32:H34)
SUBSTITUTE
Page 116 of 139
C
SUBSTITUTE
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Old Text
New Text
Original Text
To Remove To Insert
Updated Text
ABCDEF
CD
hello
ABhelloEF
=SUBSTITUTE(B4,C4,D4)
ABCDABCD
CD
hello
ABhelloABhello =SUBSTITUTE(B5,C5,D5)
Northern Region
Region
Area
Northern Area =SUBSTITUTE(B6,C6,D6)
Sand and Cement
and
&
S& & Cement =SUBSTITUTE(B7,C7,D7)
Old Text
New Text
Original Text
To Remove To Insert
ABCABCABC
ABC
hello
Sand and Cement
and
&
Instance To
Be Replaced
3
2
Updated Text
ABCABChello
Sand & Cement
=SUBSTITUTE(B10,C10,D10,E10)
=SUBSTITUTE(B11,C11,D11,E11)
What Does It Do ?
This function replaces a specified piece of text with a different piece of text.
It can either replace all occurrences of the text, or a specific instance.
The function is case sensitive.
Syntax
=SUBSTITUTE(OriginalText,TextToRemove,TextToInsert,InstanceToUse)
The InstanceToUse is optional, if it is omitted all instances will be substituted.
Formatting
No special formatting is needed.
Note
To cope with upper or lower case in the substitution you can use other text functions
such as =UPPER(), =LOWER() or =PROPER() to ensure that the substitution will take place.
Table 1 shows how differing text cases alter the result of the substitution.
Table 1
Original Text
Northern Region
Northern region
Northern Region
Northern Region
Northern Region
Old Text
New Text
To Remove To Insert
Updated Text
Region
Area
Northern Area
Region
Area
Northern region
region
Area
Northern Region
Region
area
Northern area
region
area
Northern Region
=SUBSTITUTE(B39,C39,D39)
Table 2 shows how the =PROPER() function has been used to take account of the mixed cases.
Table 2
Original Text
Northern Region
Northern region
Northern Region
Northern Region
Northern Region
Old Text
New Text
To Remove To Insert
Region
Area
Region
Area
region
Area
Region
area
region
area
Updated Text
Northern Area
Northern Area
Northern Area
Northern Area
Northern Area
SUBSTITUTE
Page 117 of 139
C
D
E
F
G
=SUBSTITUTE(PROPER(B50),PROPER(C50),PROPER(D50))
SUM
Page 118 of 139
200
300
600
=SUM(C4:E4)
600
=SUM(C13,D14,E13)
SUM
Horizontal
100
Vertical
100
200
300
600
=SUM(C7:C9)
Single Cells
100
300
200
Multiple Ranges
100
200
3000
400
500
600
4800
=SUM(C17:C19,E17:E19)
400
500
600
800
=SUM(AVERAGE(C23:C25),MAX(E23:E25))
Functions
100
200
300
What Does It Do ?
This function creates a total from a list of numbers.
It can be used either horizontally or vertically.
The numbers can be in single cells, ranges are from other functions.
Syntax
=SUM(Range1,Range2,Range3... through to Range30).
Formatting
No special formatting is needed.
Note
Many people use the =SUM() function incorrectly.
This example shows how the SUM has been combined with plus + symbols.
The formula is actually doing more work than needed.
It should have been entered as either =C48+C49+C50 or =SUM(C48:C50).
100
200
300
600
=SUM(C48+C49+C50)
=SUM(C48:C50)
=C48+C49+C50
Wrong!
Correct
Correct
SUM_as_Running_Total
Page 119 of 139
D
Month
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
Sales
10
50
30
20
Running
Total
10
60
90
110
110
110
110
110
110
110
110
110
=SUM($D$7:D7)
=SUM($D$7:D8)
=SUM($D$7:D9)
=SUM($D$7:D10)
=SUM($D$7:D11)
=SUM($D$7:D12)
=SUM($D$7:D13)
=SUM($D$7:D14)
=SUM($D$7:D15)
=SUM($D$7:D16)
=SUM($D$7:D17)
=SUM($D$7:D18)
Type the formula =SUM($D$7:D7) in cell E7 and then copy down the table.
It works because the first reference uses dollar symbols $ to keep $D$7 static
as the formula is copied down. Each occurrence of the =SUM() then adds all
the numbers from the first cell down.
The function can be tidied up to show 0 zero when there is no adjacent value
by using the =IF() function.
Month
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
Sales
10
50
30
20
Running
Total
10
60
90
110
0
0
0
0
0
0
0
0
=SUM(IF(D7,$D$7:D7,0))
=SUM(IF(D8,$D$7:D8,0))
=SUM(IF(D9,$D$7:D9,0))
=SUM(IF(D10,$D$7:D10,0))
=SUM(IF(D11,$D$7:D11,0))
=SUM(IF(D12,$D$7:D12,0))
The =SUM() only takes place when
there is data in column D.
Otherwise the value 0 zero is entered.
SUM_with_OFFSET
Page 120 of 139
D
C
D
is then totalled.
SUM_with_OFFSET
Page 121 of 139
E
1500
10
400
500
600
700
=SUM(OFFSET(E57,0,1):OFFSET(E57,0,3))
The cell E57 has been used as the starting point for both offsets, the first offset is
offset by 1 column, the second by 3 columns. The result is the range F57:H57 which
is then totalled.
Example
The following table shows five months of data.
To calculate the total of a specific group of months the =OFFSET() function has been used.
The Start and End dates entered in cells F71 and F72 are used as the offset to produce
a range which can be totalled.
Type in the Start month.
Type in the End month.
Feb-98
Mar-98
Total
900
Jan-98
10
Feb-98
400
Mar-98
500
Apr-98
600
May-98
700
1020
15
20
1000
2000
3000
13
5
3
10
800
900
=SUM(OFFSET(D79,0,MONTH(F71)):OFFSET(D79,0,MONTH(F72)))
Explanation
The following formula represent a breakdown of what the =OFFSET function does.
The formula displayed below are only dummies, but they will update as you enter
dates into cells F71 and F72.
Formula 1 =SUM( OFFSET(D79,0,MONTH(F71)) : OFFSET(D79,0,MONTH(F72)) )
This is the actual formula entered by the user.
Formula 2 =SUM( OFFSET(D79,0,MONTH(2)) : OFFSET(D79,0,MONTH(3)) )
This shows how the =MONTH function calculates the month number.
In this example the values of the months are 2 and 3 for Feb and Mar.
These values are the 'offsets' relative to cell D79.
Formula 3 =SUM( OFFSET(D79,0,2) : OFFSET(D79,0,3) )
This shows where the month numbers are used in the =OFFSET function.
Formula 4 =SUM( F79:G79 )
This shows how the =OFFSET eventually equates to cell addresses
to be used as a range for the =SUM function.
SUMIF
Page 122 of 139
Item
Brakes
Tyres
Brakes
Service
Service
Window
Tyres
Tyres
Clutch
Date
1-Jan-98
10-May-98
1-Feb-98
1-Mar-98
5-Jan-98
1-Jun-98
1-Apr-98
1-Mar-98
1-May-98
Cost
80
25
80
150
300
50
200
100
250
SUMIF
service
160
325
1000
=SUMIF(C4:C12,"Brakes",E4:E12)
=SUMIF(C4:C12,"Tyres",E4:E12)
=SUMIF(E4:E12,">=100")
450
=SUMIF(C4:C12,E18,E4:E12)
What Does It Do ?
This function adds the value of items which match criteria set by the user.
Syntax
=SUMIF(RangeOfThingsToBeExamined,CriteriaToBeMatched,RangeOfValuesToTotal)
=SUMIF(C4:C12,"Brakes",E4:E12)
=SUMIF(E4:E12,">=100")
Formatting
No special formatting is needed.
SUMPRODUCT
Page 123 of 139
D
Sold
5
2
3
price
100
10
2
SUMPRODUCT
Item
Tyres
Filters
Bulbs
526
=SUMPRODUCT(D4:D6,E4:E6)
What Does It Do ?
This function uses at least two columns of values.
The values in the first column are multipled with the corresponding value in the second column.
The total of all the values is the result of the calculation.
Syntax
=SUMPRODUCT(Range1, Range, Range3 through to Range30)
Formatting
No special formatting is needed.
Example
The following table was used by a drinks merchant to keep track of stock.
The merchant needed to know the total purchase value of the stock, and the potential
value of the stock when it is sold, takinging into account the markup percentage.
The =SUMPRODUCT() function is used to multiply the Cases In Stock with the Case Price to
calculate what the merchant spent in buying the stock.
The =SUMPRODUCT() function is used to multiply the Cases In Stock with
the Bottles In Case and the Bottle Setting Price, to calculate the potential value of the
stock if it is all sold.
Product
Red Wine
White Wine
Champagne
Beer
Lager
Cases In
Stock
10
8
5
50
100
Case
Price
120.00
130.00
200.00
24.00
30.00
Bottles
In Case
10
10
6
12
12
Bottle
Cost
Markup
12.00
25%
13.00
25%
33.33
80%
2.00
20%
2.50
25%
=D39/E39
Bottle Selling
Price
15.00
16.25
60.00
2.40
3.13
=F39+F39*G39
7,440.00 =SUMPRODUCT(C35:C39,D35:D39)
9,790.00 =SUMPRODUCT(C35:C39,E35:E39,H35:H39)
2,350.00 =E44-E43
T
Page 124 of 139
D
Cell To Test
Hello
10
1-Jan-98
Result
Hello
T
=T(D4)
=T(D5)
=T(D6)
=T(D7)
What Does It Do ?
This function examines an entry to determine whether it is text or not.
If the value is text, then the text is the result of the function
If the value is not text, the result is a blank.
The function is not specifically needed by Excel, but is included for compatibility with
other spreadsheet programs.
Syntax
=T(CellToTest)
Formatting
No special formatting is needed.
TEXT
Page 125 of 139
Original
Number
10
10
10
10
10.25
10.25
Converted
To Text
10.00
10.00
10
10
10.3
10.3
TEXT
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
=TEXT(C4,"0.00")
=TEXT(C5,"0.00")
=TEXT(C6,"0")
=TEXT(C7,"0")
=TEXT(C8,"0.0")
=TEXT(C9,"0.0")
What Does It Do ?
This function converts a number to a piece of text.
The formatting for the text needs to be specified in the function.
Syntax
=TEXT(NumberToConvert,FormatForConversion)
Formatting
No special formatting is required.
TIME
Page 126 of 139
Hour
14
14
14
Minute
30
30
30
Second
59
59
59
Time
14:30:59
2:30:59 PM
0.60485
TIME
=TIME(C4,D4,E4)
=TIME(C5,D5,E5)
=TIME(C6,D6,E6)
TIMEVALUE
Page 127 of 139
D
TIMEVALUE
Text
14:30:59
14:30:59
14:30:59
Time
0.604849537
14:30:59
2:30:59 PM
=TIMEVALUE(C4)
=TIMEVALUE(C5)
=TIMEVALUE(C6)
TODAY
Page 128 of 139
D
TODAY
Today Is
10-Sep-15
=TODAY()
Days Since
6826
6605
=TODAY()-C20
=TODAY()-C21
Note that the result is actually the number of days before todays date. To calculate
a result which includes the current date an extra 1 will need to be added.
Date
1-Jan-97
10-Aug-97
Days Since
6827
6606
=TODAY()-C28+1
=TODAY()-C29+1
Example
The following example shows the number of days from today until the year 2000.
Year 2000
01-Jan-2000
Days Until
-5731
=C36-TODAY()
TRANSPOSE
Page 129 of 139
Alan
Bob
Carol
Total
Jan
10
40
70
120
Feb
30
50
80
160
Jan
Feb
Alan
10
30
Bob
40
50
Carol
70
80
Total
120
160
TRANSPOSE
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
What Does It Do ?
This function copies data from a range, and places in it in a new range, turning it so
that the data originally in columns is now in rows, and the data originally in rows
is in columns.
The transpose range must be the same size as the original range.
23
24
To enter an array formula you must first highlight all the cells where the formula is required.
Next type the formula, such as =TRANSPOSE(A1:A5).
Finally press Ctrl+Shift+Enter to confirm it.
25
26
27
28
29
30
31
32
33
34
{=TRANSPOSE(C3:E7)}
If changes need to be made to the formula, the entire array has to be highlighted, the edits
can then be made and the Ctrl+Shift+Enter used to confirm it.
Syntax
=TRANSPOSE(Range)
Formatting
No special formatting is needed.
TRIM
Page 130 of 139
C
TRIM
Original Text
ABCD
A B C D
Alan
Jones
ABCD
Trimmed Text
ABCD
ABC D
Alan Jones
ABCD
=TRIM(C4)
=TRIM(C5)
=TRIM(C6)
=TRIM(C7)
What Does It Do ?
This function removes unwanted spaces from a piece of text.
The spaces before and after the text will be removed completely.
Multiple spaces within the text will be trimmed to a single space
Syntax
=TRIM(TextToTrim)
Formatting
No special formatting is needed.
TRUNC
Page 131 of 139
D
TRUNC
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Number
1.47589
1.47589
1.47589
-1.47589
-1.47589
13643.48
13643.48
13643.48
Precision
For
Truncated
Truncation Number
0
1 =TRUNC(C4,D4)
1
1.4 =TRUNC(C5,D5)
2
1.47 =TRUNC(C6,D6)
1
-1.4 =TRUNC(C7,D7)
2
-1.47 =TRUNC(C8,D8)
-1
13640 =TRUNC(C9,D9)
-2
13600 =TRUNC(C10,D10)
-3
13000 =TRUNC(C11,D11)
What Does It Do ?
This function removes the decimal part of a number, it does not actually round the number.
Syntax
=TRUNC(NumberToTuncate,Precision)
Formatting
No special formatting is needed.
UPPER
Page 132 of 139
C
Original Text
alan jones
bob smith
carOl wiLLiamS
cardiff
abc123
Upper Case
ALAN JONES
BOB SMITH
CAROL WILLIAMS
CARDIFF
ABC123
UPPER
=UPPER(C4)
=UPPER(C5)
=UPPER(C6)
=UPPER(C7)
=UPPER(C8)
What Does It Do ?
This function converts all characters in a piece of text to upper case.
Syntax
=UPPER(TextToConvert)
Formatting
No special formatting is needed.
Example
See the example for FREQUENCY.
VALUE
Page 133 of 139
C
VALUE
Text Containing A Number
Annual turnover was 5000
Value
Err:502 =VALUE(MID(C4,SEARCH("",C4),99))
#VALUE!
#VALUE!
#VALUE!
#VALUE!
")),4))
=VALUE(MID(C14,SEARCH("??:??",C14),5))
=VALUE(MID(C15,SEARCH("??:??",C15),5))
=VALUE(MID(C16,SEARCH("??:??",C16),5))
=VALUE(MID(C17,SEARCH("??:??",C17),5))
What Does It Do ?
This function converts a piece of text which resembles a number into an actual value.
If the number in the middle of a long piece of text it will have to be extracted using other
text functions such as =SEARCH(), =MID(), =FIND(), =SUBSTITUTE, =LEFT() or =RIGHT().
Syntax
=VALUE(TextToConvert)
Formatting
No special formatting is needed.
The result will be shown as a value, based upon the original text.
If the sign is included in the text it will be ignored.
If the % sign is included in the text, the result will be a decimal fraction which can then
be formatted as a percentage.
If the original text format appears as a time hh:mm the result will be a time.
The same will be true for other recognised formats.
#VALUE!
#VALUE!
#VALUE!
=VALUE(MID(SUBSTITUTE(C52," ","
"),SEARCH("???%",SUBSTITUTE(C52," ","
")),4))
VLOOKUP
Page 134 of 139
D
VLOOKUP
The column numbers are not needed.
they are part of the illustration.
col 1
col 2
col 3
col 4
col 5
col 6
Jan
Feb
Mar
10
80
97
20
90
69
30
100
45
40
110
51
50
120
77
Feb
4
100
=VLOOKUP(G11,C6:H8,G12,FALSE)
What Does It Do ?
This function scans down the row headings at the side of a table to find a specified item.
When the item is found, it then scans across to pick a cell entry.
Syntax
=VLOOKUP(ItemToFind,RangeToLookIn,ColumnToPickFrom,SortedOrUnsorted)
The ItemToFind is a single item specified by the user.
The RangeToLookIn is the range of data with the row headings at the left hand side.
The ColumnToPickFrom is how far across the table the function should look to pick from.
The Sorted/Unsorted is whether the column headings are sorted. TRUE for yes, FALSE for no.
Formatting
No special formatting is needed.
Example 1
This table is used to find a value based on a specified name and month.
The =VLOOKUP() is used to scan down to find the name.
The problem arises when we need to scan across to find the month column.
To solve the problem the =MATCH() function is used.
The =MATCH() looks through the list of names to find the month we require. It then calculates
the position of the month in the list. Unfortunately, because the list of months is not as wide
as the lookup range, the =MATCH() number is 1 less than we require, so and extra 1 is
added to compensate.
The =VLOOKUP() now uses this =MATCH() number to look across the columns and
picks out the correct cell entry.
The =VLOOKUP() uses FALSE at the end of the function to indicate to Excel that the
row headings are not sorted.
Bob
Eric
Alan
Carol
David
Jan
10
20
30
40
50
Feb
80
90
100
110
120
Mar
97
69
45
51
77
VLOOKUP
Page 135 of 139
eric
mar
The result is :
69
=VLOOKUP(F56,C50:F54,MATCH(F57,D49:F49,0)+1,FALSE)
Example 2
This example shows how the =VLOOKUP() is used to pick the cost of a spare part for
different makes of cars.
The =VLOOKUP() scans down row headings in column F for the spare part entered in column C.
When the make is found, the =VLOOKUP() then scans across to find the price, using the
result of the =MATCH() function to find the position of the make of car.
The functions use the absolute ranges indicated by the dollar symbol . This ensures that
when the formula is copied to more cells, the ranges for =VLOOKUP() and =MATCH() do
not change.
Maker
Vauxhall
VW
Ford
VW
Ford
Ford
Vauxhall
Ford
Spare
Ignition
GearBox
Engine
Steering
Ignition
CYHead
GearBox
Engine
Cost
Lookup Table
50
Vauxhall
Ford
VW
600
GearBox
500
450
600
1,200
Engine
1000
1200
800
275
Steering
250
350
275
70
Ignition
50
70
45
290
CYHead
300
290
310
500
1,200
=VLOOKUP(C81,F75:I79,MATCH(B81,G74:I74,0)+1,FALSE)
Example 3
In the following example a builders merchant is offering discount on large orders.
The Unit Cost Table holds the cost of 1 unit of Brick, Wood and Glass.
The Discount Table holds the various discounts for different quantities of each product.
The Orders Table is used to enter the orders and calculate the Total.
All the calculations take place in the Orders Table.
The name of the Item is typed in column C of the Orders Table.
The Unit Cost of the item is then looked up in the Unit Cost Table.
The FALSE option has been used at the end of the function to indicate that the product
names down the side of the Unit Cost Table are not sorted.
Using the FALSE option forces the function to search for an exact match. If a match is
not found, the function will produce an error.
=VLOOKUP(C126,C114:D116,2,FALSE)
The discount is then looked up in the Discount Table
If the Quantity Ordered matches a value at the side of the Discount Table the =VLOOKUP will
look across to find the correct discount.
The TRUE option has been used at the end of the function to indicate that the values
down the side of the Discount Table are sorted.
Using TRUE will allow the function to make an approximate match. If the Quantity Ordered does
not match a value at the side of the Discount Table, the next lowest value is used.
Trying to match an order of 125 will drop down to 100, and the discount from
VLOOKUP
Page 136 of 139
B
C
D
E
F
G
the 100 row is used.
=VLOOKUP(D126,F114:I116,MATCH(C126,G113:I113,0)+1,TRUE)
Item
Brick
Wood
Glass
Brick
Wood
Glass
Units
100
200
150
225
50
500
Discount Table
Brick
Wood
Glass
1
0%
0%
0%
100
6%
3%
12%
300
8%
5%
15%
Orders Table
Unit Cost Discount
2
6%
1
3%
3
12%
2
6%
1
0%
3
15%
Total
188
194
396
423
50
1,275
127
128
129
130
131
Formula for :
Unit Cost =VLOOKUP(C126,C114:D116,2,FALSE)
Discount =VLOOKUP(D126,F114:I116,MATCH(C126,G113:I113,0)+1,TRUE)
Total
=(D126*E126)-(D126*E126*F126)
WEEKDAY
Page 137 of 139
Date
Thu 01-Jan-98
Thu 01-Jan-98
Thu 01-Jan-98
Thu 01-Jan-98
Thu 01-Jan-98
Weekday
5
5
5
4
3
=WEEKDAY(C4)
=WEEKDAY(C5)
=WEEKDAY(C6,1)
=WEEKDAY(C7,2)
=WEEKDAY(C8,3)
WEEKDAY
WORKDAY
Page 138 of 139
D
StartDate
1-Jan-98
1-Jan-98
Days
28
28
Result
35836
10-Feb-98
WORKDAY
=WORKDAY(D4,E4)
=WORKDAY(D5,E5)
Bank Holiday
Xmas
New Year
New Year
New Year
Holidays
Fri 01-May-98
Fri 25-Dec-98
Wed 01-Jan-97
Thu 01-Jan-98
Fri 01-Jan-99
Delivery Days
2
28
Delivery Date
Wed 04-Feb-98
Tue 26-Jan-99
=WORKDAY(D25,E25,D28:D32)
YEAR
Page 139 of 139
Date
###
Year
1998
=YEAR(C4)
YEAR