Professional Documents
Culture Documents
Excel Formula
Excel Formula
The most used functions in Excel are the functions that count and sum You can count and sum based on one
cnteraa or multJpIe crrterJa.
Count
To count the number of cells that contain numbers, use the COUNT function.
.7
10 C
" 0
:COUNT(Al:A5)
E F G H
1
2 1
3 7
4 20
5 3
6
7 5
j
Countif
To count cells based on one crrteria (for example, higher than 9), use the followlrlQ COUNTIF function
.7 =COUNTIF(Al:A5, ~>9")
1
101 C 0 E F G H
2 1
3 7
4 20
5 3
6
7 I 21
I
Countifs
To count cells based on multiple crrteria (for example, green aOO higher than 9), use the following COUNTIFS
fuoc"""
1 ,.d
10
C o E F G H
2 green 1
3 'ed 7
4 reen 20
5 ,ed 3
6
;I 11
Sum
To sum a range of cells, use the SUM fuoctJon.
.7
10 8 C
" 0
=SUMjAl:A5)
E F G H
1
,2 1
7
4
5
20
,
7 1 41 1
8
Sumi!
To Sl.Wll eels based on one c",ern (for example, hIghef than 9), use the folawng SUMIF tt..'ctJOn (two gtmenls)
87
A 8 C
" 0
-:SUMIF(81:65, ">i~)
E F G H
1 10
,
2 1
7
4
5 ,
201
7 ",I
8
To s...n eels based on one cntena (lor ex~ green), use the IoIcrNJng SUMlF fooctJon (three argo.nenls. last
ar~ IS the rcroge 10 5l,1"li)
87 ~ =SUMIF(A l :A5,"green~,Bl:85)
A 8 C o E F G H
1 eed 10
,2 ree n
eed
11
7
,
4 ree n
,ed ,
20
~I
21 1
Sumifs
To sum cells based on muttlple crrteria (for example, blue and green), use the following SUMIFS fuoctJon (first
argument IS the range to sum)
A 8 C 0 E F G H
1 blue 'ed 10
,
2 vello w
blue
green
,ed
1
7
,
4 blue
yellow ,ed
reen
,
20
~I
20 1
General note. In a similar way, you can use the AVERAGEIF and AVERAGEIFS function to average cells based on
one or multJpIe crrteria_
Count Text Occurrences
ThIS example teaches you how to count the number of occurrences of text in a rarge
For example, to count the number of cells that contain exactly star
A'
A B C
" 0
=COUNTI F( A l :A7, "star")
E F G H
1 star
2 moon
3 stars
4 ,
5 star
6 star
7 star12
,
B
21
IO j
2. For example, to count the number of cells that contain exactly star + 1 character A question marll (7) matches
exactly one character
A B C 0 E F G H
1 star
,
2 moon
4
stars
,
5 star
6 star
7 star12
B
'po
10
3 For example, to count the number of cells that contain exactly star + a series of zero or more characters An
asterisk (') matches a series of zero or more characters
A B C 0 E F G H I
1 star
,2 moon
4
stars
,
5 star
6 star
7 star12
,
8
~!
10 1
4 For example, to count the number of cells that contain star In any way No matter what is before or after star, thIS
function firds all the cells that contain star in any way
A B C 0 E F G H
1 star
,
2 moon
stars
,I
,
4
, star
star
7 star12
8
'po
10
A B C 0 E F G H
1 star
2 moon
3 stars
,
,
4
, star
star
7 star12
8
I _--,'I
' t-
10 1
Count Logical Values
learn how to count the number of cells that cootain logICal values (TRUE and FALSE ) in Excel.
A9 f. =COUNTIF(Al:A7, TRUE)
A 8 C 0 E F G H
1 5
2 TRUE
3
4 '""
FALSE
5 TRUE
6
7 moon
8
,I ,I
IOJ
2. For example, to count the number of cells that contain FALSE
A B C 0 E F G H
1 5
, '""
2 TRUE
4 FALSE
5 TRUE
6
7 moon
,
8
1
10 1
3. For ex ample, to count the number of cells that contain TRUE or FALSE
A B C 0 E F G H
1 5
, '""
2 TRUE
4 FALSE
5 TRUE
6
7 moon
8
,I ,I
10 1
Count BlankiNonblank Cells
ThIS example shows you how to count the number of blank and nonblank cells In Excel
A9 fz =COUNTBLANK(A l :A 7)
, C 0 , F G H
1 2
2
3 moon'""
4 TRUE
,
5
7
,7 5
, 1
10 1
2 The COUNTA functIOn counts the number of IlOIlbiank cells. COUNTA stands for count all
., fz =COUNTA(Al:A7)
, C 0 , F G H
1 2
2
3 moon'""
4 TRUE
,
5
7
,
7 5
,I ,I
10 1
Sumproduct
To calculate the sum of the products of corresponding numbers In one or more ranges , use Excers powerful
SUMPRODUCT fuoction
For example, the SUMPRODUCT fuoction below calculates the total amount spent
C7 =SUMPRODUCT(B2:8S,C2:C5)
A 8 C o E F G H
1 Product Quantity Price
,
2 Computer
Keyboard
2
4
1000
250
4 Mouse 4 100
5 Printer 2 50
6
7 Total 3500 1
8
Note the SUMPRODUCT function performs this cak:ulation_(2 ' 1000) + (4 250) + (4 ' 100) + (2' 50) = 3500
2 The raoges must have the same dimenstons or Ex cel will display the INALUE! error
3. The SUMPRODUCT function treats any entries that are not numeric as if they were zeros
A B C o , F G H
1 Product Quant ity Pri ce
2 Compu ter 2 1000
3 Keybo ard 4 hi
4 Mouse 4 t h ere
5 Print er 2 50
6
7 To ta l
8
Logical Functions
If Function I And FunctlOll I Or FunctJOll
Learn how to use Ex cel's logICal functIOns such as the IF, AND and OR functlOn_
If Function
The IF function checks whether a coodrtlOlllS met, and returns one value if TRU E and another value if FALS E
(1 : IF(Al>10,"Correct", "Incorrect")
A B ( D E F G H
!
:I 12 31correct
The IF function returns Correct because the value in cell AI is higher than 10
And Function
The AND Function returns TRUE if all cond~ions are true and returns FALSE if any of the conditions are false
01
A B C
" =1 F( ANO(Al>10,Bl>5j, "Correct~, "Incorrect")
D E F G H
I
:J 12 3 Correct I Inco rrect
The AND function returns FALSE because the value in cell 82 is not higher than 5 As a resutt the IF function returns
Incorrect
Or Function
The OR function returns TRUE if any of the conditions are TRUE and returns FALSE if all condittons are false
A B c D E F G H
12 3 Correct Inco rrect Icorrect J
The OR function returns TRUE because the value In cell AI IS higher than 10 As a resuH the IF function returns
CorrecL
General note. the AND and OR function can check up to 255 conditions
Nested If
The IF fuoction in Excel can be nested, when you have multJpIe conditions to meet The FALSE value is being
replaced by another IF functton to make a further test
., :IFt Al=l. "Sad~, IF(Al=2, "Good" ,IF( Al:3, "Excellent~, ~ No Va lid Score~)))
A c o E F G H
1
2
!
1b. If cell AI equals 2, the formula returns Good
81 =IF(Al=l , "Sad~,IF(A l=2, "Good" ,IF( Al=3, "Excellent", ~No Valid Score~)))
A 8 c o E F G H
:] !
Ie. If cell AI equals 3, the formula returns Excellent
A 8 c o E F G H
~ I A 8
siNo Valid Score 1
c o E F G H
A 8 c o E F G H
1 ' LI_ -,'50",!
2
2b If cell AI IS greater than 10 and less or equal to 20, the formula returns 700
A
7OO! C 0 E F G H
~I
121
A
7001 C 0 E F G H
:I "I
2c If cel A 115 greater than 20 and less or ~ 10 30, the forrrUa returns '<$00
A
c o E F G H
:I
2d If cell A' IS greater than 30, the formula returns 2000
A
00
S4I _ ",20"",!
c o E F G H
:I L
NOIe to slightly change the boundaries, you ITIQht want 10 use "<" nstead of "<="., yOU' 0'NI1 forrrula
Ifs
Use the IFS function in Excel 2016 when you have multiple conditions to meet The IFS function returns <I value
corresponding to the first TRUE conditton
Note if you don', have Excel 2016, you can nest the IF /uoction.
A 8 c o E F G H
:1
'''81' '.d'---_!
lt1 If cell AI equals 2, the IFS function returns Good.
., :IFS{Al :l, "Bad",Al:2, "Good",Al :3, "Excellent~, TRUE, "No Va lid Score")
A c o E F G H
!
Ie. If ceU AI equals 3, the IFS functIOn returns Excellent
A c o E F G H
ld. If cell AI equals another value, the IFS fur.ction returns No Valid Score
., =IFS{Al =l, ~Bad" ,Al:2, "GoOd",Al :3, "Excellent",TRUE, "No Valid SCore")
A c o E F G H
siNo Va li d SCore 1
:J
Note instead of TRUE, you can also use 1=1 or something else that IS always TRUE
2a. If cell AI is less or equal to 10, the IFS function returns 350
A
61_--=0:.
L.
350 1
c o E F G H
:1
2b If cell AI IS greater than 10 and less or equal to 20, the IFS function returns 700
1
A
121
7001 C 0 E F G H
A
C 0 E F G H
:I 201 700 1
2c. If cell AI is greater than 20 and less or equal to 30, the IFS function returns 1400
1
A
27LI_ , , 400,, j
c o E F G H
2d_If cell AI IS greater than 30, the IFS functlOfl returns 2000
., =IFS(A2<:10,350,A2<=20,700,A2<=30,1400,A2>30,2000)
,.1
A c o E F G H
2(MlO I
L._ - " ' : :.
Note to slightly change the boundarIeS , you rrngh\ want to use ""," instead of""'=" in your own functlOfl_
Switch
This example teaches you how to use the SWITCH function in Excel 2016 instead of the IFS function
la_For example, the IFS function below finds the correct states
=IFS( RtGHT( A2. 21 =~ur ~Utah~. RIG HT(A2.2)="TX", "TeKaS" ,RIG HT(A2, 2) =" O H". ~OhiO~. TRUE, ~?"J
A , C D E F G H
1 Cod. State
I
2 85- UT IUtah
3 192-TX Texas
4 6-0H Ohio
5 74-'" Texas
6 18-UT Utah
7 23-0H Ohio
,
8 12S-TX
480-0H
Texas
Ohio
10 91-XR ?
11 37-TX Texas
12
Explanatton cell A2 contains the string 85-UT The RIGHT luncllon extracts the 2 rightmost characters from thIS
string (UT) As a resuH, the IFS function returns the correct state (Utah) lIthe 2 nghtmost characters are not equal
to UT, TX or OH, the IFS funcllon returns a question mark Instead 01 TRUE , you can also use 1=1 or something
else that IS always TRUE
lb The SWITCH functlOl1 below produces the exact same resuH but IS much easier to read
82 =SW1TCH( R1GHT(A2,2), ~ur, ~Utah" , "TX~ ,"T exas~, "OH", ~OhIO", ~?~)
A 8 C 0 , F G H
1 leod. State
2 85-UT IUtah I
3 192-TX Texa5
4 6-0H Ohio
5 74-TX Texa5
6 18-UT Utah
7 23-0H Ohio
,8 12S-TX
480-0H
Texa5
Ohio
10 91-XR ?
11 37-TX Texas
12
Explanallon if the first argument (RIGHT(A2,2) in this example) equals UT, the SWITCH function returns Utah II TX,
Texas. II OH, OhIO The last argument (a questlOl1 mark In thiS example) IS always the delauH value (if there's no
match)
2 Why not always use the SWITCH function in Excel? There are many ex amples where you cannot use the
SWITCH function instead of the IFS function
2 Why not always use the SWITCH functton In EJ(cel? 11lere are many e~amples where you cannot use the
SWITCH functton II'lStead of the IFS functton.
o ,
:I A 8
_-"",SO!
6'LI
C F G H
EJcplana!lon because we use"<=" and">" symbols III this IFS funcbOn, we carJOOI use the SWITCH funcbOn.
Excel ~
Note the rostrucbons below do not teach you how to format the worksheet We assume that you know how to
ch!wlge IonI SIZes. font styles, nsert rows and cUm!;, add borders, change bockground colors , etc
I At the moment , each eel conlalns the letter I (as lillian) With a WIIlgIings Ion! style, these rs klok like dOO;
C3
A 8 C 0 E F G H J k L M N
1
,
4
5
~j
....
C2 ::RANDBfTWEEN( 1,6)
AB C DEFGH J K 1 M N
1
2 .1
3
4
,
6
2 6
, ~l
4
5
6
7
,
10
4 Enter the formula shown below Into the red cells If we roll 4, 5 or 6, these cells should contain a dot
A B
1
2 6
4
5
6
7
,
10
5 Enter the formula shown below Into the blue ce lls If we roll 6, these cells shoukl contain a dol
A B c D E F G H J K l M N
1
2
l
4
5
,
1D
6. Enter the formula shown below Into the gray cell If we rollI , 3 or 5, thiS cell shoukl contain a dot
1
A
c o E F G H J K l M N
,
4
,
10
8. Change the font color of cell C2 and cell G2 to green (so the numbers are not VISible)
ResuH_
9 Click the command button on the sheet (or press F9)
ResuH_
ABC D E F G H J , l M N
1
4
5
6
7
Cell references In Excel are ~ery Important Understand the difference between relative, absolute and mIXed
reference, and you are on your w~ to success
Relative Reference
By defauR, Excel uses relative reference See the formula In cell D2 below Cell D2 refereoces (points to) cell 82 and
cell C2. 80th references are relatIVe
COUNT1F )( ./ f. =B2-C2
A
1 Product
Quantity . Price
C
IAmount
0 E F G H
2 bread 1
21
1.51=82 - C2
I
3 butter 1 1.2
,
4 cheese
h.m
l
3 1.8
2
6
Select cell 02, chck on the lower nght corner of cell 02 and drag rt down to cell 05
COUNTIF
A
c o E F G H
1 Product Quantity Price Amount
,
,
2 bread
buner
2
,
1
1.5
1.2 .. 2
4 cheese
5 hom
1 ,I
2
.
1.81=85'"(5
I
Cel 03 references eel B3 and eel C3 Gel 04 references eel 84 and eel C4 Cel 05 references eel B5 and eel
C5 In ()(her words each eel references lis two neqlbofs on the left
Absolute Reference
See the fOffTlk 11 eel E3 below
1 To create an absolute reference to cell H3. place a S symbol JJ) front of the colorm letter and rf10N nurrber of cell H3
(SHSJ) ,n the formula of cell E3
COUNTIF
1
A
c o E F G H
,
2 . length Icml !Width (em)
1
11
10
ton h Inch Width Inch
"S3'" SHS3 I
Conversion rate
0.3937008 I
I
4 5 10
5 4 8
7
2 10
2 Now we can quickly drag thIS formula to the other cells_
COUNTIF x :(6*SHS3
1
A
c o E f G H
2 l'" h <m Width (cm length linchl lWidth linch) Conve rsion rate
3 1 10 0.3937008 3.937008
! 0.3937008 !
4 5 10 1.968504 3.937008
5
6
4
21
10 1
1.5748032 3.1496064
0.78740161=C6*SHS3 I
7
The reference to cell H3 is fIXed (when we drag the fonnula down and across) As a resuR. the correct lengths and
wdths In inches are calculated
Mi xed Reference
Sometimes we need a comblnallon of relallve and absolute reference (mIXed reference)
COUNTIF X =82*(1-86)
I
A C o E f G H
1 !product Price Prices I Mo nth Ja n f, b
BO I
I
2 Jeans Jeans =82*(1-86)
3 Shirts I 30 Shirts
4
5 Month IJa n Feb Mar
6 Reduction l
20% 1 40% 80%
7
2 We want to copy thiS formula to the other cells quickly Drag cell F2 across one cell, and look at the: fonrMJla In cell
02
COUNT1F
A B
" '"
C
"0 E f o H
1 Product Price Prices/ Mo nth Jan Feb Mar
2 Jeans BOI 1 Jeans
3 Shirts
Shirts
5 '"
Month f,b
Jo"
IM"
7
Reduction 20%1 -
""
Do you see what happens? The referenr::e to the pfice should be a IW:!l refefenr::e to colufm a. SoIuIlon place a S
symbol III front 01 the: colufm letter 01 eel 82 ($82) III the fOfIDlAa of eel F2 In a smlar w<Soj when we drag eel F2
doNT!. the refefenr::e to the: reduclJon should be a fiM:l;I referenr::e to row 6 Solution place a S symbol III front of the
row ffiI/TIbef 01 eel 86 (856) III the fOfTTllJla of eel F2
Resun
COUN T1F
A B
" '"
C
"0
=$82-(1-8$6)
E F 0 H
jprice F,b
1 !product
2 Jea ns
1
BOI
Prices / Mo nth
Jeans ""
=$82 -(1-B$6)
M"
'0% 1
-
F,b M"
""
Note we 000" place a S symbol WI fronl of the row ruroer of 82 (this w<Soj we aIow the feferenr::e to ch;vJge from 82
(Jeans) to 83 (Stwts) when we drag !he fomUa down). In a smlar w<Soj. we 0011" place a S symbol WI fren: of the
ccum letter 01 B6 (INs W<PI we aIow!he referenr::e 10 change from B6 (Jan) to C6 (Feb) iYld D6 (M<w) when we
drag the formula across)
3 Now we can qUICkly drag thIS formula to the other cells
x
COUNTIF
A B c
~
"
0
=583-, 1-0$6)
E F G H
1 Product
2 Jeans
Price
BO
Prices I Month
Jeans
'00 64
F,b
48
M"
16
3 !Shirts 1_--==
301 Shirts 24 181" S83-(1- 056)J
~ ~Month Jan Feb Mar
~'-1~R~'~du~ct~;~,-"F'-,-2"'
C"C:"=:~4=.
O% 'I '~~~....
~~c.;.l
For example, cell A3 below contains a formula which adds the value of cell A2 to the value of cell At
'3
C
" 0
:A1+A2
E F G H
,
:j
4
,I
4 I
When you copy this formula to cell 83 (select cell A3, press CTRL + c , select cell 83, press CTRL + v ), the formula
will automaltcally reference the values in column 8
f,. "'61+6~
OATE X
"
A
41
1
C 0 E F G H
:1
51
I
I
:1 91",61+62
If you don't want thIS but Instead want to copy the exact formula (without changWIQ the cell references), execute the
following easy steps
f,. l +A2: I
oAIT X
"
1
A
41
C 0 E F G H
2 I
51
3 ["'A1+A2 I
4j
Resu~:
ResuH_
8'
A 8 C
" 0
=Al+A2
E F G H
1
2 ,
4
,I ,I
!I
Both cell A3 and cell B3 contain the exact same formula now
3D-reference
A 3Dreference III Excel refers to the same cell or range on multiple worksheets FII'St. we'llook at the a/lematJve
X /z
COUNTIF
'"
~
A B C 0 E F G H
1 Quarterl Quarter2 Quarter 3 Quarter4
,
2 Coffee
Te.
13 !
4 Milk
5
No,," .,,' So"", t.ompany
2. Go to the North sheet, select cell 82 arod type a +
ResuK_
8'
1 ,
A 8 C 0
'" =North!B2+Mld!B2+South!B2
E F G H
, Coffee
Quarterl QUdrter2 QUdrter 3 Quarter4
$6.6241
3 T..
4 M ilk
5
North Mid 50"," Company e
4 This is qu~e a lot of woo Instead of doing this , use the following 3D -reference North-South!B2 as the argument
for the SUM function_
A 8 C 0 E F G H
1 Q uarter 1 Q uarter 2 Q u arter 3 Q u arter4
, T..
2 Co ffee $6.6241
4 M ilk
5
North Mid
""'" Company e
5. If you add worksheets between North and South, thIS worksheet IS automatically Included In the formula In cell B2_
A 8 C 0 E F G H
1 Q uarter 1 Q u arter 2 Q u arter 3 Q u arter4
, T..
2 Coffee $8,7521
4 M ilk
5
North North (2) Mid South Company e
External References
Create External Reference I Alert I Edrt links
An external reference In Excelts a reference to a cell or range of cells In another wor1o;book Below you can fwd the
wor1o;books of three divisions (North, Mid and South)
.2 . Ix 2016
~
A C 0 E F G H I
1 Quarter ! Quarter2 Quarter3 Quarter4
2 Coffee I 52,0161
$3,546 $7,019 $8,761
3 T" $1,398 $5,209 56.738 $1,816
4 Mil k $8,528 $3,837 $9,605 $2,559
5
I Sheetl , 141 I l'l
.2 Ix 2480
1 !
A
C 0
Quarter! Quarter2 Quarter3 Quarter4
E F G H I
~
2 ICOffee I 52,4801
$4,478 $7,156 $9,037
3~ ~.OO2
$9,787 $1,230 $6,529
: Mil k 58.674 $1,707 52.505 $7,144
Sheetl , I~ I I l'l
Create Externa l Reference
To create an external reference, execute the following steps
2. In the Company workbook , select cell 82 and type the equal sign =
Company - Ex(~ o x
COUNTlf x =
1 I
2 Coffee
A B c o
Quarter 1 Quarter 2 Quarter 3 Quarter 4
I~ !
E F G H I
;~ Sheetl , I
3 On the V'eN tab, in the Window group, click Swrtch Windows
~
LJ
El ~ ::5,,"
Hid"
rf'lViP 'S~byS~
[Synchronous Scrolling
N~ Arran9" fr~"
Window All Pan~ ~ D Unhid" 0i?J R~t Window Poslloon Windows ~
Window
4 Click North
~ 1 Company
,N,,"
1 Mid
4 South
5 10 the North workOOok , selec;t cellBL
t: A
X
'"
C 0
North m el
Ix
E
=[Nort h .xlSII] Sheet 1!SBS2
F G H
0 X
1 Quarter 1 Quarter2 Quarter] Quarter4
,2 Coffee
T
fQgji~
S4, ~3~
53,486
$2,148
55.'"
53,~18
S~ ,400
55,921
,
4 Milk $1,423 $4,234 55, 3]6 51, 535
Sheetl I HI )
STypea+
Resu~
Company Ex,t'l o X
ABC 0 E F G H
l tl---CC---Cac"-.'nC.-'~1-ao"-.Cnc.-,C2~a-"-."n-.,-,~ao"-.CnC.-,C4"--c---<--~--<--"c-----C"r11
2 Icoffee I $6,6241
3 Tea
,4 Milk
Sheetl
10 Copy the forfrIJa to the oIher eels
Alert
Close aU workbooks Change a number III the workbook of a d""slOIl Close all workbooks again Open the
Company workbook
.2 f. Coffee
C ,
D
1 Quarterl Quarter2 Quarter] Quarter4
, r ..
2 Co ffee $6,624
$12,339
$11,510
$17,144
$20,079
$11,886
$27,198
$14,266
4 Mil k $18,625 $9. ns $17,446 $11,238
S
I Sh ...' f IG
Note ~ you see another alert, click Update or 000'\ Update
Edit links
On the Data tab, 111 the Connections group. click Ed~ links to launch the Edrt lxIks dialog box
fIr't.. ~ ConnWlOns
ilL" ~ p
Rdresh
All. Edit Lmb
Connt(tJons ~
1 If you dldr!'t update the links, you ca n still update the links here Select a workbook and cock Update values to
update the hnks to thIS worllbook Note how the Status changes to OK
Edit Links ? x
Souret Tw' Update Stalul
M.d I1n WorhlUPI:... Ol
North.lU Wo.l(shtd A Unknown
South.ldsl( Worl:shtet
Unknown Qptn SOU"t
I Ilul: Unl:
, -----.J . . -,,,-,.-,-,-,c,-,,-.-,-'
LOCllIon: C:\lut
Itfm:
Updllt: Autom.tic Manual
I i tlrt up Pl'ompt..,
2 If ~ou don't want to display the alert and update the links automatICally, Click Startup Prompt, sele<:t the third
optlOll, and cock OK
Edrt Lrn~'
Iruk Link
, , thtck StltUI
loe"'on: C:\lfli
Ittm:
Updatt: Autom"ic Manual Startup Prompt ? x
Whtn this wOll:bool: is opfnfd, befi Uln Ilk whdhtl 01 not to
__--1 updatt lint.1 to othfrwortboot.I,
auto",";c linkl
2 If you don't want to dISplay the alert and update the links automatICally, ClICk Startup Prompt, select the third
opIlOI'I, and clICk OK
I~-----
I
0'
, Works httl A ChiI!!!!f Source ..,
,
North.lds.
South.ldu
Workshfet
Wo,kshttt
Unknown
Unknown Qpen Source
, .!:.heck Sialul
locltlon: C:\l fft
lIem:
Up4alr. automati( Stllrtup Prompt I x
1 1t.rtuP Prompl .., I When this worli;b ook is opfned, ucel (In .sk whelher or nollo
updale linlts 10 olhu workbooks,
o Ltl users (hoose 10 display Ihe lIlert or not
o Qon't dis pla1 1he alert .nd don I update .utomatlc Ilnkl
~Iallhf .Ifrt and Up4alf Ilnlts l
o. i;J Clnul
Hyperlinks
EXISting File or Web Page I Place III This Document
t a_To create a link to an exrsllng Excel file, select a file (use the look In drop-down list, if necessary )
, x
Link 10: Itid 10 display. C:\ttsl\ (ounl_loglcal_valuts ,itls.
Insert Hyperlink I X
l!l
f&Jrtll'lO File
~ook In: Itsl 3;j ~.
orWeO Pig,
("rlent
folder
co.. 3d-referenc,
copy-euctforrnul.
8.Qobn.rk. ..
Resu~
AI www.excel-easy.com
A B , C , 0 E F G H
1 Iwww(5cel-eilsy.com 1
2
3
j http://www.exce~iSY.eOfTV' - Odt once to
(olow. Odt ifld hold to select thIS eel
4
NOIe If yeo want \0 change the text thaI appears when yeo haver over the Ink. click ScreenTIp
Place in Th is Document
To create a link to a place In thIS document, execute the following steps
2 Type the Text to display, the cell reference, and click OK.
Edit Hype:rtink I X
g
P\f.{e In This
jC
f:lmriir e
U
Create Hew
Document
81
E-mail
B~mo w ~ Unk
Addrus
I 0. l)J C~nul
ResuH:
ResuH_
0'
A B c o , F G H
1 www.exce!-easy.com
2 Gotijll09
3 Bookl - Sheetll09 - Ockonce to fOIoW'1
4 lOck and hold to select thIS eel .
L--_,j
Note Jfyou want to change the text that appears when you hover over the link, click ScreenTip_
Date & Time Functions
YeafMooth.Oay I DateFl.nCboo I CUlTeoi Date & Tme I Hoor.MlnuteSecood I TmeFlMlClJOn
To enter a cIiIte III Excel. lISe the or ex "-" characters To enter a tnle_ lISe the (colon) You can also eflIer a date
and a lime If! one eel
A1 6/23/2016
A B C o E
~ \6/ 23/2016 1 6:00 6/ 23/ 20166:00
NOIe Dales are 11 US Format Months first, Days se(:ond Ttvs type 01 format depends on yoor WIIldows regonal
settJOgS learn roore about Dale and Tme formats
Year, Month, Day
To get the year of a date, use the YEAR function
., :YEAR(Al)
A c o E
,1 6/ 23/2016,------,'"0",16,,,
Note use the MONTH and DAY function to get the month and day of a date
Date Function
1 To add a number of days to a date, use the following simple formula_
., "Al+5
A c o E
2 To add a number of years, months ardlor days, use the DATE fuoction
., =OATE(YEAR(Al)+4,MONTH(Al)+2,OAY(Al)+9)
,
9/1/20201
c o E F G H
Note. the DATE fuoctton accepts three arguments year month and day Excel knows that 6 + 2 = B = August has
31 days and rolls over to the next month (23 August + 9 days = 1 September)
Current Date & Time
To get the current date and tnne, use the NOW funcbon
Al =NOW()
A B c o E
1 1 2/23/ 201710:43J
2 J
Note use the TODAY function to get the current date only Use NOW(}-TODAYO to get the current tune only (and
apply a Time format)
Bl
A B C
" =HOUR(A l )
0 E
,I
:I 6:45:171
Note. use the MINUTE and SECOND functlOll to return the rrunute and second.
Time Function
To add a number of hours, rrunutes ardlor secoods, use the TIME function.
Bl
A B C
" "'TIME(HOUR(Alj+2,MINUTE(A l )+10,SECOND(Al)+70)
o E F G H
:I 6:45:171 8:56:271
Note Excel adds 2 hours, 10 + 1 = 11 minutes and 70 - 60 = 10 secoods
DateDif
To get the number of days, weeks or yea rs between two dates in Excel, use the DATEDIF function The DATEDIF
function has three arguments
Fill in"d" for the third argument to get the number of days between two dates
A B C D E F
1 4/ 18/ 2009
2 6/ 23/2016
3
4 2623
5
Note =A2-Al produces the exact same resuR!
2. Fill In "m" for the third argument to get the number of months between two dates
1 ~
A
4/ 18/ 2009
c D E F
~ i 6/ 23/ 2016
:p
3_ Fill In "y" for the third argument to get the number of years between two dates
1
A
4/ 18/ 2009
C D E F
,
2 6/ 23/2016
4 7
5
4 Fill in"yl!' for the third argument to ignore years and get the number of days between two dates
1 ~
A
4/ 18/ 2009
c D E F
~ i 6/ 23/ 2016
41 66!
5 I
5 Fill In "md" for the third argument to Ignore months and get the number of days between two dates
A C 0 , F
1 4/ 18/2009
,2 6/ 23/ 2016
, 1I ,I
A'
A
C 0 , F
1 4/ 18/2009
,
2 6/23/2016
:P
hnportam note the DATEDIF function returns the number of complete days, months or years ThIS may give
une.pected resutts when the day/month number of the second date IS lower than the day/month number of the first
A C 0 , F
1 4/ 18/ 2009
,
2 4/ 17/ 2016
, 1 .1
The drffefence IS 6 years Amost 7 yearsl Use the foloww'lg fClfl'lUa 10 fetwl 7 years
I roe Cllnerence IS ti years Almost f years l Use the t ollowlroQ tonnula 10 retum f years
A4 =YEAR!A2)- YEAR(A1)
A
c o , F
1 ~ 4/ 18/ 2009
: 1 4/ 17/ 2016
4I 7!
,I
Weekdays
Weekday Function I Networkdays functton I Workday function
learn how to get the day of the week of a date in Excel and how to get the number of weekdays/working days
between two dates
Weekday Function
1 The WE EKDAY function In Excel returns a number from 1 (Sunday) to 7 (Saturday) representing the day of the
week of a date Apparently, 1211812017 falls on a Monday
81 =WEEKOAY(A l )
A 8 c o E , G H
1 I12/ 18/ 2017IL __--"~I
,j
2 You can also use the TEXT function to display the day of the week
81 =TEXT(A l ,~dddd~)
A 8 C o E F G H
~ 1 12/lS/201~MOnday 1
3. Create a custom date format (dddd) to display the day of the week
Al 12/1S/2017
A 8 C o E F G H
1 1
\- ---",M",O"",d!!laVl
2 I
Networkdays Function
1 The NE1WORKDAYS functlOll returns the number ofweekdays (weekends excluded) between two dates
A , B C 0 E F G H
~ 112/1S/ 2017 12/29/201~L_ _,,,,01
2_ If you supply a list of holidays, the NE1WORKDAYS function returns the number of workdays (weekends and
holidays excluded) between two dates
Cl ::.NETWORI(OAYS(Al,Bl,El;E2)
AB C 0 E F G H
1 12/1S/ 2017 12/29/ 201' L _ _28:. 12/25/2017
,
2 12/26/2017
Oecembef 2011
SU "0 TV WE
'" " SA
,,
26 21 28 29 30
S , 7
,
2
to t I t2 n 15 16
n
"
@ 23
,,
, , 30,
" 2 S
3 Dates are stored as numbers In Excel and count the number of days since January 0, 1900 Instead of SUpplying
a list, supply an array constant of the numbers that represent these dates To achieve thIS, select El:E2 In the
formula and press F9
C1 :NETWORKOAYS(A1,B1,(43094;4309S})
A I B C o E F G H
~ 112/18/2017 12/29/201~,---_---,,8,J
Workday Function
The WORKDAY functlOll is (almost) the opposrte of the NElWORKDAYS function It returns the date before or after
a specified number ofweekdays (weekends excluded)
Cl :WORKOAY(A1,B1)
A B C o E F G H
1 12/18/2017 101 1/1/2018J
2
Note the WORKDAY funcllon returns the serial number of the date Apply a Date format to display the date
Oembef 2011
SU MO TV WE TH fR SA
,
"3 ", " ", " 9
5 T
" 18 @@
11 12 13
" Z3 15 16
Again, d you supply a list of holidays, the WORKDAY function returns the date before or after a specified number of
woodays (weekends and holidays excluded).
Days until Birthday
To calculate the number of days until yoor btrthday In Excel, execute the following steps
2. Select the cell next to rt and enter the TODAY fuoctJon to return today's date
8' =TODAY{)
A 8 C 0 E , G
,
1 Dilte of Birth Todil
4/ 21/ 1980 5/ 30/2017
3
3 The most diflicuH part in order to get the number of days until your birthday is to fwd your next birthday The
formula below does the trick
C2 =DA TE(YEAR( A2) +OA TED IF(A2,B2, "y")+I ,MONTH ( A2), DA Y(A2))
I A , B
1 Date of Birt h Tod ay
C
Next Blrthda
o E F G
Explanation: The DATE functlOll accepts three arguments year, month and day We used the DATEDIF function to
find the number of complete years ("vi between Date of Birth and Today DATEDIF(A2,B2,"y") equals 37 If 37
complete years have passed sJOCe your date of birth (in other words , you have already celebrated your 37st
birthday), your next birthday will be 37 + 1 = 38 years after your date of birth_
4 Next, we use the DATEDIF function to find the number of days ("d") between Today and Next Birthday
02 =DATEDIF(B2,C2, ~d"l
I A , B
1 Date of Birth Tod ay
C
Next Birthday Days
o
until Birthday
E F G
'J
1 To automatically calculate the next 4 days and dates when you enter a start date, use the formulas below
019
A
C 0 E F G H I I J , l
1
,
2 Start Date 111/21/ 20161
,
8 Thursday
Friday
11/24/2016
11/25/2016
8:00
8:00
13:00
12:00
14:00
13:00
17:00
18:00
8:00
9:00
10
11
12 Total Hours 41:00:00
Regular Hours
"
14
40:00:00
Overtime Hours 1:00:00
15
2. Select the cells contalnll"og the tnnes
K5 =(F5-E5)+(15-H5)
A
c o E , G H J , l
1
2 Start Date 111/ 21/ 20161
3
,
4
Monday 11/ 21/ 2016
Time In Time Out
8:00 12:30
Time In Time Out
13:00 16:30
Hours
8,
6 Tue5day 11/ 22/2016 7:00 11:00 12:00 17:00 9:00
7 Wedne5day 11/ 23/ 2016 9:00 10:30 11:30 17:00 7:00
,8 Thur5day
Friday
11/ 24/ 2016
11/ 25/ 2016
8:00
8:00
13:00
12:00
14:00
13:00
17:00
18:00
8:00
.n. 9:00
10
11
12 Total Hour5 41:00:00
13 Regular Hour5 40:00:00
14 Overtime Hours 1:00:00
15
3. Right click , clic k Format Cells , and select the right Time format Use the circled format for cell K12, K13, K14
FormatCtll$ 1 x
f}iUi!ibEJ Alignment Font Border f iJI Protection
s;"tego ry.
Gener.1 S.mple
Number
CUJren cy
. 00
Attounting
Date
Percentage
Fraction
Scientific
".
Spe d .1
Custom
En li sh (U nited StaIn
TImt fo.malS dll pl~ dill and timl urlal numbul as date nlun. TImt formalS 11'111 btg ln with
an alltlilk r) 'llpond 10 (hangls In .tgio n,1 date and t,mt ultlngs thalalt Ipuilltd ' or tht
Optrallng s~ttm. Fo rmals without an IsltriSk arf not ,lItdtd b~ OptUt!ng lYlttm stttingl.
01( On(tl
4 To!ll.ltOlTlatJCaly cak:lJale the hooJs worked each day. the total hooJs and the OIIertme hooJs. use the IomUas
""""
019
, c [ , F ,, H ,J
, l
1
,
2 Start Date 111/ 21/20161
5 Monday 11/21/2016
Time In Time Out TIme In Time Out Hours
8:00 12:30 13:00 16:30 =(FSE5)+!ISHS)
6 Tuesday 11/22/2016 7:00 11:00 12:00 17:00 9:00
,,
7 Wednesday
Thursday
11/23/2016
11/24/2016
9:00
8:00
10:30
13:00
11:30
14:00
17:00
17:00
7:00
8:00
Frida 11/25/2016 8:00 12:00 13:00 18:00 9:00
10
11
12 Total
13
"1.5
Last Day of the Month
To get the date of the last day of the month In Excel, use the EOMONTH (End of Month) function
For example, get the date of the last day of the current month_
., ::OMONTH(Al ,O)
A c E F H
1 16/23/2016LI-""/3"O"
/ 2,, O, ,16! G
2j
Note the EOMONTH fuoction returns the serial number of the date Apply a Date format to display the date
2 For ex ample, get the date of the last day of the next month
., =EOMONTH(Al ,l )
c D E , G H
~ 16123120161 -,71"'col"/ ,,,Oloo6!
L
3. For example, get the date of the last day of the current month - 8 months = 6 8 = -2 = October (-2+12=10), 2015!
., =EOMONTH{Al ,-8)
C D E , G H
Be/ore you start the CHOO SE function returns a value from a Jist of values , based on a posrtlOll number For
example, =CHOOSE(3,"Car","Train","Boat","Plane") returns Boat The WEEKDAY function returns a number from 1
(Sunday) to 7 (Saturday) representing the day of the week of a date
1 ThIS IS what the spreadsheet looks like If you enter a year Into cell C2, Excel returns all the holidays for that year
Of course, New Years Day, Independence Day, Veteran's Day and Christmas Day are easy
1 This is what the spreadsheet looks like If you enter a year into cell C2, Excel returns all the holidays for that year
Of course, New Yea~s Day, Independence Day, Veteran's Day and Chnstmas Day are easy
C5 f,. =DATE(C2,1,1)
A B C D E
1
,2 Year 2020
,
B Memorial Day
Independence Day
The last Monday in May
Ju ly4
5/25/2020
7/ 4/2020
1D labor Day The 1st Monday in September 9/7/2020
11 Columbus Day The 2nd Monday in October 10/12/2020
12 Veteran's Day November 11 11/11/2020
13 Thanksgiving Day The 4th Thursday in November 11/26/2020
14 Chris1mas Day December 25 12/25/ 2020
15
2. All other holidays can be described In a similar way the xth day In a month (except Memonal day whICh IS slightly
different). let's take a look at Thanksgiving Day If you understand ThanksgIVing Day, you understand all holidays
Thanksgiving is celebrated the 4th Thursday in November
2. All other holidays can be described In a similar way the xth day in a month (except Memorial day which IS slightly
different) Let's take a look at Thanksgiving Day If you understand ThanksgIVing Day, you understand all holidays
Cl3 =DA TEl C2, 11,1)+21 +CHOOSE(WEEKDA VIDA TEl C2.11,1)).4, 3,2,1.0,6,5)
A B c o E
1
2 Year 2020
3
4 Holiday When Date
13 Thanksgiving Day The 4th Thursday in November rlt"'''I!'26~/"2~O~20~!
15
November 2020
W,
SU '-40 TU
25 26 27
'" " SA
"
1 5
..
" " " 2S" 2027 " 19
" 2
"
22 21
" 30 1 5
ExplanatIOn DATE(C2,1' ,I) reduces to 111112020. WEEKDAY(DATE(C2,l1 ,l reduces to 1 (Sunday), Nov; the
formula reduces to 111112020 + 21 + CHOOSE(I,4,3,2,I,O,6,5) = 111112020 + 21 + 4 = 11I26l2020 We needed the 4
extra days because ~ takes 4 days until the first Thursday In November From there, ~ takes another 21 days (3
weeks) until the 4rd Thursday in November It doesn't matter on which day November 1 falls, the CHOOSE function
correctly adds the number of days until the first Thursday In November (notICe the pattern In the list of v alues), From
there, ~ always takes another 21 days until the 4rd Thursday in November Therefore, this formula works for every
y~'
3 Let's take a look at Martin luther Kwg Jr Day ThIS formula IS almost the same Marlin luther Kwg Jr Day IS
celebrated the 3rd Monday in January The fIrSt DATE function reduces to the first of January this IJme The base
->
posllJOri (0) 10 the list of values for the CHOOSE func:tIon IS located at the secood spot now (we are IookIOQ for a
(6 =DATE(C2.1,l}+14+<:HOOSE(WEEKDAY(DATE(C2.I.1,l,O,6,5,4,3,2)
1
A
( o E
,
2 Year 202<>
The calendar below helps you understand Marlin luther KIOQ Jr Day 2020
J.,UMY lOlO
50 MO TU WE
'", " SA,
"5 "7 1
, " 11
30
"19
" 21" """"
""""
", 27 " "5 "7 30
1
Explaflabon DATE(C2.1 , 1) redlces to 1/112020 WEEKOAY(DATE(C2. t , 1)) fedlces to " (We<tJesdoly) Now the
fomUa re<kJces to 1/112020 .. 1" .. CHOOSE(" 1,0,6 5" 3,2) = 11112020 + 1" + 5 = 1l20l2020 We needed the 5
exlfll doIys because II. takes 5 doIys Ifii the first Monday 10 JiV1O<WY
Quarter
An easy formula that returns the quarter for a given date There's no buiH-in function In Excel that c a n do this
81 =ROUNDUP(MONTH(Al )/3.0)
A 8 c o E F G H
~ !S/ 29/2016L1_---'2J
Explanation ROUNDUP(x,O) always rounds x up to the nearest Integer The MONTH function returns the month
number of a date In thIS example, the formula reduces to =ROUNDUP(513,O), =ROUNDUP(I.666667,O), 2 May is
In Quarter 2
E~planatlOll ROUNDUP(~,O) always rounds ~ up to the nearest Integer The MONTH functlOll returns the month
number of a date In thIS e~ ample, the formula reduces to ::ROUNDUP(513,O), ::ROUNDUP(1 666667,0), 2 May IS
III Quaner 2
B1 f =Al/3
1
A
110 .333333j
C 0 E F G H
2 2 0.666667
3 3 1
4 4 1.333333
S S 1.666667
6 6 2
7 7 2.333333
,8
,
8 2.666667
3
10 10 3.333333
11 11 3.666667
12 12 4
13
E~planaIIOIl now ~'s not dlfficuH to see that the first three values (months) III colurm B are rounded up to 1 (Quarter
1), the next three values (months) in colurm B are rounded up to 2 (Quaner 2), etc
81 =AI-OATE(YEAR(Al ), l , l j+1
A 8 c o E F G H
1 16/ 23/ 2016,,--1____ -"'"",!
:j
Explanatlon. Dates and tunes are stored as numbers In Excel and count the number of days since January 0, 1900_
June 23, 2016 is the same as 42544 The DATE function accepts three arguments year, month and day
DATE(YEAR(Al), 1,1) or 1-jan-2016 IS the s ame as 42370 Subtracting these numbers (42544 - 42370 = 174) and
adding 1 gIVes the day of the year
Text Functions
JOin Strings I left I RighI I Mid I Len I Find I Substrtute
Excel has many functions to offer when rt comes to manipulating text strings
Join Strings
To join strings, use the & operator
01
A B C 0 E F G H
Tim
Note to insert a space, use"
Left
To extract the leftmost characters from a string, use the LEFT fuoctJon
01 =LEFT(Al,4)
A , B c o , F G H
~ !examPle text lexam J
Right
To extract the rightmost characters from a string, use the RIGHT fuoctJon.
01 =RIGHT(Al,2)
A B c o , F G H
~ lexamp,e text Ixt J
Mid
To extract a substring, starling In the rruddle of a string, use the MID fuoctJon
01 =M1D(Al, 5, 3)
A , B c , F G H
~ !examPle text
01 =LEN(AIJ
A , B c E F G H
~ lexamp,e text
Find
To fwld the position of a substring In a string, use the FIND function_
01
A B c o E F G H
~ lexamp,e text ,I
L - _-',.
Substitute
To replace exISting text wJth new text In a string, use the SUBSTITUTE functIOn
B c o E F G H
IHiJohn J
Separate Strings
ThIS ex ample teaches you how to separate strings in Excel
.2
A
1 !full Name
c
First Name La st Name
o E F G H
2 ISmith, Mike
3 Johnson, Matthew
I !
,
4 Williams, Janet
Brown, Sandra
6 Jones, Usa
7 Mi11ar, Peter
8
The problem we are dealing with IS that we need to tell Excel where we want to separate the string In case of Smith,
Mike the comma is at poslhon 6 while in case of Williams , Janet the comma IS at position 9
To get the first name, use the formula below
.2 f. =RIGHT(A2,LEN(A21-FJND(~," ,A21- 1)
1 full Name
A
first Name Last Name
( o E F G H
Explanatlon_to find the posllJon of the comma, use the FIND function (posllJon 6) To get the lergth of a stnng, use
the LEN function (tt characters) =RIGHT(A2.lEN (A2}- FIND (",",A2}-t) reduces to =RIGHT(A2,tt-6-t)
=RIGHT(A2,4) extracts the 4 rightmost characters and gIVes the desired resuH (Mike)
A 8 ( o E F G H
1 full Name first Name Last Name
2 Smit h, Mike Mike ISml th !
3 Johnson, Matthe w
4 Williams, Ja net
5 Brown, Sandra
6 Jones, Lisa
7 Millar, Peter
8
Explanation to fwd the position of the comma use the FIND funcllon (position 6) =lEFT(A2,FIND(",". A2}-t)
reduces to =lEFT(A2,6- t) =lEFT(A2,5) extracts the 5 leftmost characters and gIVes the desired resuR (Srrnth)
3. Select the range 82 C2 and drag rt down
1 !full Name
A
c
first Name Last Name
o E F G H
Use the LEN fuocton to get the length of the strirog (25 characters , Including spaces)
C1 ::tEN(Al )
A , D E F G
1 dog, cat, dog dog cat dog dog
2
2 The SUBSTITUTE fuoction replaces exiSting text with new text in a stnng LEN(SUBSTITUTE(Al ,81 ,- equals
13 (the length of the string without the words dog) If we subtract thIS number from 25, we get the length of the dog
Instances (25-13= 12)
2. The SUBSTITUTE function replaces existing text with new text in a string lEN(SUBSTITUTE(Al ,Bl ,- equals
13 (the length of the string without the words dog) If we subtract thIS number from 25, we get the length of the dog
Instances (25--13= 12).
~
A
IdOg. cal, dog dog cat dog do,
c
121
D E F G
'----~,.
3 Dividing this number by the length of the word dog (3), gives us the dog instances (Im=4)
la_ The TRIM function returns a string with e:o:tra spaces , starting spaces and ending spaces removed_
81 {. =TRIM(Al}
A 8 C 0 E F G H
1 how are you? Ihow are you?!
2
1b. To get the length of the string wJth IlOfmal spaces , we combine the LEN and TRIM function
81 =lEN(TRIM(Al))
A 8 c o E F G H
how are you? LI_ _ _,,,,2,!
:1
lb_ To get the length of the string wJ\h r.ormal spaces , we comblJ)e the LEN and TRIM funclJon_
81 =4.EN(TR1M(Al })
A 8 c o E F G H
1 how are you? ll_ _ _ _,' ,2!
2
2a The SUBSTITUTE funclJon replaces exlsllng text wJ\h new text In a text string We use the SUBSTITUTE
function to get the string without spaces
81 =-SUBSTITUTE(A l , ., ""I
A 8 c o E F G H
how are you? Ihoware you? !
2b. To gel the length of the string wJ!houl spaces, we combine the LEN and SUBSTITUTE function_
3_ Now comes the simple trICk To get the number of words , we subtract the length of the string wllhout spaces (10)
from the length of the string wJ\h normal spaces (12) and add 1
A 8 c o E F G H
21 how are I 31
you? L -____~.
Text to Columns
To separate the contents of one Excel cell into separate columns , you can use the 'Convert Text to Columns
WIZard. For example, when you want to separate a list of full names into last and first names
l OR x I e Brady, Tom
A B c o E F G H
1 Bra dv. Tom
2 Manning. Peyton
3 Peterson, Adrian
4 lewis, Ray
5 Reed, Ed
6 Polamalu, Troy
7 Johnson, Andre
8 ReviS, Darrelle
9 Brees, Drew
10 Peppers, Julius O.
11
2 On the Dilla tab, in the Data Tools group, clic k Text to Columns
~'" ~ e.~
Text to~
FIHh RmIOYe Con$Olid~le R
Columns Fill Duplicates Vlrid~tlOn
D~la Tools
r.di'. Te",
t:-nnin; . ".~en
.~.r.on. Adri.n
~Wi" ~y
d, Ed
4 Clear aI the check boxes lnler ~ excepC lor the Corrma and Space check bo~
Convert Tut 10 Column~ Wizard Slep 2 of 3 1 x
ThiS wnn Ids ~ou nt the de limiters your d~ta conlains. You can see how ~ou' text Is affected
in the prmew be low.
Delimiters
Drab
D Semicolo n E2I Treat consecvtlve delimiters as one
E21-'omma
E21~
Text Jjuolifier. I El
o Qtller.
.ann1:111" ~ ~:~C:l
..,
.~.r.c:l
~"h
F rian
,"
Canul II flnl5~
Note This example has commas and spaces as delimrters. You may have other de~mrters rn your data_ Experiment
by checklllg and unchecklllg the different check boxes You get a live prevrew of how your data will be separated
ResuH_
Note ThIS e~ample has COlT"fTlilS and spaces as dellmrters You may have other delimiters In your data E~ pemnent
by checking and unchecklng the different chec k bo~es You get a live prevIeW of hoW your data Will be separated
RM'"
Al f. Brady
A B C 0 E F G H
1 Brady Tom
, .........
2 Manni". Peyton
Adrian
4
....,
, lew" R. y
6 .......,. Ed
Troy
.....
7 Johnson
, .....
8
Andre
Darrelle
10 .......
11 1
Dre w
Julius
Lower/Upper Case
This example teaches you how to convert a text stnng to lower, upper or proper case In Excel
Use the LOWER functlon to convert all letters In a text string to lowercase
.,
A
'" :lOWER1Al )
C 0 , F
I
1 Hi THERE, how ilre You? hi there, how are you?
I
2
2. Use the UPPER function to convert all letters in a text string to uppercase
., =UPPER(A l )
A c o , ,
~ JHi THERE, how are You? IHITHERE, HOW ARE YOU? J
3 Use the PROPER function to convert a text string to proper case That is , the first letter in each word in
upperca se, arod a ll other letters In lowerca se
., :PROPER(Al )
A c o , F
~ !HI THERE,how are You? IHi There, HOWAreYOu? J
Remove Unwanted Characters
The TRIM function returns a string with extra spaces , startJrlQ spaces and ending spaces removed The CLEAN
functIOn removes noopnntabie characters from a string
81 =TRIM(Al)
A 8 c o E F G H
1 Excel Easy Excel Easy
2
81 =ClEAN(Al)
A 8 c o E F G H
~ JIJEXCe l Easy IExce l Easy 1
Note the CLEAN funcllon removes this nonpnntable character Text Imported from other applicallons may contain
nonpnntabie characters
C1
A
'"
B
=EXACT(A l ,B l )
C 0 E F G
1 Pie Chart Pie chart FALSE I
2 Ga ntt Chart Gantt Chart TRUE
3 Pareto Chart Parto Chart FALSE
4 Thermometer Chart Thermometer Chart TRUE
5 Trend line Trendline TRUE
6 Sparklines Sparklines TRUE
7
'"
C1 :Al=81
A B C 0 E F G
1 Ipie Chart Pie chart TRUE I
2 Gantt Chart Gantt Chart TRUE
3 Pareto Chart Parto Chart FALSE
4 Thermometer Chart Thermometer Chart TRUE
5 Trend line Trendline TRUE
6 Sparklines Sparklines TRUE
7
Find vs Search
The FIND fuoction and the SEARCH function are very similar to each other This example shows the difference
To find the position of a substring In a string. use the FIND function_FIND is case-sensitive
., :FIND("eKce l ~,A l 1
A
c o E F G H
,
1 M icroso ft Excel 2016 INALUE!
2 To find the pos~ion of a substring In a string, use the SEARCH function SEARCH is case-insensitive
., :SEARCH( "excel~ ,A 1)
A
~ lMicrosott Exce l 2016 L I_ _
,,,lJ c o E F G H
Note string "excer found at posJhon II. Even though ~'s actually the string "Exeer
2 To find the posltlon of a substring In a string, use the SEARCH functlOl'l SEARCH IS caselnsens~lVe
81 /z =SEARCH(" excel" ,A 1) [
A 8 C 0 E F G H
1 Microsoft Excel 2016 1 111
2
NOIe stmg "elICer' found at poslbon 11 Even though Il's actualy the stmg "'EJccer' F
3 The SEARCH Iun:::IIon IS more versatje You can use WJkIcard characters when you use this function
I
81 /z =SEARCH("soft"2016" ,Al)
A 8 C 0 E F G H
~ IMlcroSOft Excel 2016 1 ,I
81 /z =SEA RCH("soft2016",A1)
A 8 C 0 E F G H
1 Microsoft Word 2016 1 ,I
2
N~. A ques1lOll mark (7) matches exactly one character An astensk C') matches a senes of zero or more
characters
4 One other nteresung pont to menllon about the FiND and the SEARCH funcllon IS that they have a 3rd oplIonaI
argunent You can use this argunent to indICate the poslbOrl, counung from the lett, at which you want to start
searctwJg
B1 =FINO("o",A1)
A 8 c o E F G H
1 -, Microsoft Excel 2016 LI_ _-,5l
2
Note A question marll (7) matches exactly one character An asterisk (') matches a series of zero or more
characters
4 One other Interesting point to menllorl about the FIND and the SEARCH functlDn IS that they have a 3rd opborlal
argument You can use this argument to indicate the position, counllng from the left, at which you want to start
searching
., f. =FIND(~o",A l l
~ lMicrosott
A
Excel 2016 I
,I
C 0 E F G H
., f. :FIND("o",Al,6)
~ lMiCTosoh
A
Excel 2016 I
71
C 0 E F G H
A 8 c o E F
1 Excel 2013 a nd Word 2013 IExce12016and Word 2016 j
2
lb. The SUBSTITUTE function has a 4th optional ingumenl. You can use this argument to Indicate whICh
occurrence VOU want to substItute
lb. The SUBSTITUTE function has a 4th optional argument You can use this argument to indicate which
occurrence you want to subslIlute
A ( o E F
~ jExcel2013 a nd Word 2013 IEICce I2013 and Wo rd 2016 j
2. If you know the posmon of the text to be replaced, use the REPLACE functIOn.
A
1 Ql)(56() 1C56()
I
( 0 E F G H
2 LHR214 (214
3 EBM905 (905
4 KPN1l7 C117
5 WXA450 C450
6
AB C 0 E F G H
1 h itle ' First Name ' Middle Naml! ' Last Name Full Name
~ jor. Tom F. Brady lor.Tom F. Brady 1
Note to insert a space, use
2 The CONCATENATE function prodoces the exact same resuR.
A . C o E F G H
1 ITitle ' First Name Middle Name Last Name Full Name
2 lor.
1 j
Tom F. Brady l or. Tom F. Brady
!
3<1_ The CONCAT function In Excel 2016 prodoces the exact same resuR_
I A I B I C I D E F G H
1 TItle First Name Middle Name Last Name Full Name
2 Dr. Tom F. Brady l or, Tom F. Brady 1
1
3b. The CONCAT funcllon can also JOin a range of stm19s If you don't need a delimrter (space, COOVllil, dash. etc_)
this can be useful
Fl ::CONCAT(A1:E1}
1
C
415
o
648
E
57031L.
F
_--,,===e,.
+14156485703 1
G H
4a_ The CONCAT function cannot ignore empty cells Take a look at all the extra spaces In column E below d you
drag the funcllon In cell E2 down to cell El1_
4a The CONCAT fuoction cannot ignore empty cells Take a look at all the extra spaces In column E below if you
drag the fuoctJon In cell E2 down to cell E".
,8 Andre
DClrre lle
Johnson
Revis
Andre Johnson
Darrelle Revis
10 0,. Drew a. Brees Dr. Dre w Q. Bree s
11 Julius Peppers Julius Peppers
12
4b The beauty of the TEXTJOIN function in Excel 2016 is that rt can ignore empty cells (if the second argument is
set to TRUE)
"
=TEXTJOIN(~ ft,TRUE,A2:D2)
" ,
A B C 0 F G H
1 Title First Name Middl e Name last Name Full Nilme
IDr. To m F. Brady I
,2 0,. To m
Peyton
F. Brady
Manning Peyton Manning
,.
4 Adrian O. Peterson Adri an D. Peterson
5 M, R.y Lewis Mr . Ray Lewis
6 Reed Ed Reed
7 Troy ,. Polamalu Troy E. Polamillu
,
8 Andre
Darrelle
Johnson
Rev is
Andre Johnson
Darrelle Revis
10 0 , . Drew a. Brees Dr. Drew Q. Brees
11 Julius Peppers Julius Peppers
12
Note the TEXT JOIN function JOIns a range of strings USing a delimrter (first argument)
Lookup & Reference Functions
VLookup I Hlookup I Match I Index I Choose
learn all about Excers lookup & reference functions such as the VLOOKUP, HLOOKUP, MATCH, INDEX and
CHOOSE fuocbon
VLookup
The VLOOKUP (VertK:allookup) function looks for a value In the leftmost column of a table, and then returns a value
In the same r{JoN from another column you specify
.2 :VLOOKUP(A2,$E$4:$G$7,3,F ALSE)
A , C
E F G H
1 lID Product
,
2 104 Printer
10'
!
I. Brand Product
4 104 101 Dell Computer
5 101 102 logitech Keyboard
6 102 10' logitech Mouse
7 10' 104 HP Printer
,
S 101
104
10 101
11 102
12
Explanation the VLOOKUP functKlll looks for the ID (104) In the leftmost ColUIlVl of the range $E$4 $G$7 and
returns the value in the same rem from the third column (third argument is set to 3) The fourth argument is set to
FALSE to return an exact match or a #N/A error If not found.
.2 :VlOOKUP(A2.$E$4:$G$7,3.FALSE)
1 lID
A
Product
c , o , E , F , G , H ,
2 104 Printer
3 103 Mouse 10 Br.md Product
4 104 Printer 101 Dell Computer
5 101 Computer 102 logitech Keyboard
6 102 Keyboard 103 logitech Mouse
7 103 Mouse 104 HP Printer
,
8 101
104
Computer
Printer
10 101 Computer
11 102 Keyboard +
12 ~
13
Note when we drag the VLOOKUP funclKln down, the absolute reference ($E$4 $G$7) stays the same, while the
relallve reference (Al) changes to A3, A4, A5, etc.
HLookup
In a similar way, you can use the HlOOKUP (Horizontal lookup) function
82 ~ : HLOOKUP(A2,$E$4:$H$6,3,FALSE)
A 8 C o E F G H
1 10 Product
,.3 Mouse !
2 104 Printer
3
4
5 ,.,
104 Printer
Computer
10
Brand Dell
101 102
l ORitech La itech
103
HP
104
,
8 ,., Computer
I. ,.,
104 Printer
Computer
11 ,.2 Keyboard
12
Match
The MATCH function returns the position of <I v alue in a given range
82 I- =MATC H(A2,E4:E7,O)
A 8 C o E F G H
1
2 Yellow 31
3
4 Green
5 Blue
6 Yellow
7 White
8
Explanation. Yellow found at position 3 in the range E4E7 The third argument is optional. Set this argument to 0 to
return the position of the value that is exactly equal to lookup_value (A2) or a #N/A error if IlOI found
Index
The INDEX function below returns a specific value in a two-dimensional range
A B C 0 E F G H
1
2 3 21 92 1
3
4 43 n
5 n 35
6
7
"
21 "
54
8
C2 ~ :o.INDEX(E4:E7,A2)
A B C o E F G H
1
2 3
3
4 43
5 n
6 '7
7 21
8
l y--"A,-~~~8===; __"CC-____'D~____CEC-___ F G H
,2 3180at !
Tax Rates
Sometmes you are not IookIOQ for an exact match when you lISe me VLOOKUP funclJOo 111 Excel For exarfllle.
when you want 10 calctAate the talC on an InCome
The foIowlng tax rates apply to ifdviWals who are resdenls 01 Australlil:
0- $18,200 Nj
$180,001 and over $54,232 plus 45c for each $1 over $180,000
EKampie If JOCOITle IS 39000, tax equals 3572 + 0 325' (39CXXl- 37000) = 3572 + 650:: $4222
A B c o E F G
1 Taxable Income Tax on this Income
I
,
2 $39,000 $4,222 J
To automatK:ally cak:ulate the tax on an Income, execute the followll"lQ steps
On the second sheet, create the following range and name rt Rates
Rates t- O
A 8 C D E F G H
1 O~ 0 0
2 18200 0 0,19
3 37000 35n 0.325
4 87000 19822 0.37
5 180000 54232 0.45
6
7
Sheet! I Sheet2 e
2. We already know how the VLOOKUP function can return an exacl match or a #NIA error if not found, by setting
the fourth argument 10 FALSE However, when you set thIS argument to TRUE , rt returns an exact match or if not
found, rt returns the largest value smaller than lookup_value (A2). That's exactly what we want!
B2 =VLOOKUP(A2,Rates,2. TRUE)
A 8 C D E F G
1 ITaxable Income Tax on this income
I I
2 $39,000 $3,5n
3 I
Explanation Excel cannot find 39000 in the first column of Rates. However, rt can find 37000 (the largest value
smaller than 39000). As a resun, rt returns 3572 (coljndex_num, the third argument, is set to 2)
3. Now, what's left IS the remainder of the equation, + 0 325' (39000 - 37000) This is easy We can return 0 325 by
setung col_lndex_num to 3 and return 37000 by setung col_lndex_num to I. The complete formula below does the
mek
E~planatJOn E~cel cannot find 39000 In the first column of Rilles However, rt can find 37000 (the largest value
smaller than 39000) As a resutt, rt returns 3572 (col_lf'dex_num, the third argument, IS set to 2)
3 Now, what's IefllS the remall'lder of the equatlOfl, + 0,325' (3900037000) ThIS IS easv We can return 0 32511'J
setting coClOdelUlum 10 3 and return 37000 II'J setllng coUndex_1lUll to 1 The complete formula below does the
tr<k
=VlOOI(UP(A2.Rates,2,TRUE)+VlOOI(UP(A2,Rates,3,TRUE)-(A2.VLOOKUP(A2.Rates,l,TRUE))
A 8 C 0 E F G
1 Taxable Income Tax on this income
2 $39.000 I $4,222 I
3
Note wtlen VOU set the ku1tl argument 01 the VlOOKUP funcllon to TRUE, the first colulm 01 the table fTlI.ISl be
sorted 10 asceodlng order
x
Offset
The OFFSET functlon In Excel returns a cell or range of cells that IS a specified number of rows and columns from a
cell or range of cells
1 The OFFSET function below returns the cell that is 3 rows below and 2 columns to the right of cell A2 The
OFFSET function returns a cell because the height and width are both set to I.
X f. :QFFSET{A2.3,2,l,1
COUNTlF
'"
1
A
Sa les
C D E F G H
2 Month lEast West
3 Jan 510 1010
4 F.b 605 1467
5 M" ...1 10341
6 A,. m 1030
7 M,V 691 5..
I=OFFSET(~2.3,2,1.~
, I"
I"
861
379
694
1219
, OfFSET(.rierence, rows, cols, (nelghtL [width))
10 A,. 317 610 - -- - - -
E8
, A C D E F G H
, Sales
, Month
1"
Eilst
510
West
1010
'"
5 M"
605
...1
'46'
10341
,
6 Ap' 155 1030
,,,
M,V 691 588
,
8
1"
861
",
694
1219
1034 1
10 A,.
,,,
317 610
..,,., 115'
11 5.p
12 Oct 340 "6
,.
13 No,
D"
1213
1209
15
2 The OFFSET function below returns the 1 x 2 range that IS 8 rows below and 1 column to the right of cell A2. The
SUM funclton calculates the sum of this range
1
A
Sales
c o E F G H
2 Mo nth lEast West
3
""
510 1010
Fob 605 1467
,
5 M"
Ap'
648
155
1034
1030
7 M,y 691 588
, Joo
J,I
861
'"
6,.
1219 I =S UM(OFFSETIA2,8,I, I,~
10 A, S 317 6101
OF F SfT(referen c ~ rows. col~ [heightL [wid thll
-- -- -- -
11 5.p 92' 1159
12 Oct 340 7"
13 No, 443 1213
I. 0" '34 1209
15
Resu~:
R~""
,
2 Mo nth East West
1010
4 ""
Feb
510
60S 1467
5 M" 648 1034
, '""
8
691
861 ...
S88
1219 9271
Jul
10 Aug '"
317 6101
11 Sep ." 115.
746
"13 No,
Oct 340
44' 1213
14 Deo .34 "09
15
Note to return a range (without calculaung the sum), select 11 range at the same sIZe before you Insert the OFFSET
fuoctJOn If you want to return a cell or range of cells that IS "specJtied number of rows above or colurms to the left,
enter a negatIVe number
Left Lookup
A drawback of the VLOOKUP function IS that rt c an only look up values In the leftmost column of a table. However,
sometunes you need to look up a value in i!!IY. column and return the corresponding value to the!!ctl_To achieve thIS ,
simply use the INDEX and the MATCH function
.2 =MATCH(A2,$G$4:$GS7,O)
1 lID
A
Product
C 0 E F G H
2 104 4]
3 103 Product Brand 10
4 104 Computer Dell 101
5 101 Keyboard logitech 102
6 102 Mouse logitech 10.
7 103 Printer HP 104
,8 101
104
10 101
11 102
12
E~planatlOO 104 found at position 4 In the range SG$4 SGS7
2 Use this resu~ and the INDEX function to return the 4th value III the range SE$4 SES7
B2 :fNDEX(SES4:SE$7.MATCH(A2.SGS4:SG$7,O))
A B C 0 E F G H
1 ho Product
2 104 Printer !
3 103 Product Brand i.o
,
4 104
101
Computer Dell
Keyboard Logitech
101
102
7
102
103
Mouse
Pri nter
Logitech
H'
103
104
,
8 101
104
10 101
11 102
12
B2 =INDEX($ES4:$E$7.MATCH(A2.SGS4:SG$7.0))
A B c o E F G H
1 I,D Product
104 Printer
2
3 103 Mouse Product Brand ,0,---=
,
4 104 Printer
101 Computer
Computer DeU
Keyboard l ogitech
101
102
7
102 Keyboird
103 Mou se
Mouse
Printer
Logitech
H'
103
104
,
8 101 Computer
104 Printer
10 101 Computer
11 102 K ey~rd
12 ~
Note. when we drag this formula down, the absolute references ($E$4 $E$7 and $G$4.$G$7) stay the same, while
the relative reference (A2) changes to A3, A4, A5, etc
Below you c an fwod the sales of different ICe cream flavors In each month
To find the posrtlOll of Feb In the range A2:AI3, use the MATCH function_The resuH IS 2.
SUMIF x =MATCH(G2,A2:A13,O
A B c D E F G H
1 Ch()(olate Straw berry Vanilla
r~ 189 Month iO
"~b:---i"MATCH(G2,A2;A13,q
2
3 fob
544
217 '"
719
'"
Flavour Chocolate
4 M" 81D 178 810 MATCH Oookup_value, lookup_array, [millch_typeD -
-
5
6
Ap,
M.,
5"
745
'26
230
,'"
364
Sales
- -
,
8 lui
Au,
457
495
522
500
832
239
10 5., 871 391 5'"
11 Oct 585 225 791
12 No, 478 262 540
13 Do< 741 883 809
14 J
2. To find the posmon of Chocolate In the range 81:Dl , use the MATCH functIOn The resu~ IS 1
SUM1F X ~ I- =MATCH(G3,Bl:Dl,O
1
A
C 0
. Chocolate Strawberry Vanilla
E F G H
2
3 Feb''" S44
217
639
71!l
189
'"810
Month
. .
F,b
Flavour IChocolate I:MATCH( G3.Bl:Dl.
2
~
4 M"
, A,. 810 178 MATCH(lookup_Yolue, lookup_~rr'Y, [fTWIl<::h_typel)
56' Sales
6 M., '" '"364
, '"" '4'
".
230
820 94'
, '"'A".
8 457
495
"2
'00
832
239
10 Se,
11 Oct
871
58'
391
225 '"
791
12 No. 478 "2 540
13 0" '41 883 809
14
3. Use these resutts and the INDEX function to find the sales of Chocolate in February
1
A
C 0
Chocolate Strawberry Vanilla
E F G H
, M"
4 810 178
Sales 2171
A,.
6 M., '" '" '"
, '"" '4'
298
230
820
364
94'
, '"'A".
8 45'
495
522
'00
832
239
10 Se, 871
11 Oct '85
391
225
'"791
EXpianatKlO 217 found at the IntersectKlO of rfloN 2 and colurm 1 In the range 82:013
G5 :INOEX(B2:013,MATCH(G2.A2:A13,O),MATCH(G3,81:01,O))
1
A C 0
Chocolate Strawberry Vanilla
E F G H
,
8 'ul
Au,
457
495
522
500
832
239
10 Sep
11 Oct
871
S85
391
225
'"
791
12 No. 478 262 540
13 De< 741 ..3 8O<J
14
Locate Maximum Value
Thts example leaches you how to find the eel address of the rl\alIJfl1Url1 ~atue If! a colurm
1 FIrSt. we use the MAX function to find the maXllOOITI value 11 cokJrm A
(1 f" =MAX(A:A)
A 8 ( 0 , F G H
1 12!
,
2
,
6
,
4
,
1
6
7 12
,
8 8
2 Second. we use the MATCH function 10 find lhe rCIW number oflhe ma~omum value
(1 b =MATCH(MAX(A:A),A:A,O)
A B ( o , F G H
,,
1
4 ,
6
5 1
6 5
7 12
,8 8
E~plar.a\lOll the MATCH fLnCtIon reduces 10 =MATCH(12,AA,O). 7 The MATCH fLnCtIon ret~ns the posrlJon of the
maximum value In colurm A Set the thll'd argument to 0 to retum an exact match
C1 f- =ADDRESS(MATCH(MAX(A:A), A:A,O), l )
A B ( 0 , F G H
,,
1 ISAS7 I
4 ,
6
5 1
6 5
7 12
,
8 8
E~pIana\Jon the ADDRESS function reduces to c=ADDRESS(7,1), SAS7 The fw'sl argtmenl specifies the rr:Nf
{. =INDJRECT(Bl )
" , ,
I 5b
C D F G H
1
,
:j
Do we really need the INDIRECT furx::tton for this? Yes Below you can find the resuR wJthoulusJOg the INDIRECT
function
"
, C
'" D
=Bl
, F G H
1C2 b
1
,
:j
Indirect
The INDIRECT function In Excel retums the reference specified by a text string
Al f. =INOIRECT(Bl)
I
A
5b C 0 E F G H
1
,
:j
Do we really need the INDIRECT function for thIS? Yes Below you can find the resuR wrthoul USing the INDIRECT
function
Al f. =61
In
A
In
C 0 E F G H
1
,
:j
2 For example, the function below reduces to =SUM(INDIRECT("E3E6", =SUM(E3.E6), 27
A
c 0 E , G H
2
:j : 6
3 t==El
,
4
6
7
0
Note the & operator IS used to JOOl stnngs Border for illustratton only
Al :AVERAGE(INDIRECT( Bll 1
A c o E , G H
,
10
This chapter gIVes an OVervIeW of some very useful statistical functlons in Excel.
Average
To cak:ulate the average of a range of cells , use the AVERAGE fuoction
'3 :AVERAGE(Al:01)
B C 0 E F G H JKLMNOP
1
2
0 7 B 6 5
8 7 480 3 568
3@
41
Averageif
To lIIIerage cells based on one cnleraa, use the AVERAGElf functIOn for example to calculate the average
exCluding zeros
0 , , , ,, ,, 0 , p
B C 0
, F
, G H J K L M , N
8
:j 7 8 5 8 7 4 8 0 5
: \6,46!
Note <> me<VlS not eq.Q/ 10 The AVERAGEIF fiR:bon IS smiar 10 the SUMIF luncbon
Median
To find the median (or IT'I(lk JUrber), use the MEDIAN fiR:bOn
., /z =MEDIAN(Al:Ol)
0 , , , ,, ,, ,
B C 0
, F
, G H I J K
0
L M ,
5
N
8
p
:j 7 8 5 8 7 4 8
:p
C""'.
,,
I
B , C
,, 0 , E , F , G H I , J , L , M N ,
,
0 , P
1 0 0 4 5 5 ,U 7 7 8 8 8 8
Mode
To find the most frequently occurring number, use the MODE function
A3
" :MODE(Al :01)
, a
1
A
0
B
7
C
B
0
6
E
5
F
, G
8
H
7 4
J
8 0
l
, M
5
N
6 8
p
' D.
4 1
Standard Deviation
To cak:ulate the standard devaanon, use the STEDV functlOn_
A'
" :STDEV(Al:01)
, ,
A B C 0 E F
, G H J l M N 0 P
:~
7 8 6 5 8 7 4 8 0 5 6 8
4 1
Min
To find the minimum value, use the MIN function
A3
" :MIN(Al:Ol)
, a
A B C 0 E F
, G H J l
, M N p
:f~
7 8 6 5 8 7 4 8 0 5 6 8
, 0
4 1
Max
To find the maximum value, use the MAX function
A3
" ::MAX(Al:Ol)
,
,
A B C 0 E f
, G H J L M N 0 p
:1 0 7 8 6 5 8 7 4 8 0 5 6 8
:p
Large
To frld the Itwd Igesl nu-Mer. use the IoIow1ng lARGE IuncbOn
A3
" =lARGEtAl:0UJ
,
, p
A B C 0 E f
, G H J L M N 0
:1 0 7 8 6 5 8 7 4 8 0 5 6 8
:p
c'""
o , ,
1 I
A ,
0
B
0
C
, 4
E
5
f
5
G
6
H
6 7
J
7 8
L
8U
M N
8
0
, P ,
Small
To fnI the second smallest runber, use the fobHlng SMALl funcbOn
A3
" =SMALl.{Al:Ql.2j
,
,
1
A
0
B
7
C
8
0
6
E
5
F
, G
8
H
7 4
J
8 0
L M
5
N
6
0
8
P
' 0.
4
Small
To find the second smallest number, use the following SMAll function
, , a
B C 0
, ,
F G H J l M
, N p
:j 0 7 8 6 8 7 4 B 0 3 6 8
I0.
3
4
C"'k
o c 0 ,, , F G H I J , l , M N a
, p
1 I U 0 3 4 6 6 7 7 B 8 B 8
T,p Excel can generate most of these resutts with the click of a button Our DescnptJlle StatrstlCs example shows
yoo how
Negative Numbers to Zero
A clever Excel trick to change negative numbers to zero but leave positive numbers uochanged
Below you can fwd two columns with numbers To subtract the numbers in column B from the numbers in column A,
execute the following steps
1 Select cell C 1
3. Click the lower right corner of cell Cl and drag the formula down
C1
A
C
" 0
=A l -B l
, ,
1
2
20
15
12
12
3 18 7
,
4 17
15
6 11 1l
7 11 15
,
8 11
14
8
10
10 19 6
11 1l 15
12 12 1l
1l 15
14
+
Result.
C1 f. "'AI-BI
A 8 C 0 E f
,
1 20 12
,8
, 15 12
4
18
17 8 ,
11
5 15 7 8
6 11 13 -,
7
,
8
11
11
15
8 ,
-4
,. 14
19
10
6
4
13
-,
11 13 15
12 12 13 -1
13 15 8
14 'I-~l
15
4 To change the roegaWe ol-mbers to zero bulleave the posllNe flllrTlbefs urx:hanged, InStead of "'Al-Bl. use
= MAX{O,A 1-8 1) and drag the fin:bon down
Result.
4 To change the negative numbers to zero but leave the posrtive numbers unchanged, Instead of =Al-Bl , use
=MAX(O,Al -Bl) and drag the function dawn
ResuH:
e, 0
f. =MAX(O,A6-86)
A
e 0 E F
1
2
20
15
12
12
3
3 18
7
,
11
,
4 17
15 7
,I 11
"l 01
7 11
" 0
,8 11 8 3
14
,
10 4
Il
10
11 "
Il 15 0
12 12 13 0
13 15 7 8
14 ~
15
Explanation the MAX function returns the maximum of two values If the resuH of the formula is negative, the
function returns 0
Random Numbers
Rand I Randbetween
Excel has two useful func:tlOllS when rt comes to geoeratlllg random numbers The RAND and RANDBElWEEN
function
Rand
The RAND function generates a random decimal number between 0 and 1
1 Select cell AI
2. Type RANDO and press Enter The RAND function takes no arguments
A1
A , C
'" 0
=RANOO
E F G H
1 I 0 .63404 1
2 I
3 To generate a list of random numbers, select cell AI , click OIl the lower nght comer of cell A I and drag rt down
.,
C
" D
:RANDO
E F G H
1 0.895814
,2 0.025902
0.97'9004
4 0.328873
S 0.074517
7
0.821652
0.989476
, ~l
Note that eel AI has changed That IS because random numbers change every tme a eel on the sheet IS
calculated
4 If you don't want thIS, simply copy the random numbers and paste them as ~alues
C
" D E F G H
1 lTo.89Sii41 0.895814
2 0.025902: 0.025902
3 0.979004:
, 0.979004
-~ - - - -
4 0.328873 , 0.32887: P.steOptions:
I
5 0.074517: 0.07451' ....
0.82165:" D Ix &" )' ~
6 I 0.821652:
7 _~!~Z~ 0.989476 VIJuHM
,
I.
11
5. Select ce ll Cl and look at the formula bar This cell OOIds a v alue now and not the RAND function
C1
A
I C
" 0
0.895813858170649
E F G H
1 0.619427 0.8958141
,
2 0.159024
0.431186
0.025902
0.979004
,
4 0.960913
0.n3529
0.328873
0,074517
6 0.149059 0.821652
7 0.012517 0.989476
Randbetween
The RANDBETWEEN function generates a random whole number between two boundanes
Al
" =RANOBETWEEN(50,75j
1 I
A
59 1
C 0 E F G H
2 I
3. If you want to generate random decimal numbers between 50 and 75, modify the RAND function as follows
Al
A C
" 0
=5O+25RANO(j
E F G H
1 I 6u715 1
2 I
Rank
The RANK functlOll returns the rank of a number 1Il a list of numbers
If the third argument IS DmIIIed (or 0), Excel ranks the largest number first, second largest number second, etc
81 f. =RANK(Al,$AS1:$A$9)
A 8 C 0 E F G H
,I
1 14551
,
,2 1534
,
1108
,
,
4 2109
,
, 2109
2917 1
7 1427 7
,
8 1220
2298
8
2
10
Note when we drag the RANK function down, the absolute reference ($A$1 $A$9) stays the same, while the relative
reference (AI ) changes to A2, A3, A4, etc
2 If the third argument is I , Excel ranks the smallest number first, second smallest number second, etc.
.,
A
C
" D
:RANK(A1,SA$1:$A$9,1)
, F G H
1 14551 41
2 1534 5
3 1108 1
4 2109 6
5
6
2109
2917 ,
6
7 1427 3
, 1220
2298
2
8
10
3 Use the RANK.AVG functIOn to return the average rank If more than one number has the same rank
.,
" :RANK.AVG(A1,$A$1:$A$9,1)
A
C D , F G H
1 1455 4
2 1534 5
3 1108 1
4 2109 6.5
5
6
2109
2917 ,
6.5
7 1427
,
3
,
8 1220
2298 8
10
Percentiles and Quartiles
ThIS example teaches you how to use the PERCENTILE and QUARTILE function In Excel Below VOU can find a list
of scores (green fill for illustration only)
1 Use the PERCENTILE function shown below to calculate the 30th percentile Excel retums the value 127 This
means that 30% (6 out of 20) of the scores are lower or equal to 12.7
01 f. =PERCENT1LE(Al:A20,O.3)
A B , C 0 E F G H
I
1
2
3
l ,
24
12
perce ntile 12.71
4 24
5
6
"68
7 61
,
B 4
21
10 1l
11 51
12 29
1l 15
14 B
15 6
16 1
17 47
1B 2B
"
20
23
25
21
Note The second argument of the PERCENTILE function must be a decimal number between 0 and 1 Excel uses a
slightly different algorithm to calculate percentiles and quartiles than you find In most statistics books If you're
Interested, download the Excel file
2. Use the PERCENTILE funcllDn shown below to calculate the 90th percentile Excel returns the value 61 7 ThIS
means that 90% (18 out of 20) of the scores are lower or equal to 61.7
01 f. :.PERCENnlEjA1:A20,O.9)
A B C 0 E , G H
1 241 percentile I 61,7 1
,2
12
,
4 24
"68
6
7 61
8 4
21
10
"
11
12 "
29
"
14
15
8
15 6
16 1
17 47
18 28
""
19
20
21
3. Use the QUARTlLE funcllon shown below to calculate the 1st quartile. Excel returns the value 11 25. ThIS means
that 25% (5 out of 20) of the scores are lower or equal to 11 25
01
A B C
" 0
=QUARTllf(Al :A20,1)
E F G H
11 24 quartile 11.251
,
2
12
,
4 24
56
6 6B
7 61
8 4
10
21
13
11
12 "
29
13
14 "8
"
16
6
1
17 47
18 28
19 23
20 25
21
Note: The second argument of the QUARnLE functlOl'l must be a number between 0 and 4
PERCENTILE(Al .A20,O.25) gives the exact same resuH. It's up to you which function you woukl like to use for
quartiles Below you can find an overvIeW
Noce The second ~ of the QUARTILE funcbon ITJ.ISt be a runber between 0 and 4
PERCENTlLE(Al A20,Q 25) !jIVes the exact same resuk. It's up to you which fooclKW1 you wookl Wte 10 use for
quartiIes Below you can find an fNervteW
MEDIAN(A 1 AlO)
""""" PERCENTILE{A lA2Q,O SO) QUARTlLE(A lA20,2)
Trendline
""
120 y . 77S1Sll 18.267
R O_9~ _
100
.
OJ ... '
~
'" .. -
'"
,
'",
, 1234567891011121314
Period
Explanation. Excel uses the method of least squares to fird a lioe that best frts the points The R-squared value
equals 09295, whICh IS a good frt. The closer to " the beller the lioe fits the data
'" :7.7515*A12"18.267
COUNTIF )<
1 Period
A
5ales
C 0 E F G H
2 1 20
3 2 32
5
3
"
'3
6 5 62
7 6 63
, 7 82
10 , 75
"89 E uat io n
11 10 Forecast Tre nd
12 111 :7.7515"A}2"18 .26~
13 12 111.29
13 119.04
"
15
2 Use the FORECAST functIOn to calculate future sales
x I-
e
'" 0
=FORECAST(A12.SBS2:SBS11.SAS2:SASll)
E F G H
2D
32
51
43
"
63
82
75
1__~~! ___"
~'?jEquat i on
8 Forecast Trend
103.531 :FORECA~TIAl2.SBS2:SBSll.SAS2:SASl1)1
111.29 111.28
119.04 119.04
Note when we drag the FORECAST funcbon down, the absolute references (SBSl SBStt and SASl SASl1) stay
the same, whlJe the relative reference (At2) changes to At3 and At4
3. If you prefer to use an array formula, use the TREND funclton to calculate future sales
A B C 0 E , G H
1 Period Sales
2 1 20
3 2 32
3
"
5
6
5
43
62
7 6 63
,
8
,
7
8
82
75
10 92
11 10 89 Equat ion Fo recast Tre nd
12 11 103.S3 103.S3 103.S3
13 12 111.29 111.28 111.28
I. 13 119.04 119.04 119.04
15
Note first, select the range E12:E14 Next, type =TREND(82Bll ,A2:All,AI2:AI 4) FinISh by presSing CTRl +
SHIFT + ENTER The formula bar indicates that this is an array formula by enclosing rt in curly braces 0 To delete
thIS array formula, select the range E12 E14 and press Delete
Maxlfs and Minlfs
Use the MAXIFS and MINIFS function III Ex cel 2016 to find the m3XlITlUITI and ITlIOIIllUm value based on one crrteria
or multiple cntena
For elC~ the MAXIFS foocbon below Inds the highest female score
A , C 0 E F G H
1 Name Gender Country ,'"
,
2 Richard
Jenni fer
Male Umted States
Female United Kingdom ~
74
"I
,,
4 Ja mes Male United States
"
[]
U.. Female Canada
Sharon Female Austra lia
7 Elizabeth Female Canada 91
8
, Carol
Mark
Female
Ma le
United States
Un ited States 58
"
10 John Male Ca nada 67
11 Susan fema le United Ki ngdom ~
12 Oavld Ma le United States 83
13
Note the first argument (D2:DI2 In thIS example) is always the range In which the maximum or minimum will be
determined ThIS MAXIFS funclton has 1 range/criteria pair (B2.BI21Female)
A B C 0 E F G H
1 !Nam e Gender Country .kore
2 Richard Male Uniled States 74 ",I
3 Je nnifer Female United Kingdom ~
,
4 James Male United States 55
[]"
Usa Female Canada
6 Sharon Female Australia 50
7 Elizabeth Female Canada
,
8 Carol
Mark
Female United States
Male United States
"
10 Joh n Male Canada "
67
11 Susan Female United Kingdom I 541
12 David Male United States 83
13
3. For example, the MAXIFS function below finds the highest female score in Canada
F2
A B C
" 0
=MAXIFS( 0 2:0 12,82:812, ~Female~ ,C2:C12, "Canada~}
E F G H
1 !Name Gender Country SCore
2 Richard Male Un ited States 74 91 1
1 Je nnifer Female Un ited Kingdom 92
4 James Male Un ited States 55
5 lisa Female Canada c::B
6 Sharon Female Austra lia 50
7 Elizabeth Female Canada 911
,
B Carol
Mark
Female
Male
United States
Un ited States 58 "
10 John Male Canada 67
11 Susan Female Un ited Kingdom 54
12 David Male Un ited States B3
13
Note thIS MAXIFS function has 2 range/cnterJa pairs (B2:Bt2!Female and C2Ct2lCanada) The MAXIFS and
MINIFS function can handle up to t26 range/crderJa pairs
4 The MAXIFS function below finds the highest score below 60
A B C 0 E , G H
1 Name Gender Country xore
2 Riehilrd Male United States 74 581
3 Jen nifer Female United Kingdom 92
4 James Male United Stiltes 55
,
5 Usa
Sharon
Female Canada
Female Austfaliil
B2
L::iI
7 Elizabeth Female Cana da
"
, M,,"
B Carol Female United States
Male United States "581
10 Joh n Male Canada 67
11 Susan Female Unit ed Kingdom ~
12 David Male United States B3
13
ThIS chapter illustrates three functtons to round numbers In Excel The ROUND , ROUNDUP and ROUNDDOWN
fuoc",,"
Before your start If you round a number, you lose preclSlOIl If you don't want this , show fewer decimal places
wllhout ChanglflQ the number dself
Ro und
1 Round a number to two decimal places
81 :ROUNO(Al,2)
A 8 c o E F G H
1 114.72611 114.73 1
2
Note 1, 2, 3, and 4 get rounded down_ 5, 6, 7, B, and 9 get rounded up In thIS example, 1147211 , 114.7221 ,
11 4 7231 and 11 4 7211 get rounded down to 11472 and 11472.(11 , 11 4 7261 , 11 4 7211 , 11 4 72.81 and 11 4 721l.1 get
rounded up to 11 4.73
81 {. "'ROUNO(Al,1)
A 8 C 0 E F G H
1 114,72611 114,71
2
81 {. -::ROUNO(Al,O)
A 8 C 0 E F G H
1 114,72611 115 1
2
81 {. "'ROUNO(Al,-1)
A 8 C 0 E F G H
1 I 114,72611 1101
2 J
5. Round a number to the nearest 100
81 {. =ROUNO(Al,-2)
A 8 C 0 E F G H
:I 114,72611 1001
RoundUp
The ROUNDUP function always rounds a number up (iJWay from zero) For e~ample round a number up to one
decimal place
B1
'" :ROUNOUP(AU)
A
C 0 E F G H
:I 114.72611 l14.8 1
B1
'" =ROUNOUP(Al.l)
A
~ 1-114.72611
!
0114.
C 0 E F G H
RoundDown
The ROUNDDOWN func:1Jon always rounds a numbef daYin (toward zero) For example. round a numbef doYin to
the nearest lIl\egef
B1
'" =ROUNDDOWN(Al,O)
~
A
1114.72611
1141 C 0 E F G H
B1
'" =ROUNDOOWN(Al ,O)
~
A
\-114.72611
-1141 C 0 E f G H
Chop off Decimals
In! I Trunc
This example illustrates two functions to chop off declJTlals in Excel_ The INT and the TRUNC function_
Int
The INT (Integer) function rounds a number down to the nearest integer
.,
A
1141 C
" 0
:INT(Al)
E F G H
:I 114.72611
.,
" :INT(A l )
~
A
1-114.72611
-1151 C 0 E F G H
ConcluslOll the INT functlOll only chops off decllTlals from posrtlVe nurnber5
Trunc
The TRUNC (Truncate) function always chops off decrnals
B1 I- ::TRUNqAl,Oj
A B C 0 E F G H
:I 114.72611 1141
B1 I- =TRUNQAl,Oj
A B C 0 E F G H
~ 1-114.72611 . 1141
The TRUNC function can keep any number of decrnals and chop off the rest
B1 I- ::TRUNQAl,2j
A B C 0 E F G H
:I 114.72611 114.721
B1 I- =TRUNQAl.3)
A B C 0 E F G H
1 114.72611 114.726 1
2
Nearest Multiple
Mround I Ceiling I Floor
ThIS example illustrates three fuocbons to round numbers to a multiple of x In Excel The MROUND, CEIUNG and
the FLOOR function
Mround
For example, round a number to the nearest multiple of 10
81 "MROUNO(Al,l O)
A 8 C o E F G H
~J 114.7261L I_---.O''''
10,!
2 For example, round a number to the nearest multiple of 5
A 8 C 0 E F G H
114.72611 115 1
:J
Ceiling
The same as MROUNO but rounds up_
A 8 C 0 E F G H
1 114.72611 1201
2
Floor
The same as MROUNO but rounds down
81 f.- =FlOOR(Al,5)
A 8 C 0 E F G H
1101
:I 114.72611
Even and Odd
Even I Odd I Even or Odd?
ThIS example illustrates the EVEN and the ODD functIOn In Excel_ It also shows you how to determine d a number IS
even or odd
Even
Rounds a pos~ive number up to the nearest even integer
81 ::VEN(Al)
A 8 c o E F G H
1 1161
114.72611L._--"00,.
2
2 Rounds a negative number down to the nearest even integer
.,
A
C
" 0
=EVEN(Al)
E F G H
1 1 -114.72611 -1161
2 J
Odd
Rounds a positive number up to the nearest odd Integer
.,
A
C
" 0
=ODD(A l )
E F G H
:I 114.72611 115 1
.,
" =OOO(Al )
~
A
1-114<72611
-115 1
C 0 E F G H
Even or Odd?
One w~ 10 determine if a number is even or odd is to use the MOD functIOn The MOD functlOll gIVes the remainder
01 11 dN1S1OIl
1 Even I'IUIl1bers dIVided by 2 always gIVe a remauxler of 0 For e~ampIe, 28 IS dIVided by 2 (exattly 14 times) to
gllle a remainder d 0 As 11 result, the IF function returns Even
B1
I__~A~:~~B,--.__~C____-,DC-__-,E"-___ F G H
1 2s!Ev@n 1
2
2 Odd fUT'ber5 divided by 2 aIwwofs give a retTaflder of 1 Fcx ex3fl1Jle 29 IS ch'ded by 2 (14 \me5) 10 !lIVe a
remanler of 1 As a result, the IF luncbon returns Odd
B1
Formula Errors
##### error I #NAME? error I #VALUEI error I #DIV/OI error I #REF! error
This chapter teaches you how to deal with some common formula errors in Excel
##### error
When your cell contains this error code, the column isn't wide enough to display the v alue
'2 l5000000
, c o , F
1 17,500,000
2 I lflffflflflflflf J
!t 500,000
Click on the nght border of the column A header and Increase the column width
A2 ~.
1500000O
Width : 10S7 (79 pix~~) I
1
A +
7,500,000
B C D E F
2 15,000,000
3 5OO,OOOj
4
Tip: double click the right border of the column A header to automatically frt the widest cell in column A.
#NAME? error
The #NAME? error occurs when Excel does not recognIZe text in a formula
A4 =SU(Al :A3)
A B c D E f
:j :
~ r"NAME? J~
A4
A B C
" D
=SUM(Al:A3)
E F
1 4
2 S
3 3
4 121
s
#VALUE t error
E.eel dISplays the #VALUEI error when a formula has the wrong type of argument
A4
A
C
" 0
=AHA2-+A3
, F
:t ,
4
4 [ IfVAlUE!} '
,I
la Ctlange the v;V.Je 01 eel AJto a rurtler
lb Use a fI.nc\Joflto gnore eels Ihat conIafn led
A4
" -:SUM(Al:A3)
, ,
A
C D
#D IV/O! error
E.cel displays the #OIV/OI error when a formula tries to divide a number b)' 0 or an empty eel
A3 =Al/A2
A
c o , ..F~
1 4
2 0
3 [ /lDIV/O! } ,
4
la Change the v alue of cell A2 to a v alue that IS 001 equal to 0
lb Prevent the error from being displayed by USing the logICal functIOn IF
A3 f. : IF(A2=O, _. ,At/A2)
1
A
4
C D E F
,2 0
I
4
ExpianallOrl' celA2 equals 0, an empty stmg n IS lisplayed. II noI.. the result of the formula AllA2 IS displayed.
#REF! error
Excel displays the //REFI error when a fOffT"da refers to a cellhat IS not vaIKI
C1 =A1+S1
A
6'LI_ C
---"'10,1
D E F
:I 4
1
A
B '"i
C'"
- ,
2. Delete column 8 To ac hieve this, right click the column 8 header and click Delete
E F
2 "~ ,"opy
3 Paste Options:
5 I ." ~
A
, P~st~ Spe(l~1...
7 !n~m
,
B Jl<l~.
Our Contents
~
10
11
..
IB format Cells ...
13
14
15 ..; 1:1
!:::!Id~
Ilnhlde ~
3. Select cell 81 The reference to cell 81 IS not v alid anymore
81
A B C
" 0
=AIHlREF !
E F
@.I'
:I #RE F! I
4 To fIX this error, you can either delete +#R EF! in the formula of cell 81 or you can undo your action by pressing
CTRl + z
ThIS example illustrates the IFERROR funclton In Excel
For ex ample. Excel displavs the #DIV/o! error when a formula tries to divide a number by 0
C2
" =A2/B2
1
A
C 0 E F G H
2 ,,,
829 2 414.5
01 "DlV/ O! I
3 946 4 236.5
4 604 4 151
5 576 1 192
6 554 5 110.8
7 637 0 "DIV/ O!
,
8 560
672
2
4
280
168
10 728 10 72.8
11
2. Use the IFERROR functIOn If a cell contains an error. an empty string (- ) IS displayed
C2
" =IFERROR(A2/B2, "~I
1
A
", C 0 E F G H
2 ,,, 2
01
414.5
I
3 946 4 236.5
4 604 4 151
5 576 3 192
6 554 5 110.8
7 617 0
,
8 560
672
2
4
280
168
10 728 10 72.8
11
IsError
Thrs e~ampIe liustrates the ISERROR fooclJon ~ Excel
1 for ex~_ Excel displays the IIDIV/O! error when a fomUa tnes to cWde a I'olMTIbef by 0
C2 f. :A2/B2
A 8 C 0 E F G H
82. 2 414.5
'" OI IfOIV/O! !
4
'"
004 4
236.5
151
57.
5,. 5
3
'"
110.8
'"
5"
0 IfOIV/O!
2 280
072 4 168
728 10 72.8
The ISERROR fur.ctJOn checks whether a value is an error and returns TRUE or FALSE
2 Use the IF and the ISERROR funclJon. If a cell contains an error, the value 5 IS returned If not, the value 100 IS
,~-
C2 f. :IF(ISERROR(A2/82).S,lOO)
A 8 C 0 E F G H
1 82. 2 100
2
'" 01 5!
3 100
4 '"
004
4
4 100
5 57. 3 100
7
5,. 5
0
100
5
'"
5" 2 100
Aggregate
Excel /UnctlOOS such as SUM, COUNT, LARGE and MAX don', work if a range Includes errors However, you can
easily use the AGGREGATE function to fix thIS
For example, Excel returns an error If you use the SUM function to sum a range wJth errors
A9
A
C
" 0
=SUM(Al:A7)
E F G H
1 IffiEF !
2 5
3 4
4 IIDI V/O!
5 If NAME?
6 1
7 3
, r IfREF l
m
10 1
2. Use the AGGREGATE function to sum a range with errors
.,
" =AGGREGA TE(9,6,Al:A 7)
,
1
A
/fREF !
C 0 F G H
2 5
3 4
4 IfOIV/O!
5 /fNAME?
6 1
7 3
, 13
10 1
ExpianatlOll: the first argument (9) tells Excel that you want to use the SUM functlOll The second argument (6) tells
Excel that you want to ignore error v alues
3. Irs not easy to remember whICh argument belongs to whICh function Fortunately, the AutoCompiete feature In
Excel helps you with thIS
3 Irs not easy to remember whICh argument belongs to whICh functIOn Fortunately, the AutoCompiete feature in
Excel helps you with thIS
COUNn F X ./ ,. =AGGREGATEd
,
8
"AGGREGATE!
(] 9 SUM
[J 10 VAR.S
[ ] 11 VAR.P
10 9 12 . MEOI4.N
11 D 13 MODf.SNGL
12 D 14 . lARGE
13 g IS . SMAll
9 16 . PERCENTlLE.IIl(
14
D 17 QUARTlLE.1NC
15 D ill PERCENTIlE.EXC
16 [ ) 19 . QUARTlLE.EXC
17
4 The AGGREGATE function below fmds the second 10 largesl number II'! a range with errors
A B c o E f G H
,,
1 lfREF!
S
4
4 ROlv/ O!
S lfNAME?
6
7 ,1
8
Explanatton the first argument (14) tells Excel that you want to use the LARGE function The second argument (6)
tells Excel that you want to Ignore error values_ The fourth argument (2) tells Excel that you want to find the second
to largest number
5. The AGGREGATE function below finds the maximum value ignoring error values and hidden rows
A9 {z =AGGREGATE(4, 7,Al:A 7)
A , C D , F G H
1 "REF !
3 4
,
4 " OIV/O!
"NAME?
6 1
7 3
,
8
4
10 1
Explanatton the first argument (4) tells Excel that you want to use the I\IlAX function The second argument (7) tells
Excel that you want to ignore error values and hidden rows In thIS example, rrm 2 is hidden
Circular Reference
A formula In a cell that directly or Indirectly refers to rts own cell is called a circular reference This is 00\ possible
1 For example, the formula in cell A3 below directly refers to rts own cell ThIS is not possible
COUNTIF x =A1+A2+A3
A
c o , F G H
1 Ii
2 1 ,i
! f=Al+A2+~~
Note: Excel returns a 0 Jfyou accept thIS clrcul<ir reference
C<
A B (
'" 0
=Cl*2
E F G H
1 1 2
2 3 41
3
4
0
16
5
=cr2
'"
(3
A B ( 0 E F G H
1 1 2
2 3 4
3 0 .1
4 16
5
C4
A
(
'" 0
=<:3*2
E F G H
1 1 2
2 3 4
3
4
0
16 1
5
2d So far, everything's OK. Now change the value In cell Cl to the formula =C4 Cell Cl refers to cell C4, cell C4
refers to cell C3, cell C3 refers to cell C2, and cell C2 refers to cell Cl In other words , the formula In cell Cl
indirectly refers to rts own cell This is not possible
COUNTIF X ~ f. ~
1
A
1
C
.CA(
D E F G H
2 3 4
3 0 8
4
1
161
5
3. To find your circular references , on the Formulas tab, In the Formula Audrung group, click the down arrow next to
Error Checking
Trac"Irror
,ircu", ReffleflCes ~ SC Sl
1CS4
scn
SCS2
Formula Auditing
Trace Precedents I Remove Arrows I Trace Dependents I Show Formulas I Error Checking I Evaluate Formula
Formula auditing in Excel allows you to display the relationship between formulas and cells The example below
helps you master Formula Auditing quic k ly and easily
1
A
c o E
2
Day out Boat trip
3
4 De Kription Am ount
5 Boat rent 5 400.00
6 Boat fuel S 33.00
7 ute vests S 20.00
, Picn ic
Dinner
S 68.00
S 240.00
10 Total cost S 761.00
11
12 Group size .1
Cost per person S 96.00
13J
14
Trace Precedents
You have to pay $96.00 To show arrows that indicate whICh cells are used to cak:ulate thiS value. execute the
following steps
2 On the Formulas tab, in the Formula Aud~ing group. click Trace Precedents
ResuH:
C13 :ROUNOUP(C10/C12,OJ
A B c o E
1
2
Day out Boat trip
3
4 DeKTiption Amount
5 Boat re nt 5 400.00
6 Boat fuel S 33.00
7 Ufe vests S 2<).00
,8 Picnic
Dinner
S
S
68.00
240.00
10 Total cost 761.00
11
12 Group size 8
"I
14
Cost per person S 96.00
As expected. Total cost and Group size are used to cak:ulate the Cost per person
3 Chck Trace Precedents again
A , c o ,
1
2
, Day out - Boat trip
,,
4 Descriptio n
Boat re nt
Amount
400.00
Boat fu e l 33.00
7 Ufe ve st s 20.00
8
, Picnic
Dinner
68.00
240.00
10 Tota l cost 761.00
11
12 Group size 8
13 Cos t per person ".00
14
As e~ pected, the different costs are used to cak:ulate the Total cost
Remove Arrows
To remove the arrows, execute the following steps
1 On the Formulas lab, 11 the Formula Auditing group, click Remove Arrows
1 Select cell C 12
2 On the Formulas tab, 11 the Formula Auditing group click Trace Dependents
cu
A B c o E
1
2
Day out Boat trip
1
4 De scription Am o unt
5 Boat rent S 400.00
6 Boat fuel S 33.00
7 Ufe vests S 20.00
, Picn ic
Dinner
S 68.00
S 240.00
10 Total cost S 761.00
11
12
13
Group size
Cost per person
!
S 96.00
14
""'"
1 On the Formulas tab, In the Formula Auditing group, click Show Formulas
ResuH_
F24
,. A B c o
1
2
Day out - Boat trip
3
,
4 Description
Boat rent
Amo unt
400
6 BOilt fuel 33
7 U fe vest5 20
,
8 Picnic
Dinner
68
24<)
10 Total cost -=5UM(C5:C9)
11
12 Group size 8
13 Cost per person =ROUNDUP(C10/Cl2.0
14
Note instead of clicking Show Formulas, you can also press CTRl + C) You can find thIS key above the tab key
Error Checking
To check for common errors that occur III formulas, execute the followlng steps
C13 =ROUNOUP(ClO/C12.0j
1
A
c o E
,
2
Day out - Boat trip
4 DeK riptio n Amount
5 80at rent S 400.00
7
80at fue l
Life vests
S 33.00
S 20.00
, Ph;nic
Dinner
S ".00
S 240.00
10 Total cost S 761.00
11
12 Group slzl! o
13 Cost per person ~, !fDlv/o! 1
14
2 On the Formulas tab, 11 the Formula Auditing group, click Error Check.ng
Resull E)(cel fnis iW1 error 11 eel C13 The forrTUa Ines to drvlde a runber by 0
Resutt. Excel finds an error in cell C13 The formula tries to divide a number by 0
Error ChKking 7 x
Error In <ell e 13
- RQUtmUp(C1 01el2,0I
I: I1!!.e on this error I
Divide by Zero ErrOl Show .calculalion StepI ...
Qptionl .. frmoul
Evaluate Formula
To debug a formula by evaluatrng each part of the formula rndivldually, execute the following steps
1 Select cell C 13
2. On the Formulas tab. rn the Formula Atxlitrng group, click Evaluate Formula.
o. TriKt PrK~tnts
;t;"
'<t Tract Otptndl!nts
""
'rM Show FOl1Tlulal
....t Error ChKk.ing W
Watch
l'X RemoveAff0W5 mEvaluatt~ormula Window
Formula AUdrlinr'
3 Chck Evaluate four tunes
Ev.luate Formula I X
! d erenu: f!llu. lion:
ShHt1!SCSIl ~ [R0UtmUP(QWCI2.OI
I
Evalu.te Formul. I X
!derence: E! . luatJon:
ShHtt !SO 11 - [R0UNOUP{76IIQZ.OI
I
Ev.luate Formul. I X
.
To !dtrenct:
ShHtt !SOI3
E!.luaIJon:
- IROUtlOUPlliUl.CI
Ev.luate Formul. I X
- To ,
!derence:
5hfti:t !SCSIl
- To I I
L-
To Ihowthe result of the underlined e~prtulon, dick E'i'llu.tf. The mOII/Hent /esult
.ppurl italicized.
....IUlt~ ~Iole
Excel shows the formula fesutt.
1 x
BdfUntf: fIaluallon:
SheetI !SCS13
To showlhf ffSUIl 01 thf underlined eJq)feuiol\ did: EY.luate. The most fUfnt ffSUIl
appears illJidzed.
I RciiO
Floating Point Errors
Excel stores and cak::ulates /loatlllg point numbers Sometimes , the resutt of a formula is a very close approximation
For example, take a look at the formulas below At first glance, everything looks alrghL
C8 {z =A8-B8
A B C 0 E F G H
1 1.' 1.7 0.2
2
3 ..,
1.3 1.2
5.7
0.1
..,
3.2
4 '.5 I.'
5 7.' 5.5 2.1
4.1 2.5 I..
7 3.7 3.1
C8
A B C
'" =A8-B8
0 E f G H
1 1.' 1.7 0 ,2000000000000000
2
3
4
..,
1.3
' .5
1.2 0, 1000000000000000
5.7 3,2000000000000000
I.. ' .900000000000000
5 7.' 5.5 2,1000000000000000
7 4.1 2.5 1.600000000000000
3.7 3,1000000000000000
1.110, 09999999999999991
,
B 1.2
You don't have to worry about fIoallng point errors They are rare
3. Even if your worksheet Contains a fIoallng point error, in most cases . this causes no problems However, if you
compare the value In cell C8 wllh another value. the follclWlng problem can occur
DB
'"
=IF(C8>:::(I.1, ~yes~, ~no" )
A B C 0 E f G H
1 1.' 1.7 0 .2 yes
2
3
4
..,
1.3
' .5
1.2
5.7
I..
0.1 yes
3.2 yes
6.9 yes
5 7.' 5.5 2.1 yes
3. 7 3.1 :tes
I
:1 1.2 1.1 o.l lna
4 Use the ROUND funcllon to fIX thIS
A 8 C 0 , , G H
1 1.' 1.7 0.2 yes
,
2 1.3
8.'
1.2
5.7
0.1 yes
3.2 yes
4 8.5 1.6 6.9 yes
5 7.6 5.5 2.1 yes
6 4.1 2.5 1.6 yes
7 6.8 ' .7 3.1 ~es
81
, 1.2 1.1 o.l lyes
I
Array Formulas
Without Array Formula I With Array Formula I F9 Key
This chapter helps you uroderstand anay formulas in Excel Single cell array formulas perform multJpIe cak:ulations in
ooecell_
02 f. :(2-82
1 Student
A
TestA
C
Test B
0
prollress
E F G H
2 Jaso n
" ,.1 19 1
3 lisa 34 67 33
4 Rya n 30 93 63
5 Richard 35 83 48
82
6 Anna
7
" 13
2 Next. we would use the MAX function to find the greatest progres s r:.1
07 f. =MAX(02:06)
A
C 0 , F G H
1 Student TestA Test 8 Progress
, Uu
2 Jason
" 78 19
,.
.
"
34 67
Rya n
4
" "
,5 Richard
Anna " "
7 " 82
I
13
,,!
8
, We . .eactv know that we can find the progress 01 the fIrSt stuclefll by uslOQ the formula below
E1 f. =C2-8 2
A
C 0 , F G H
1 Student TestA Test 8 191
,2 Jaso n
" 78
Lisa
4 Ryan ,.
34 67
"
,5 Richard
Anna " "
7 " 82
2 To find the greatest progress (don't be overwhelmed), we add the MAX functIOn, replace C2 wrth C2C6 and 82
woth 82 B6
X f. "'MAX(C2;C6- B2;86~
COUNTIF
A B
'"
C 0 E F G H
1 Stud ent Test A Test 8 ::MAXI C2 :~6-B2: B6 )
2 Jason
3 U,. "
34
78
67
,
4 Ryan
Rich ard
30
"
Anna " B3
7
" 82
E1 f. {:MAX(C2;C6-B2:B6) t
A B C 0 E F G H
1 Stud ent Tes tA Test B 63 1
2 Jason
3 U" "
34
78
67
,
4 Rya n
Ri chard
30
"
""
B3
7
Anna 82
Note The fornUa bar Ifldicales that this IS an i1ffW<I iomUa by enclosng " If\ cUf~ braces 0 Do not type these
yOUf'SeW They WlI disappear when you edit the fornUa
8cplao:\abon The range (array constant) is stored If\ Excel's memory not If\ a range The array constant looks as
,-..
(19,33,63,48,I3)
ThIS array constant IS used as an argument for the MAX fooctJon, grvng a result 0163
F9 Key
When Working wJ!h array formulas, you can have a look at these array constants yourself
A
C 0 , f G H
loMAXlc,,,
,1 Student
Jason
TestA
"
Test B
78
3 U,. 34 67
Ryan
4
'" "
, Anna
5 Richard 35
"
83
82
7
2 Press F9
A
C 0 , f G H
, Jason I
1 Student TestA Test B 11;48;13})
3 Usa "
34
78
67
Ryan
4 30
"83
, Anna
5 Richard 35
" 82
7
That looks good Elements III a vertJC.aI array constant are separated by sen.:oIons Elements III a horizontal array
constant. are separated by corrmas
Count Errors
ThIS example show's you how to create an array formula that counts the number of errors in a range
1 We use the IF function and the ISERROR function to check for an error
, A
If REF!
C
2 IfDlV/O!
0 E F G H
2 4 7 2
3 5 3 " IfNAME?
4
,I
~1 '-------',.
Explanation: the IF functlon returns " if an error IS found If not, rt returns an empty string
2 To count the errors (don't be overwhelmed). we add the COUNT funcllon and replace AI wrth A1C3
oC~"F~!-"--cB~-o
, " ,.. , ,"
=OIO~O/O~!Cf--co<------,E--____"F__-"__cG~~__cH
, -____-"___
05 /z (=COUNT(IF(ISERROR(A1:C3),1, U)))
o
, A B
, C E F G H
, IfREF !
5 ,
IfDIV/O!
, 7
3 " IfNAME?
5 1 ,I
'-------'.
6j
Note The formula bar Indicates that thIS IS an array formula by enclosing rt In curly braces 0 Do not type these
yourself They will disappear when you edit the formula
Explanation The range (array constant) created by the IF function is stored In Excers memory, not in a range The
array constant looks as follows
{1,-, 1,-,-,-;-,-, 1)
ThIS array constant IS used as an argument for the COUNT functlon, gIVIng a resutt of 3
4 To count specifIC errors, use the COUNTIF functlon For example, to count the number of cells that contain the
4 To count specifIC errors , use the COUNTIF function For example, to count the number of cells that contain the
#DIV/o! error
A B C
'" 0 E F G H
1 If REF! 2 #D IV/O!
2
l ,
4 7
l IfNAME?
2
:I
Count Unique Values
Thts 6ampie shows you how to create an array formula that counts UOIqIJe values
1 We use the COUNTl F function. For example. to clUll the number of Ss, use the folowlng function
C3
'" =COUNTlF(Al:A6.S)
, A
7
C 0 E F G H
,2 ,un
moon ,I
4 5
5 7
6 7
7
2 To count the unIQue values (don't be overwhelmed), we add the SUM function, I I, and replace 5 with Al:A6
!~moon 5
I",S UMjl/COUNTIF (Al:A6,Al:A6 ))
5 7
6 7
71
3 Finish by pressing CTRl + SHIFT + ENTER
A , C 0 E F G H
1 7
2
3
'""
moon 41
4 5
5 7
6 7
7
Note The formula bar Indicates that thIS IS an array formula by enclosing rt In curly braces {} Do not type these
yourself They will disappear when you edrt the formula_
Explanation The range (array constant) created by the COUNTIF function IS stored in Excers memory, not in a
range The array constant looks as follows
{3;1 ,U ;3;3} - (three Ts , one sun, one moon, one 5, three Ts , three Ts)
ThIS reduces to
{1/3,1/1 ,1/1 ,1/1 ,1/3,1/3}
ThIS array constant IS used as an ar umentfor the SUM funcllon, glVl a resuH of 1/3+ 1+ 1+ 1+ 1/3+ 1/3 = 4
Count with Or Criteria
Counting with Or crrteria In Excel can be tricky This article shows several easy to follow examples
1 We start simple For example, we want to count the number of cells that contain Google or Facebook (one
column)
A B c o E F G H
1 Go()sle
2 Facebook
3 Twitter
,
4 Facebook
, Goo Ie
Twitter
7 Goo Ie
,
B Twitter
10 If - _----",!
nl
2a However, If we w ant to count the number of rows that contain Google:2( Stanford (two columns), we cannot
simply use the COUNTlF function twice (see the picture below) Rows that contain Google and Stanford are counted
twice, but they should only be counted once 4 IS the answer we are looiling for
.,0
A ,,
1 GoolI:le IStanford
=COUNTJF( Al :A8, ~Googl e")+COUNTJF(91:98, "Stanford ft )
C 0 , F G H
2 Facebook Harvard
3 Twitter IStanford
4 Facebook Columbia
,
5 GooRle
Twitter
Harvard
Harvard
7 Goo Ie Stanford
,
8 Twitter Harvard
10
11
I ,I
2b What we need IS an array formula_We use the IF funcllon to check If Google:2( Stanford occurs
A 8 C 0 , F G H
1 Google Stanford
2 Facebook Harvard
3 Twitter Stanf ord
4 Facebook Columbia
,
5 Google
Twitter
Harvard
Harvard
7 Google Stanford
,
8 Twitter Harvard
10
11
I 11
ExplanatlOll TRUE =I , FALSE =0 For rfloN " the IF func::tlOll evaluates to IF(TRUE+TRUE, 1,0), IF(2,I ,O), 1 So the
first rfloN will be counted For rfloN 2, the IF furx:1Ion evaluates to IF(FALSE+FALSE ,I,O), IF(O,I,O), 0 So the second
rfloN will not be counted For rfloN 3, the IF furx:1Ion ev aluates to IF(FALSE+TRUE . l,O), IF(I, 1 ,0), 1 So the third rrm
WII be counted, etc
2c AI we reed IS a SUM foocllon that counts these I's To achieve this (donl be overwhelmed), we add the SUM
foocllon and replace AI wlthAl.A8 and Bl wrth Bl B8
COUNTIF
1 Google
A
Stanford
c D E F G H
2 Facebook Harvard
3 Twitter Stanford
4 Facebook Columbia
5 Google Harvard
6 Twitter Harvard
7 Google Stanford
Harvard
: j TWltter
10 I=SUM( IF( (~1:A8="GoogleM )+( 81: B8=MStanford" ),l ,O))
11
A 8 C 0 E F G H
1 Goo~le Stanford I
,
2 Facebook Harvard
Twitt er Stanford
4 facebook Columb ia
5 Gool{l e Harvard I
6 Twitter Harvard
7 Goo Ie Stanford
,
8 Twitter Harvard
10 41
11 1
Note The formula bar Indicates that thIS IS an array formula by encioslrlQ rt in curly braces {} Do IlOI type these
yourself They will disappear when you ed~ the formula
Explanation. The rarge (array constant) created by the IF functlOll IS stored In Excefs memory. not In a rarge The
array constant looks as follows
ThIS array constant IS used as an argument for the SUM funclJon, gIVing a result of 4
3. We can go one step further For example, we want to count the number of rows that contain (Google and Stanford)
Q[ Columbia
A 8 C 0 E F G H
1 Google Stanford I
2 Facebook Harvilrd
3 Twitter Stanford
4 Facebook Co lumbia
5 Googl e Harvard
6 Twitter Harvard
7 Goo I. Stanford
Sum Every nth Row
This example shows you how to create an array formula that sums every nth ffloN In Excel We will show rt for n = 3,
but you can do this for any number
., ,. =ROW(A l )
1
A
701
11
C D E F G H
,
2 74
5 ,
2
4 4 4
5
6
"66 5
6
7 88 7
,
8 52
21 ,
8
10
2 The MOD fur.c:tlOn gIVes the remalrder of a dIVISIOn For example, for the first ruw, MOO(I ,3) equals " 1 IS divided
by 3 (0 tunes) to gIVe a remairxlef of 1 For the third ruw, MOO(3,3) equals 0 3 IS dIVided by 3 (eKoctJy 1 tune) to gIVe
a remalrxlef of 0 As a result. the formula returns 0 for every 3th ruw
81 f. :MOD(ROW(AI).3}
A 8 C 0 E F G H
1 701 1!
,2 74
5
2
5 1
7
..
"
sa
2
1
8
" 2
,. 21
Note change the 3 to 4 to sum every 4th ruw, to 5 to sum every 5th ruw, etc
A 8 C 0 E F G H
1 701 FALSE
I
,
2 7.
5
FALSE
TRUE
5
."
FALSE
FALSE
7 sa
TRUE
FALSE
8 FALSE
"
,. 21 TRUE
4 To get the sum of the product of these two ranges (FAlS E=O, TRUE= I), use the SUM /uoction and finish by
presSing CTRl + SHIFT + ENTER
A , c o , F G H
1 70
2 7.
3 ,
,
"66
6
7 88
,,
"
21
1O f---::1
11 L_-,'~2~.
121
Note. The formula bar indicates that this is an array formula by eoclosing ~ in curly braces 0 Do not type these
yourseH They will disappear when you ed~ the formula.
Explanation. The product of these two ranges (array constant) IS stored in Excel's memory, not in a range The array
constant looks as follows
{O:O:5:0:0:66;O:O:21}
ThIS array constant is used as an argument for the SUM fuoclK>n, gIVing a resuH of92.
Sum Largest Numbers
ThIS example shows you how to create an array formula that sums the largest numbers In a range
We use the LARGE functIOn For example, to find the second to largest number, use the followlrog functIOn
C1
A B C
'" 0
=lARGE(Al:All,2)
E F G H
1 s 101
2 1
3 6
4 4
S 2
6 3
7 10
,
8 8
22
10 3
11 S
12
2. To sum the 4 largest numbers (don't be overwhelmed), add the SUM function and replace 2 wllh {I ,2,3,4}
1
A
S
C D E
I-=S UM(LAf\.GE(Al;Al1,{l,2, 3,4}))
F G H
2 1
3 6
4 4
S 2
6 3
7 10
,
8 8
22
10 3
11 5
12
1
A
s
C
46 1
D E F G H
2 1
3 6
4 4
5 2
6 3
7 10
,
8 8
22
10 3
11 S
12
Note The formula bar IndICates that thIS IS an array formula by enclosu'lg ~ In curly braces 0 Do not type these
yourseH They Will dISappear when you ed~ the formula
ExplanatIOn The range (array constant) created by the LARGE functlOrllS stored II'! Excefs memory, not II'! a range
The array constant looks as follows
(22.10,8,6)
ThIs array constant IS used as an argunent for the SUM fI.n::bon, QlYI'IQ a result of 46
Sum Range with Errors
Thts exa~ shows you how to create an array formula thai SI.lfT1S a range wlltl errors Yoo can also use the
(
AGGREGATE funcbOn to sum a range wllh errors
., Is :IFERROR(Al,O)
1
A
IfREF I
c o E F G H
,
2 5
4
4 "OIV/O!
,
5 "NAME?
7 ,
1
' pI
10
Explanatton the IFERROR fuoction returns 0, if an error IS found_ If not, ~ returns the value of the cell
2 To sum the range with errors (don't be overwhelmed), we add the SUM fuoction and replace AI wrth Al:A7
1{
A
IfREF !
c D E F G H
~ 1. !
4 "OIV/ O!
51'"NAME?
'j 1
7 3
: f=SUM(IFE~ROR(Al:A7.0))
IO j
3_ FinISh by presSing CTRL + SHIFT + ENTER
A
C
" D E F G H
1
2
"REF !
,
3 4
,
4 "OIV/ O!
, "NAME?
1
7 3
, I nl
IO j
Note The formula bar Indicates that thIS IS an array formula by eocioslng ~ in curly braces {} Do not type these
yourself They wiH disappear when you edrt the formula
Note The formula bar IOOlCates that thIS IS an array formula by enclosng n III CUlly braces 0 Do not type these
yourself They will disappear when you edit the formula
Explanation The I"aI)ge (array constant) created by the IFERROR funcbon IS stored III Excel's memory. not III a
range The 00<11 constant 100II5 as follows
(O.5,4.0.0.1.3)
TtMs M"'f ConstanllS used as iIIl ~ for the SUM fmcbon. IJlllrog a result 0113
1 We start Simple. For ex ample, we want to sum the cells that meet the following crrteria_ Google Q( Facebook (one
crrten1l range).
A r c 0 E F G H I
1 Goo Ie
2 Facebook ,3
3 Twitter
,2
,
4 Facebook
Goo Ie 4
6 Twiner 3
7 Goo Ie 1
,8 Tw itter 1
~~J
2a. However, if we wan! to sum the cells that meet the following criteria Google Q( Stanford (two crrteria ranges), we
cannot simply use the SUMIF function twice (see the picture below) Cells that meet the crrteriil Google and Stanford
are added twICe, but they shoukl only be added once 10 IS the answer we are Iool<lng for
1
A
Goo Ie
B
Stanford
C
, 0
6
E F G H
2 Facebook Harvard 5
3 Tw itter IStanford 2 2
4 Facebook Columbia 5
5
6
Goo Ie
Twitter
Harvard
Harvard ,
4 4
7 Goo Ie Stanford 1 2
,
B Twitter Harvard 1
Ii
I. 141
II
2b. We need an array formula We use the IF function to check if Google Q( Stanford occurs
Cl . =IF((A1=-"Google")+{61="Stanford"),1,O)C1
1 Google
A B
Stanford
C
, 0 E F G H
2 Facebook Harvard 5
3 Twitter Stanford 2
4 Facebook Columbia 5
5
6
Google
Twitter
Harvard
Harvard ,
4
7 Google Stanford 1
,
B Tw itter Harvard 1
I. ,I
11
Explanation TRUE = " FALSE = For r(JoN I , the IF functlOll ev aluates to IF(TRUE+TRUE ,I ,O)'3, IF(2,I ,O)'3, 3.
So the value 3 will be added. For r(JoN 2, the IF function ev aluates to IF(FALSE +FALSE, 1,0),5, IF(O,I ,0)'5, So the
value 5 will not be added For r(JoN 3, the IF function evaluates to IF(FALSE +TRUE ,I,0)'2, IF(I ,I ,0)'2, 2 So the
value 2 will be added, etc
2c. All we need IS a SUM functlOll that sums these v alues. To achieve thiS (don't be overwhelmed), we add the SUM
function and replace AI with A I .A8, Bl wrth Bl.B8 and Cl with Cl.C8
A B c o E F G H
1 Google Stanford 3
2 Facebook Harvard 5
3 Twitter Stanfo rd 2
4 Facebook Columbia 5
5 Google Harvard 4
6 Tw itter Harvard 3
7 Google Stanford 1
B Twitter Harvard 1
:o(
11
.
I=SUM(IF(( Al:A8= " Google )+( 61:88=. Stanford " ),1,0)C1:C8j
A B C 0 E F G H
1 Goo Ie Stanford 3
2 Facebook Harvard 5
3 Twitter Stanford 21
4 Facebook Columbia 5
5 Goo Ie Harvard 4
6 Twitter Harvard 3
7 Goo Ie Stanford 11
,
B Twitter Harvard 1
10 101
11
Note The formula bar indicates that this is an array formula by enclosing d in curly braces 0 Do not type these
yourself They will dis appear when you edd the formula.
Explanation The range (array constant) created by the IF fuoction is stored In Excers memory. not in a range The
array constant looks as follows
{I ;0:1;0:1;0:1;0)
{3;O;2;O;4;O;I:0}
ThIS latter array constant is used as an argument for the SUM function, givlrog a resutt of 10
3 We c an go one step further For example, we want to sum the cells that meet the foilowll"IQ criteria. (Google iIDd
Stanford) Q[ Columbia.
CI0 ... I =SUM! I F( (A l:A8=~Google"j( Bl:IJ8="Stanford ft j+(81:B8="Columbia"), 1,0) .C1:C8j}
A B C 0 E F G H
1 Goo Ie Stanford 3
2 Facebook Harvard 5
3 Tw itter Stanford 2
4 Facebook Columbia 5
5 Google Harvard 4
6 Tw itter Harvard 3
7 Goo Ie Stanford 1
,
B Tw itter Harvard 1
10 ,I
11
Two-column Lookup
ThIS example teaches you how to perform a two-column lookup In Excel See the example below 'We want to look
up the s alary of James Clarll , not James Smith, oot James Anderson
A
1 First Name Last Name Salary
C D E F G H
'4 {=MATCH{F2&F3,A2:A8&B2:88,O).
A B c o E , G H
1 FIrst Name Last Name Salary
,2 James
James
Smit h
Ande~on
564,901
$70,&55
F i~t Name James
Last Name rCel~''''
~_---:1
4 James Cl ark $188,657 salary LI_ _ _ - '3!
5 John Le wis $97,566
6 John Walker 558, 339
7 Mark Reed $125,180
,
8 Richard l o pez $91,632
NOIe The fomJ.JIa bar indicates that tIvs IS an array fomua by eocloslOQ A In curly braces 0 Do I'IO! type these
yourself They wil disappear when you edit the formula
E~planauon The range (array constant) A2AS&B2 BS IS stored In E~cel's memory, I'IO! In a range The array
constant looks as follows
4 Use thts resutt and the INDEX foocbon to retOOl the 3rd value In the range C2 C8
4 Use thIS resuH and the INDEX function to return the 3rd value In the range C2:C8
F4 I- {=INDEX(C2:CS,MATCH(F2&F3,A2:A8&S2:B8,O}}}
1
A
first Name Last Name salary
C 0 E F G H
You c an use the MODE function to find the most frequently occurring number However, the MODE function only
worlls with numbers
C3 ~ :c.MOD(Al:A7)
A B C o , F G H
1 12
2 16
3 16
4 16
5 11
6 11
7 16
8
You can use the COUNTIF function to count the number of occurrences of each word However, we are Iooklrg for
F
a Single formula that returns the most frequently OCCUrring word (circle in our e xample)
02 :COUNTIF(SA$1:SA$7,C2) I
A B ( o E F G H
1 !triangle
2 circl e triangle
3 circl e circl e
4 circl e square
5 square
6 square
7 circl e
8
To find the most frequently occumng word, execute the following steps
A B ( o E F G H
1 ~triangle
2 circl e
3 circl e ,I
4 circl e
5 square
6 square
7 circl e
8
Ex planation circle (Al) found at position 2 In the range AI.Al. Set the third argument to 0 to return an e xact match
2. To find the posruon of the most frequently occurnng word (don't be ovelWhelmed), we add the MODE functlOll and
replace A7 with A t .A 7
A
C o E F G H
,,
1 triangle
circle
circl e ,!
4 circle
,
5 square
square
7 d rd e
8
N01e The forTllllla bar ndicates that this IS an arrWf fonnula by encbstng A 11"1 ctJrfy braces 0 Do not type these
yourself They will dISappear when you edit the formula
EKplanatlOll The range (array constant) created by the MATCH furx:tIOIl IS stored III EKcers memory, not III a range
The array constant looks as follows'
{1 ,2,2,2,5,5,2) _ (tnangle found at position 1, circle found at posAIOIl 2, circle found at posItIOn 2, etc )
Thrs array constant IS used as an argument for the MODE functIOn, glVtng a result of 2 (the posttlOl1 of the most
frequently occurmg word)
4 Use this result and the INDEX functIOn to return the 2nd word 11 the range At A7, the most frequently occurmg
_d
4 Use thIS resutt aOO the INDEX functton to return the 200 word In the range AlA7, the most frequently occurnng
word_
C3 /z 1=INDEX(Al:A7,MODE(MATCH(Al:A7,Al:A7,OJ))}
A B c o E F G H
1 1trianSIe
2 circl e
3 circl e !circl e 1
4 circl e
5 square
6 square
7 circl e
8
System of Linear Equations
ThIs e ...mpIe shows you how to solve a system of ineilr equatJOOS III Excel For e.ilmpIe, we have the folowmg
system of linear equa\1OIlS
5. .. ly .. 8z = 46
4x-2y =12
ax+7y+4z=50
If A-I (the InVerse of A) eXISts we can multiply both sides by A-I to obtain X = A-'S To solve ttvs system of !rear
equatIOnS III Excel. exec::l)I:e the folowng steps
1 Use the MINVERSE fuoction to return the inverse matnx of A. First. select the range 86:08 Next. insert the
MINVERSE fuoctlOll shown below. Finish by presSing CTRL + SHIFT + ENTER
1
A
C 0 E F G H J
,
2 5 1 8
46
4
A
,
4 2
7
0
4
12
50
,5
-0.0303 0.197 0.0606
7 A" 0.0606 .0.1061 0.1212
,
8 0.1515 -0.1098 -0.053
Note the formula bar Indicates that the cells contain an array formula. Therefore. you cannot delete a Single resuR.
To delete the results . select the range 86.08 and press Delete
2. Use the MMULT fuoctlOll to return the product of matnx A-I and 8 First. select the range G6G8 Next. Insert the
MMULT fuoction shown below Finish by pressing CTRL + SHIFT + ENTER
G' I- {=MMULT(86:D8,G2:G4)}
1
A
C 0 E F G H J
,
2 5 1 8
46
4
A
,
4 2
7
0
4
12
50
,5
EB
-0.0303 0.197 0.0606
7 A" -0.0606 -0. 1061 0.1212 X
,
8 0 .1515 -0. 1098 -0 .053
3. Put rt all together First, select the range G6-GB Next, Insert the formula shown below Finish by presSing CTRL +
SHIFT + ENTER
G' f. {:MMUlTfMINVERSEfB1:04),G1:G4)}
A B C 0 E f G H J
1
,
2 5 1 B 46
4
A
,
4 -2
7
0
4
B 12
50
,
5
,
B
Sort
Ooe Column I MuIhpIe CoIoovts
You can son your Excel data on one column or multiple columns You can sort II'! 3SCenoXig or descending order
One Column
To sort on one colurm. execute the fot:wmg steps
A
1 Ulst Name sales
C 0
Country Quarter
E
, Brown
$1,390.00 USA
$4,865.00 USA
Qtr3
Otr4
7 Williams $12.438.00 UK Qtr 1
,
8 Johnson
Smith
$9,339.00 UK
$18,919.00 USA
Qtr2
Qtr3
10 Jones $9, 213.00 USA Otr4
11 Jones $7,433.00 UK Otr1
12 Brown $3,255.00 USA Qtr 2
13 WIlliams $14,867.00 USA Qtr 3
Williams $19,302.00 UK Otr4
"
15 Smith $9.698.00 USA Qtr 1
16
2 To sort in ascending order. on the Data tab, in the Sort 8. Finer group. click AL
!l1mJ T ""::Cleal
~~Reapp'"
Ul:;i Sort Filter
,.,. Advanced
Sort & Flttfl
Resun:
A
0 C ,
t lu st Name Sale s Country Quarter
2 Brown $4,865.00 USA Qtr4
Brown
$3, 255.00 USA Qtrl
3
Johnson $14,808.00 USA Qtr4
,5 Johnson
Jones
$9, 339.00 UK Qtrl
$1, 390.00 USA Qtr 3
7 Jones $9, 213.00 USA Qtr4
,
8 Jones
Smith
$7.433.00 UK
$16, 753.00 UK
Qtr 1
QU3
10 Smith $18,919.00 USA Qtr 3
11 Smith $9,698.00 USA Qut
12 Williams $10,644.00 UK Qtrl
,.
13 Williams
Williams
$12,438.00
$14,867.00
UK
USA
Qtr 1
Qtr 3
15 Williams $19, 302.00 UK QU'
"
Note to sort in descending order, c lick ZA
Multiple Columns
To sort on multiple columns . execute the following steps
Multiple Columns
To sort on mun,ple colullVls, execute the following steps
1 On the Data tab, III the Sort & Filter group. click Sort
T T .
So. I X
I 0' I (.nul
Sort I X
+~l !dd Lrvel X Qelete Lrvel I!Bi ~op~ Lrvel I- Qptions... (;21 My data has headers
5. Click OK.
Resutt. Records are sorted by Last Name first and Sales second
A 8 C 0 E
1 !Lnt Nilme ' Sales Country QUilrter
I $3,255.00
,
2 1srown
Brown
$4,865.00
USA
USA
Qtr2
Otr"
Johnson
5 Johnson
$9,339.00
$14,808.00
UK
USA
Otr 2
Qtr 4
6 Jones $1,390.00 USA Qtr 3
7 Jones $7,433.00 UK Qtr 1
,
8 Jones
Smith
$9,213.00
$9,698.00
USA
USA
Qtr 4
Qtr 1
10 Smith $16,753.00 UK Qtr 3
11 Smith $18,919.00 USA Otr 3
12 Will iilms $10,644.00 UK atr 2
,."Will iams
Wilililms
$12,438.00
$14,867.00
UK
USA
Qtr 1
Otr 3
15 Will iilms $19,302.00 UK Otr "
16
Sort by Color
This example teaches you how to sort data by color in Excel
A
c 0 ,
1 ltast Nam e sales Country Quarter
,
2 ISmith
Johnson
1$16,753.00 UK
514,808.00 USA
Qtrl
Q'"
5 Will
.......ms $10.644.00 UK
$1.390.00 USA
""2
Brown
7 Williams
$4,865.00 USA
512,438.00 UK
"'"
Qtr4
OUI
,
8 John....
Smith
$9,339.00 UK
$18,919.00 USA
""2
Qt"
10 Jones $9,213.00 USA Qt,.
11 Jones $7,433.00 UK Otr 1
12
"""'"
13 Williams
$3.255.00 USA
$14,867.00 USA
""2
Qt"
14 Williams $19,302.00 UK Qt,.
15 Smith ...... USA
"
1 Chck any Single cell Inside a data set
II T
.,.,
2 On the Data tab, 111 the Sort & Filter group, click Sort.
T-, Pt ~pr
l! Sort l;) Filttr
1'/Advlnc ~
Sort & f ,ltu
3 Sort by Last N;vne (or any other coUm). sort on Cel Color (you can also son on FonI Color and Cellcon), and
select the green color lor the IWsl levei.
Sort 1 X
Column So rt On Ord tr
So rt II)' l,st N.me v Ct ll Color v
1 I- 01'1 To p v
. ~D
0' C.nt tl
4 Click 'Copy Level' two trnes and select the other colors
5 Click OK
Sort 1 X
+~l Md Lnel X Qe lf tt lnof l 1!21 ~o py Ln.l I- QptIOnl ... 1;21 My data haslln dffS
Then by
list N,mt
lIsl Name
Cflt COlor
ICtll Color
- ,.
I I .. On Top
On Top
0'::J.:l:! C,nCf l
R6.-
A
1 last Name Sales
Country Quarter
C 0 E
,
2 IJOhnSOn
Brown
1514,808.00
USA Qtr4
$4,865.00 USA Otr4
, Smith
Jones
$18,919.00 USA
$9,213.00 USA
Q1<'
Qtr4
6 Williams $14,867.00 USA Qtr 1
7 WIlliams $19,302.00 UK 01<4
,
8 Sm it h
Williams
$16,753.00 UK
$12,438.00 UK
Qtr 3
Qtr 1
10 Jones $7,433.00 UK Ott 1
11
,...,"- $lO.6M.OO UK 00"2
U
13
1.5
16
--
" .......
$1....... USA
$1,",.00 UK
$3.25500 USA
00"'
00"2
00"2
1
Reverse List
This artICle teaches you how to reverse a list'" Excel For example. we want to reverse the list 111 colurm A beIoY.r
1 Enter the value 1 Into eelS1 and the value 2 Into eel 82
2 Select the range 61 82, ck:k the lower nghl comer of this range and drag ~ down to eel B8
A
C 0 E f G H
,
1 E)(cel
Word ,
1
3 Ate!!!ss 3
,
4 Outlook
PowerPoint ,
4
6 OneNole 6
7 Publisher 7
,
8 lync 8
/p,l
10
3_ Click any number in the list in colulTVl B
4 To sort in descending order, on the Data tab, in the Sort & FIRer group, click ZA
~CJeal
II Iml T ~'R9pp'"
Filter
II Sort 1/Advanced
~ Sort &; Filttr
ResuR_ Not only the list in colulTVl B, but also the list In colulTVl A has been reversed
A B C 0 E F G H
1 iLync
2 1pUbilSher
3 OneNote ,
71
4 PowerPolnt 5
,
5 Outl ook 4
Access
7 Word ,
3
,
B Excel 1
Randomize List
ThIS artICle teaches you how to randomize (shuffle) a list In Excel_ For example, we w ant to randomize the Jist In
column A below
2_Click on the lower nght comer of cell 81 and drag ~ down to cell SB
.,
A
C
'" =RANOO
D E F G H
1 Access 0. 101328
2 OneNote 0.654224
3 PowerPoint 0.460646
4 Lync 0.936226
5 Excel 0.404644
Outl ook
7 Publisher
0.146986
0.769478
,Word 0.908672+
1P,1
10
3 Chck any number In the hst In column B
4 To sort 11'1 desceodJog ordel-. on the Data tab. III the Sort 80 Filter group, click ZA
Sort Filler
' .~ ~Advanc ed
Sort &. Fillfr
B2
'" : RAN [)(j
1 Lyne
A
0.052329
C 0 E f G H
2 Word I0.935622!
3 Publisher 0.540229
,
4 OneNote 0.5n751
PowerPolnt 0.898621
6 beel 0.570332
7 Outl ook 0.950664
,Access 0.656213
NOIe random numbers change every time a cell on the sheet IS calculated If you don't want thIS_ sllqlly copy the
random nt.mbers aod paste them as values
Filter
Fitter your Excel data Jfyou only want to display records that meet certain critena_
2 On the Data tab, in the Sort & Finer group, c lick Fitter
T ""::Cleal
~~Rl':app'"
fllt~
Cl-l/ Advanced
Sort.9.: Filttl
Alfaws 10 the column headers appear
A , . c . 0;;r:j E
1 Last Nan '" Sales ' ... ' Count ... Qua~
2 Smit h $16,753.00 UK atr 3
3 IJohnson
I
$14,808.00 USA aU4
4 Williams $10,644.00 UK atr 2
5 Jones $1,390.00 USA au 3
Brown 54,865.00
7 Williams $12,438.00
USA
UK
au4
au1
,
8 Johnson
Smith
$9,339.00
$18,919.00
UK
USA
atr 2
atr 3
10 Jone s $9,213.00 USA aU4
11 Jones $7,43].00 UK atr 1
12 Brown $3,255.00 USA atr 2
13 Williams $14,867.00 USA atr]
14 Williams $19,]02.00 UK atr 4
15 Smith $9,698.00 USA atr 1
16
4 Click on Select AI to clear all the check boxes. and click the check box re~1 to USA
t! 20ft A to Z
U ~otZloA
Sotl by Coiol
... f,ltt'l'
Tmf!lten
,--ISel/ch
--
P
~ (Select A.lq
.Q UK
!fJZl
01( Canc t l
5 ClICk OK
A 8 ~ . 0 E
1 LastN an l 5.Jles ' .. (ount _T Qua rl:j
1 IJOhnSOn 1514,808 .00 USA Qtr 4
5 Jones 51, 390.00 USA Qtr 3
I. Smith
Jones
12 Brown
518,919.00 USA
59,213.00
53,255.00
USA
USA
Qtr 3
Qtr4
Qtr 2
13 Williams 514,867.00 USA Qtr 3
15 5mlth $9,698.00 USA Qtr 1
16
7 Click on Select An to clear an the check bo~es, and click the check bo~ next to air 4
II 2<lrt A to Z
l! 52rtltoA
Sort by Colo.
.., luilrtft
Textfllt=
I~arch p
~ (Stlecll\lq
-.[J Qtr 1
0 0lr2
-O Otr 3
B Click OK.
1
A
last Nan<;] Sales
E
9 To remove the fiRer, on the Data tab, in the Sort 8. FiRer group, click Clear To remove the Mer and the arrows,
click Finer
9. To remove the fiRer, on the Data tab, In the Sort /l, Fi~er group, click Clear To remove the fiRer and the arrows ,
click FiRer
This example teaches you how to apply a number fiRer and a text fiRer to only display records that meet certain
crrtena
2 On the Data tab, in the Sort & FiRer group, click FiRer
'T TClear
_ l{. Reapply
filter
~1} Advan(<<I
Sort &; Filter
ArrfloNS In the column headers appear
B
A
C 0 ,
1 j u s t Nan~ Sales .. Count ""
2 5mith $16.]53.00 UK Qtr3
3 IJOhnson I
$14,808.00 USA
$10,644.00
Qtr4
4 WIlHams UK Qtr2
5 Jones $l.39O.oo USA Qtr 3
Brown
7 Williams
$4,865.00 USA
512,438.00 UK
Qtr4
Qtr1
,
8 Johnson
Smith
59, 339.00 UK
518,919.00 USA
Qtr2
Qtt 3
10 Jones $9, 213.00 USA Qtr4
11 Jones 57,433.00 UK Qtr 1
12 Brown 53,255.00 USA QU2
13 Williams 514,867.00 USA Qt< 1
14 Williams $19, 302.00 UK Qtr4
15 Smith 59,698.00 USA Qtr 1
"
Number Filter
To apply a number finer. execute the following steps
4 Clic k Number Fitters (this option is availa ble beca use the Sa les column contains numeric data) and se lect Greater
Than from the list
Than from the list
Custom AutoFiItt"r ? x
Show rows wht.t:
Sattl
,II lI.nter thi n
@!nd 0 2r
A
C 0 ,
1 last Nan-.. I sales
2 Smith $16,753.00 UK
.
.T lcounl:;jQua~
.
Qtr 3
,
3 Johnson $14,808.00 USA
Williams $10,644.00 UK
Qtr 4
Qtr2
,
7 Williams
Smith
$12,438.00 UK
$18,919.00 USA
Qtr 1
Qtr 3
13 Williams $14,867.00 USA Qtr 3
l' Williams $19, 302.00 UK Qtr 4
16
Note you can also display records equal to a value, less than a value, between two values , the top x records ,
records that are above average, etc. The sky IS the limn!
Text Filter
To apply a text fitter, execute the following steps
4 Click Text Fillers (ttvs option IS available because the Last Name column coolaln5 text data) and select Equals
!l SortAtoZ
U ~rtZtoA
Soft by Color
'!;. .' tiFtOn Ix"
.~ .... '"
Teet Eill:M qu.Is. ..
c~lI(h p Does ~ot EquaL.
~
[5 flfct Alq Begins Wjth .
e1 Brown
Ends With ...
~ J ohnson
-el Jonfl Contllns ...
It! Smith
~W1!11 lms
Qoes Not (onilln ...
at: Cancf l
5 Enter ?mOand click OK
Cu~om AutoFitter ? x
Show rows where:
last Name
Fl
Note A question rrnrk (7) fllilIches exactly one character An asterisk (0) fllilIches a seres of zero or more
characters
Resutt. Excel only displays the records where the second character of Last Name equals rn
A 8 C 0 E
1 ILast Na~ ~T!Sares t:1'count::1 Quartt::]
2 Smith $16,7S3.00 UK Qtr 3
9 Smith $18,919.00 USA Qtr 3
15 Smith $9,698.00 USA Qtr 1
16
Note you can <liso display records that begin wJth a specific character. end wJth a specific character, contain or do
not contain a specific character, etc. The sky IS the limrtl
Date Filters
This example teaches you how to apply a date finer to only display records that meet certain criteria
'r. RHPply
Filter
~:l/ Advanced
Sort lit F,lttf
AIrfloNS In the column headers appear
A B C 0 E
1 Last Nan~ Sates
, Smith $16, 753.00 UK 4/25/20B
3 IJohnson I
$14,808.00 USA 1/S/2016
Williams $10,644.00
5 Jones $1,390.00
UK
USA
4/B/2015
9/5/2016
6 Brown $4,865.00 USA 1/21/20B
7 Williams $12,43S.00 UK 4/6/20B
,
8 Johnson
Smith
$9,339.00
$18,919.00
UK
USA
11/14/2016
7/ 16/2014
10 lanes $9,2B.00 USA 1/26/2015
11 Jones $7,433.00 UK 11/1/2013
12 Brown $3,255.00 USA 5/1S/2015
13 Williams $14,867.00 USA 1/5/2015
Williams $19, 302.00 UK S/23/2016
"
15 Smith $9,69S.00 USA 1/17/2016
16
4 Click on Select All to clear all the check boxes , click the + sign next to 2015, and click the check box next to
January
Date filters
r - --
!Search (All)
"'.3
..
5. Click OK.
A 8 C D E
1 LlstNiln~Siires Gjcount.,, ] oilte .Tl
10 Jones $9,213.00 USA 1/ 26/ 2015
13 WillJilms $14,867.00 USA 1/5/2015
16
8 Click Date FIRers (thiS optton IS available because the Date column Contall1S dates) and select Last Month from
,
8. Chck Date FiHers (thiS option IS available because the Date column contains dates) and select Last Month from
the list
YHT."'fgay
Next Week
ThlsW",elc
.Last Week
OK ( anct l
Next Month
.:J
Thlj; Month
tastMonth
Next Quarter
This Quarter
last Quarter
N~Yur
Th!~ Ytat
lastYUt
Yurto Olle
Nqt Vur
Thl~ Vur
List Y~lr
Vurto D11~
All Diles In Ih~ eenod
C ~tom E"ter.
A B C ~~D"-~__~
E___
l j t.ast Nan " . ~'es ... . Count ... Icate .T!
8 ~ JOhnSOn $9,339.00 UK 11/ 14/2016
"
Note ttvs date Mer and many othef date fitters depend on todays date
Advanced Filter
And Crrtena I Or Crrtena I Formula as Crrtena
This example teaches you how to apply an advanced fitter In Excel to only display records that meet complex
crrteria_
When you use the Advanced FiRer, you need to enter the c rrtena on the worksheet Create iI CnterJa range (blue
border below for illustratton only ) above your data set Use the same column headers Be sure there's at least ore
blank [fNI between your Crrtena range and data set
And Criteria
To display the sales in the USA and In aIr 4, execute the followll"og steps
A
C 0 ,
1 Lnt Name sales Country Quarter
,
2 USA Qtr4
,
5 Last Name sales
Smith $16,753.00
Country Quarter
UK Qtr 3
7 IJOhnSOn 1514,808.00 USA Qtr4
$10,644.00
,Williams
Jones 51,390.00
UK
USA
Qtr2
Qtr 3
10 Brown $4,865.00 USA Qtr4
11 Williams 512,438.00 UK Qtr 1
12 Johnson $9,339.00 UK Qtr2
13 Smith $18,919.00 USA Qtr3
14 Jones $9,213.00 USA Qtr 4
15 Jones $7.433.00 UK QU 1
16 Brown $3, 255.00 USA Qtr2
17 Williams $14,867.00 USA Qtr 3
18 Williams $19, 302.00 UK Qt<4
Smith Qtr 1
"
20
$9,698.00 USA
2_ Click any Single cell inside the data set
3 On the Data tab, in the Sort 8. Fitter group, click Adv anced
Sort
~Adv1S.Ced
Sort &; Filttr
4 Click in the Crrterra range box and select the range Al:D2 (blue)
5 Click OK_
Actvanad Filtt r I x
Action
@filterthtlist, In-platt
o C2P)' to another loutlon
l ist range:
.criteria range:
(OpyIO:
NotICe the opIIons to copy your fiRered data set to another location and display unique records only (ifyoor data set
contains duplicates)_
ResuH_
A
1 last Name Sales
c
Country Quarter
0 E
2 USA Qtr 4
3
S La st Name Sa les Country Quarter
7 Johnson $14,808.00 USA Qtr4
Brow n $4,865.00 USA Otr4
" Jones
"
20
$9,213.00 USA Qtr4
No rocket sCllffiCe so far We can achieve the same result with the normal N1er We need the Advanced Filter lor Or
'"~
Or Criteria
To display the sales 111 the USA 11 air 4.or: in the UK 1'1 Otr 1 exec~e the f~ steps
7 On the Data tab, 11 the SorI & Filler group. tick Advanced, and ad/USt the CrJlena range to range Al OJ (blue)
8 Cltck OK
Advanad Filtf.r 1 x
Action
filler tile list, Inpl!(e
o C.Qpy t o anothe.lo(,tlon
list range:
(opyto:
Resutt.
A B c o E
1 Ln t Name Sates Co untry Quarter
2 USA Qtr4
3:~____________~U~K__-,Q~"~'~
5 Last Name Sales Co untry Q uarter
1 Johnson J $14,808.00 USA Qtr 4
10 Brow n $4,865.00 USA Qtr 4
11 Williams $12,438.00 UK Otr!
Jones
15 lanes
$9, 213.00 USA
$7,433.00 UK
Qtr4
Qtr 1
20
Formula as Criteria
To display the s ales in the USA in Qtr 4 greater than $10000 Q[ in the UK in Qtr " execute the following steps
10 On the Data tab, In the Sort /l, FiRer group, click Advanced, and adjust the Cnteria range to range A1 E3 (blue)
11 Click OK.
Adv,nctd Filttr 1 x
Action
@flltertheli!1, In_plau
o C~ to .nolhrrloution
SASS:SD S 19--~"'
!!ij
"'-
"rih rl' lange: Shnl1!SAS1 :SES3I ~I
Copylo' ' ~
o Unique rt cord! only
E2 f. =86>10000
A
C 0 , ,
1 Last Name Sales Country Quarter
,
2 USA
UK
Otr4
Otr 1
I TRUE
4
5 Last Name Sales Country Quarter
7 Johnson $14,808.00 USA Otr4
11 Williams $12,438.00 UK Otr 1
15 Jones $7,433.00 UK Otr 1
20
NOIe always place Oil forrrula In Oil new eolulTn Do not use Oil eolurm Label or use Oil eolum label that IS not In yOIJ
data set Create Oil relatrve reference to the first eel In the eolurm (88) The forll'lUliJ must evaluate to TRUE or
FAlSE
Data Form
The data form in Excel allows you to add, ed~ and delete records (rows ) and display ooly those records that meet
certain crderia_ Especially when you have wide rows arod you w ant to avOId repeated scrolling to the right and left,
the data form can be useful
A B C 0
1 ILast Name Sales Product Type Com pany Contact I
,
2 Smith
Johnson
. $1,675.00
$1,480.00
EEE-312
OC-1
Wok N Ro ll
Wok N Ro ll
Adams
Rogers
4 Williams $1,064.00 EE-2 PeacE.' A Pizza Evans
5 Jones $1,390.00 OF) Kung Food Wl'bb
6 Brown $4,865.00 EEE-45 Peace A Pizza Fields
7 Williams $1, 243.00 FO-2 Kung Food Mccoy
,
8 Johnson
Smith
$9,339.00
$1,891.00
OC-1
EEE-312
Kung Food
Wok N Ro ll
Hansen
Ham iltol
10 Jones $9,213.00 FG-5 Wok N Roll Wood,
11 Jones $7,433.00 OF7 Kung Food Cunning
12 Brown $3,255.00 FO-2 Pancakes on the Rocks Myers
A~34
" Williams
14 Williams
$1,486.00
$1,930.00 A~34
Wok N Roll
Pancakes on the Rocks
Ford
Edwards
15 Smith $9,698.00 F-3334 Peace A Pizza Murphy
16
4 Use the Find PreY and Find Next buttons to easily swdch from one record (row) to another
S.I~ ? X
list Namf: [JOtiillO n 20114
Discount ,
guartfr. ,'" ,
Month: October
5t~tus: Production
Note. use the New or Delete button to add or delete records Once you start edillng a record, you can use the
Restore button to undo any changes you make
5. To display only those records that meet certain crrtena, click the Cntena button
Pr~duct Typr.
, ~Ifli
COmPany.
,
Bellol!
( onlad Pelion:
-
,
Pflont:
, Flndfrn
Find Held
Coyntry. Unit~d Kingdom
,
City.
fOllll
[;l
Discount: 1 (JOIr
!),IlIrter:
1
Month:
1,
StatuI:
7 Now when you use the Find Prev and Find Ned buttons , you Will only see those records that meet these crrtena
In our e~ample. only record 13
"'6 ? X
MontI\: Ouember
Stalul: Transport
Note to ed~ the crneraa, chc k the Crnenil button again. To close the data form, chck the Close button
Remove Duplicates
This example teaches you how to remove duplicates in Excel. Go here to only find duplicates
L On the Data tab, In the Data Tools group. click Remove Duplicates
Text toHuh
F- 8
R~e~
~
Dillil
Wo C1ii II
Consolidate Re!Jibonsh'fH Manage
Columns Fill OUIl:~"'leJ Validation Data Model
Data Tools
Columnl
[;21 lilt N.mt
[;21 S.ltl
[;21 (ountlY
[;21 Quarttl
OKy j (.nttt
Result. ElIce! removes an identical rows (blue) except ror the first ldenbcal rrm found (yellow)
A B C 0 A B C 0
1 Last Name Sales Country Quarte r 1 Last Name Sales Country Quarter
2 Smith $16,753.00 UK atr3 2 Smith $16,753.00 UK Qtr3
3 Johnson $14,808.00 USA atr4 3 Joh nson $14,808.00 U5A Qtr4
, WIlliams $10,644.00
Jones $l,3'Kl.00
UK
USA
atr2
atr 3
, Wil liams $10,644.00
Jones $I, 3'Kl.00
UK
USA
Qtr 2
Qtr 3
6 Brown $4,865.00 USA atr4 6 Brown $4,865.00 USA Qtr4
7 Smith $16,753.00 UK atr 3 I 7 Williams $12,438.00 UK atr 1
,. Johnso n
Smrt h
$9,339.00
$18,919.00
UK
USA
Ott 2
a tr 3 ,. Smit h
Jon es
$18,919.00
$9,213.00
USA
USA
atr 3
a tr4
11 Jon es $9,213.00 USA Qtr4 11 Jon es $7,433.00 UK Ott 1
12 Jones $7,433.00 UK Otr 1 12 Brown $3,255.00 USA atr2
,.
U Smith
Brown
$16,753.00
$3,255.00
UK
USA
Otr 3
Otr 2 ,.
U williams $14,867.00
Williams $19,302.00
USA
UK
Otr 3
Otr4
15 Williams $14,867.00 USA Otr3 15 Smith $9,698.00 USA QU'
16 Williams $19,302.00 UK QU' 16
17 Smith $9,698.00 USA Otr 1
..
17
To remove rows with the same values in certain columns, execute the followlrog steps
4 For example, remove rows with the s ame Last Name and Country
Co lumns
E2I tast Name
o Sal ~s
E2I Count/)'
O. CII'I(,I
Resutt. Excel removes all rows with the s ame last Name and Country (blue) except for the first Instances found
(yellow)
A B C 0 A B C 0
1 Lls t Name Sales Co untry Quarter 1 Lls t Name Sales Co untry Quarter
2 Smith $16,753.00 UK Otr 3 2 Smith $16,753.00 UK Otr3
3 Johnson $14,808.00 USA Qtr4 3 Johnson $14,808.00 USA Qtr4
4 Williams $10,644.00 UK Otr2 4 Williams $10,644.00 UK Otr2
,
5 Jones
Brown
$1,390.00 USA
$4,865.00 USA
Otr 3
Otr4 ,
5 Jones
Brown
$1,390.00 USA
$4,865.00 USA
Otr 3
01r4
7 WIlliams $12,438.00 UK Otr 1 7 Johnson $9, 339.00 UK Otr2
,
8 Johnson
Smit h
$9,339.00 UK
$18,919.00 USA
Otr 2
Otr 3 ,
8 Smith
Jones
$18,919.00 USA
$7,433.00 UK
Otr 3
Otr 1
10 Jones $9,213.00 USA Otr4 10 Will iams $14,867.00 USA Otr 3
11 Jones $7,433.00 UK Otrl 11
12 Brown $3,255.00 USA Otr2 12
7.
Outlining Data
OuUinlllg data makes your data easier to view In thas example we will total rows of related data arod collapse a group
of columns
A B C 0 E
I ILast Name Sa te s Product Type Coml!an:i
2 Jones $1,390.00 OF-3 IKung Food I
l Williams $1,243.00 FO-2 Kung Food
4 Johnson $9,B9.00 DC-1 Kung Food
5 Jones $7,433.00 Of-7 Kung Food
6 Brown $3,255.00 fO2 Pancakes on the Rocks
7 Williams $1,930.00 A-34 Pancakes on the Rocks
,
B Williams
Brown
$1,064.00
$4,865.00
EE-2
EEE-45
Peace A Pi zza
Peace A Pi zza
10 Smit h $9,698.00 F3B1 Peace A Pizza
11 Smit h $1,675.00 EEE 312 Wok N Ro ll
12 Johnson $1,480.00 DC-1 Wok N Ro ll
13 Smit h $1,891.00 EEE 312 Wok N Ro ll
14 Jones $9,213.00 FG-5 Wok N Ro ll
15 Williams $1,486.00 A-34 Wok N Ro ll
16
2_On the Data tab, In the OuUine group, click Subtotal.
Shoo.,OI!'lIlI
H~Orllii
Group Ungroup Subtotal
Outline ~
3 Select the Company column, the column we use to ouUine our worksheet
6 Click OK.
Subtota l ? x
!t nch chano~ in:
U.se function:
nt El
Alld lubtota l to:
tast Name
Salt!
Product Type
Company
ResuK_
Resu~
I ' IzI , I 0
C 0
,
1 last Name
Jones
Sales
$1,390.00
Product Type
OF3
Company
Kung Food
3 WillIams $1,243.00 F(}" Kung Food
,
4 'Johnson
'Jones
$9,339.00
$7,433.00
0(1
OF 7
Kung Food
Kung Food
b
7 Brown $3,255.00 F(}" Pancakes on the Rocks
8 Wmlam s $1,930.00 034
Pancakes on the Rocks Count
Pancakes o n the Rocks
,
~
10 WillIams $1,064.00 EE2 Peace A PIzza
11 Brown $4,865.00 EEE-45 Peace A Pizza
12 5mith $9,698.00 F3334 Peace A PIzza
13 Peace A Pina Count 3
14 Smith $1,675.00 EEE312 Wok N Roll
15 Jo hnson $1,480.00 0( 1 Wok N Roll
Smith $1,891.00 EEE312 WokN Roll
"
17 Jones $9,213.00 FG5 Wok N Roll
18 willIams
19
$1,486.00 0 34
Wok N Ro ll Count
Wok N Roll
,
2() Grand Count 14
2l
7 To colapse a group of cells, click a minus sign You c an use the numbers to (elapse Of elIpand groups by level
For eJCample, click the 2 to only show the subtotals
+
+
Kung Food ( a unt
Pancakes on the Rocks ( ount ,
4
"
+
,.
19 Wok N Roll (ount
Grand Count 14
2l
tI t-Of t!X ample, se;.,cl COlumn Po. ana tI
1~ "~
Group Ungroup Subtotal
Outline
10. Click the minus sign above column C (~win change to a plus slgn)_
ResuH_
G
ffi
1' 121,I c 0 E F
,
1 Product Type
OF-3
Company
Kung Food
3 FO-2 Kung Food
DC-1
5 OF-7
Kung Food
Kung Food
6 Kung Food Count
b ,.
7 FO-2 Pancakes on the Rocks
,8 4-34
Pancakes o n the Rocks (aunt
Pancakes on the Rocks
,
EE-2 Peace A Pizza
L,. 11 EEE-4S
12 F-3334
13 Peace A Pizza (ount
EEE-312
15 DC-1
Peace A Pizza
Peace A Pizza
Wok N Roll
Wok N Roll
3
Subtotal 1 X
.at n<ll ( hano~ II\;
Company r--J
llst fund ion:
~t FI
subtotal to:
,
0< Canul
Conditional Formatting
Highlght Cells Rules I Clear Rules I Top/Bottom Rules
CooditJooal formatting In Excel enables you to hghlight cells with <.I certain color, depending on the celrs value
1
A
,. B
2
3
"
43
5 2
"5
.
7
,B 11
10 57
11 1
2 On the Home tab, In the Styles group, clic k CooditlOl'lal Formatting
--=-....... 1
~format
~ Normal "d Good Neutral
Condllional
formlnmg - Table-
as ExpJonotory .. ~1~"~P~"~t:::::::J .
51y1u
to
l op/Bottom Ruin
[iJJ .,. ......
r=J CoIor ~ 1m .E.q~lTo...
rnIJ icon Seb ~ !ext tlYt ConWns...
Grutrr Than 7 x
liSl WIth light Rfd Fill with Dalk Rtd Tut ...,
- --=
OK (Inul
5_ Click OK
A B
1 14
,
2 6
"
4
5 " 2
6
"5
,~ l 11
86
57
lOr
11
A B
1 I " I
~1
6
"
" 2
6
"5
~r 11
86
:1
11
57
Note you can also hghlight cells that are less than a value, between a low and high value, etc
Clear Rules
To clear a condttlOllal formamng rule. execute the following steps
A
,1 81
4
3
.,
39
,
5
7 5
,8 11
"
10
11
2 OJ) the Home tab, 11 the Styles group click CoodiIJooal FomJatbng
.. lop/Bottom Ru6es
3 crICk Clear Rules, Clear R-wles fiom-$eiec----reoc'."",.---
l op/Bottom Rules ,
O':......
1':;-';';'.... :'7-;::----"__:c'....
;;;;.;;RuIes from Selected Cells
rn Manage Bults... Clea, Rules ',om Enllfe Sheet
Ie I R
Top/Bottom Rules
To hlghhght cells that are above the average of the cells, execute the follow"IflQ steps
1
A
81
2
3
5 .,"
, 2
"5
.
7
,
8 11
10 57
11 1
2 Oil the Home tab, ill the Styles g roup, click Conditional Formatting
lop 10 Items-
~ IeOllSets q Bgttoml0 L
MOff Ruin ..
Abovf Aver.gf ? x
...
fOtm.ll: celli tMlMf ABOVE AVERAGE:
01: ( Incfl
5 Click OK.
ResuH. Excel calculates the average (42.5) and formats the cells that are above thIS average
A B
1 81
2 6
3
4 "
43
5 2
6
7
"5
,
B 11
86
10 57
11 1
Note you can also highlight the top 10 rtems , the top 10 %, etc. The sky IS the limrt!
Manage Rules
To VJeoN all cood~1OIla1 formatbrog rules In a workbook , use the ConditIOnal Formatting Rules Manager You can also
use this screen to create, ed~ and delete rules
1. Select cell AI
A B
1 81 1
,
2 6
4 "
43
5 2
6
7
"5
,
B 11
B6
10 57
11
2 On the Home tab. In the Styles group. click Cooditional Formatting
~
ConditIOnal Format as
, Normal
Icalwlauon
Bod Good
Explanatory ..
Neutral
Formilttll!g TlIble~
Styles
D QlIta Bars
a Color ~ale5
D leon Sets
o t:!ew Rule...
r:; '-lea r Rules
[J Manage Bules. ~
......
~ ~ fdft Rule ... ~ ,. X
- "
l2eltte RUle ]
~ :.!:
1 X
[ O. [ ClOSt
Note: beca use we selected cell AI . Ex cel shows the rule applied to the range Al.Al0
4 From the drop-down list, change Current Selection to ThIS Works heet. to Vtf.'!oN all coodruonal formatllng rules 10
thIS worksheet.
[ O. [ CIOlt
OK (Iolt
Note click New Rule, Edrt Rule and OeIeIe Rule to create, edit and delete nJes
Manage Rules
To VJeoN 311 conditional formathrog rules in a workbook , use the Conditional FormattJrog Rules Manager You can also
Select cell A I.
A B
1 81 1
2 6
3
4 "
43
5 2
6
7
"5
,
B 11
86
10 57
11
2 On the Home tab, In the Styles group. clic k Coodihooal Formatting t- OIiOW I
Stylu
~ Highlight ( dI;!W1et;
. lop/BoHam Ru6n
[i] "' ......
r:J CoIor uIe
~ l<:on Sets
0 t:lew Rule...
1
0 ~Ielf RulH
.... ntgeBulft, ..
f:)
The CoocII\x:IoaI Foonatlrg Rules Mar\agef appears
Condition,1 Form.tting RulH Manager I X
1howformattin!! rolellor. ~ v
, ,
o tiew Rule. E) Edrt Rule ... X .l2.eltle Rule
Rule (applied In order shown] Format .... pp liuto Stop II True
eo 0
""
Cell V.lue AaBbCcYyZz _SAS1 :SAS1 0
I 0' I Close ~.
NOIe because we selected cell AI . Excel shows the rule applied to the rarge AlA 10
4 From the drop.down list. change Current Selection to thIS Woosheet. 10 v_ aU condruonal formaltJng rules in
thIS worksheet_
I x
1how lormattln!! rolel for.
Close
Data Bars
Data bar'S III EKCel make it VeJY easy 10 vISualize v~ III a range 01 eels A IongeJ bar rep-ese0t5 a h9Jer value
1 Select a range
2 On the Home tab. III the Styles group click ConditJ:lnal FormattrIg
tl
CondJtJonaf Fonnat as
~ ,N:;;O~'
~ ;Ic===i]: Bad
,I ulculation I
Good
ExplonotOfy .
Neutral
Formattl"'ll Table:
3_ Click Data Bars arod click a subtype
WJ Highlight (~Ruln
!Ita lop/Bottom Ruin
a
-- (oIor~.. Ie5
Grildient Fill
IB~
IB lt lt
OJ leon Sets Sofid flO
ResuH:
A B
1
I
jl ,.
2 JI 6
"
' 3
2
951
5
Explanation by defauH. the cell that holds the minimum ~alue (0 if there are no negative values) has no data bar arod
the cell that holds the mivamum value (95) has a data bar that fills the entire cell All other cells are filled
4 Change the values
Resull Excel updates the data bars automatically Read on 10 further CUSIOllllZe these data bars
A,
1
2
3
,,
4
,
8
I.
111
5 SelecllherangeAl .Al0
6 On the Home tab, In the Styles group. click Condillonal Formatllng Manage Rutes
Note 10 drectIy lamch this dialog box for new nJes, at step 3, click More Ru6es
B Selecl NlMTtler from the Mnnun drtJp-da.n list and enter the ",ak,oe 100 Select NlMTtler from the Maxnun drop-
down IIsI and enter the vakJe 150
9 Click OK tw.::e
Edit Form~tting Rule ? X
""
-o
forlNOl II cells bHed on their ....Iues:
F.strm.1 Sl)'It: D.t. B.r Show I" Only
-
Minimum M.ximum
Jypr: Numbtr Numb,r
:ialut: '00 ll!il ,S<j ~
hi' Appe~"fKt:
- 1-
,,"010'
Gr.dlrnt Fill
:-1 Solid Bordtr 1-", I G
Utll.lA'r V.lut lind Allis ... ] B., Qllt(\lon: (onlrxt .Iv..
".-~
I Ol---.f\J (ancrl
Resu~
A ,
d, 101
,2
4
5
6
7
,,.
8
111
EwplanatJOn the eel that holds the value 100 (If any ) has no data bar and the eellhat holds the value 150 (If any )
has a data barthat tills the enbre eel AI other cells are IiIIed proportlOOally
Ramco Global
Payroll S/W
Covering all of Asia, Middle
East,Australia & New Zealand
On One Unified Platform
Ramco Systems
Color Scales
Color Scales In Excel make rt very easy to vISualize values In a range of cells_ The shade of the color represents the
1. Select a range
Indiabulls
HOME LOANS
RUt . . """;o;"'T..-
' i"r
HOME UIAJIS It 1.5G% P
3 Clic k Color Scales arod click a subty pe
..
,..., lop/Bottom Rulrs
M
lj lc:on Seb
[:J New Rule .
r, ,Clur Rules
rn M~n~ge Buies...
MOle Rules ...
ResuR_
'L....::A
'--o '
1
7 ,.
.J
ExplanatIOn by default. for 3--Color sc ales. Excel c alculates the 50th percentile (also known as median, middle v alue
or midpoint). The cell that holds the minimum value (9) is colored red_ The cell that holds the median (36) IS colored
yellow, arod the cell thaI holds the max imum value (80) IS colored green All other cells are colored proportionally.
5. On the Home tab, in the Styles group, click Coodruooal Formatllng, Manage Rules
Indiabulls
HOME LOANS
'.., . . T. . . . . . .,..
oi.-iP.A.
HOME UlAJlS O 8.50% ...
Nih'
Excellaurx:hes the Ed~ Formatllng Rule dialog box Here you can further customize your color scale (Format Style,
Minimum, Midpoint and Maximum, Color, etc).
Edit Form~tting Rult 1 x
.s:~lect' Rule l)'1)e:
.. FOIIII&I.1i ttlll billtd on Ih~1f w~lu~
.. Form't only Ctlll th.1 (ont.in
.. Formilt only top 01 bottom ranl:td walut5
.. Form't onlyw,luts th.t 1ft ilboWf 01 btlow ntlilge
.. Formlt only unique 01 dupli{Mt walun
.. Un 'formul, to delermiM which ulillo fOlmll
Note to dlle<:tIy launch thIS dialog box for /leW IUIes, at step 3, chc k More Rules
7 Select 2-Color Scale from the Format Style drop.down list and select wMe and blue
8 Click OK twICe
Edit Fo.m~tt;ng Rule 1 x
a Rule
.. FOlmlt III tetts based on thelrVillufS
.. Formlt only (tiIS th" (ont,;n
.. FOlmat only top or bottom .ani:td value!
.. Formlt onlynluu thlt 'ft aboWl 0' btlow IYflagf
.. FOlmat only unlquf 01 dupli{llt nlues
... Use fonnul. to dete.mint whl(h (tlls 10 fOlmat
Minimum M'lCimu,",
bPt: town! Value v Highut V.IUf
!i.lut, (lowest lue)
-~=~
'blJi.
;'-I (Hightst .,Iut)
~otor. :v I
(,nttl
Resu~
1
A
2 "
3
4
S
6 "
IS
7 SO
Icon Sets
Icon Sets in Excel make rt ~ery easy to visualize values in a range of cells Each icon represents a range ofvalues
Select a range
Styles
3_ Clic k Icon Sets and clic k a subty pe
IopIBottom RutH
"
D Q.- IaBan
II Color Scales
1
Directional
...
o ! :rt ... ~
.. ...
..... .... .....
!::!ewRule
... ~
~ ~Iear Rules ~ ... ~~ ...
G Manage Butes".
~~ ...
'......
. 0
Indicaton;
~OO " IX
I~ II> I~
Ratin!Js
.1. A
.4
B
!~
6
"
43
5 . 2
6 . 95
7
5
,
B
10
11
. 11
86
57
Explanation by defautt, for 3 icons , Excel calculates the 67th percent and 33th percent 67th percent = min + 067'
(max -min) = 2 + 067 (95--2) = 64 31 33th percent = min + 0.33 (max -min) = 2 + 0.33 (95--2) = 3269 A green
arrow will show for values equal to or gre<ller than 64_31. A yellow arrow will show for values less than 64 31 and
equal to or greater than 32_69 A red arrow will show for values less than 32.69
Indiabulls
HOME LOANS
Resu~ E~cel updates the ICon set automatically. Read on to further custOlTllZe thiS ICon set
1
2
r. A
2.5
50
3
4 75
0
5 75
7 100
0
,
8 50
10
11
75
100
6 00 the Home tab, III the Styles group, click CoodilJonal FormattJOg, Maoage Rules
E~cel laullChes the Ed~ Forrnatbng Rule dialog bo~ Here you cao further custorruze your ICon set (Icon Style,
Reverse Icon Order, Show Icon Ooly, Icoo, Value, Type, etc)
Edit Formatting Rule I x
lelect a Rule Type:
.. Fo'm~t all telll baled on then ~tue
.. Fo rmat only cellI that (onta in
.. format only top or bottom ranked aluel
.. Format only aluel that I re above or below anrage
.. format only unique or dupli(ate n lun
.. Ule a formula 10 determine wh ich ull! 10 formal
"..
OilpllYn(h iton aord ing 10 thele ruin:
koo
[
~
.;
wilen value il
Pu(enl
[v
[v
L 1wilen < 33
OK
Note to directly launch this dialog box for new rules , at step 3, click More Rules
8. Select 3 symbols (Uncrrcled) from the Icon Sty le drop-down list Select No Cell Icon from the second Icon drop-
down list Change the Types to Number and change the Values to 100 and 0 Select the greater than symbol ( next
to the value 0
9. Click OK twice
Edit Form.tting Rule 1 X
-
No Ctlll(on wnen < 100 .nd v 0
~ Number v
X - whtn<~O
I O.
~ C.nul
ResuR_
A B
1 '-'
2 50
3 75
4 X 0
5 75
"
6 100
7 X 0
,
8 50
75
1O j"
11
100
Indiabulls
HOME LOANS
_ . . T.. . . . . .
1HOME UWlS O I.5O% P.A.
-;g.'.
New Rule
If the Highlight Cells Rules , TopIBottom Rules, Data Bars , Color Scales and Icon Sets are not SuffICient, you can
create a new rule For example. highlight the codes below that occur more than once In the range A2.Al0 iIDd have a
score greater than 100
A , C
1 !code Score
2
3 ,
A 4
14
4 C 31
5 A ISO
6 0 6
,
7 0 SO
, 0 42
10 ,
E
120
22
nl
2 On the Home tab, in the Styles group, click Conditional Formatting
I;l lti'
ConditIOnal Format IS
Norm al
II Ca lculation
B.d
Check Cell _
Good
Explanatory .. ,
Neutral
~ lop/Bottom RulH
"" D:"t"
D 80IIrs
III Coiof5.C....H
D IconS~u
0 Hew RuIe. ..
r;; ~
.cleu Rules
G Mllllge Buln ...
Note Highlight Cells Rules , TopIBottom Rules, Data Bars, Color Scales and Icon Sets are shortcuts. They can also
be found under New Rule
N_ Formatting Rule ? X
Pr~
[ AaBbCcYyZz
[ I , orma!... I
OK r-.... I Cancel
Result Excel formats cell A5 bec ause code A occurs more than once in the range A2.A I O arod the value 150 in cell
85 IS greater than 100
A B C
1 Code Score
,
2 A
B
4
14
4 C
5 A "
150
6 0 6
7 0 50
,
B 0
E
42
120
10 B 22
11
Explanation COUNTIF($A$2$A$10,A2) counts the number of codes in the range A2.Al0 that are equal to the code
In cell A2. If COUNTIF($A$2 $A$10,A2) > 1 and B2 > 100, Excel formats cell A2 Because we selected the range
AlAl0 before we clicked on CondrtlOflal Formatting, Excel automatically copies the formula to the other cells. Thus ,
cell A3 formula =AND(COUNTIF($A$2$A$10,A3 1,B3> 100), cell A4
=ANO(COUNTIF($A$2:$A$10,A41 ,B4>100), etc Notice how we created an absolute reference ($A$2.$A$10) to
fIX this reference
~ EP.efi
---
See how EPPS ERP can help you
manage material req uirements and
more.
REQUEST DEMO
A B C 0
,
1 Sierra Tango Charlie
, Kilo
Golf
Bravo
Mike
Yankee
Delta
4 Juliet Alpha Foxtrot
, Papa
5
Zulu
X-ray
5iemil
Nov@mber
Whiskey
7 Romeo 'roo Quebec
, Sierra
8 India O~,
Urna
Delta
Uniform
10 Hotel Juliet Victor
11
2 On the Home tab, in the Styles group, click Conditional FormatIlng
r.:1
1",,:::;--'
Exp /0 notary .. , ... ' ,,"::t===:-,1_0 '
--.........
~ 6 D.-te Oc:<:uning...
I~ tlurRuln
rn Manage Ruin ...
More Rules. ..
~
7 x
PupIgtt I v 'IIlufs with Ught Rfd Fill wrth Oark Rfd Tut v
1 Sierra
A
Tango
C
Charlie
0
2 Ki lo Bravo Yankee
l Golf Mike Delta
4 Juliet A l pha Foxtrot
,5 Papa
Zu l u
X-ray
Si e r ra
November
Wh iskey
7 Romeo Echo Quebec
8 India Oscar Delta
9 Sierra Um. Uniform
10 ~ Hotel Juliet Victor
11
Note select Unique from the first drop-down list to highlight the unique names
As you c an see, Excel highlights duplic ates (Juliet, Detta), triplic ates (S ierra), quadruplicates (if we have any), etc
Execute the following steps to highlight triplicates only
Indiabulls
HOME LOANS
_ ... THSNNtAlu
] HOME UlAJlS Q 1.50%' P.A. (
-hUM
I
i;) ~ N o rm al Bad
rrl"(~.IC,~u~,.~uCo="==I C.heck Cell _,
Good Neutral
Conditiontl Form.., '$
Explanatory... [, IC""'OU'",==,-J
FOI'fI"d'ng Table
lop/Bottom Rules ~
D U~t~ Ibrs
III Color S.c~le!i
D ll:on Sets
0 Hew RuIe,.,
~
r:f .clur Rules
t:I Menege Rules,..
9 Select 'Use a formula to detenmroe which cells to format'
Prev;ew:
I AaBbCcYyZz
II ,Oflllat ... I
I 0' I}J Can cel
A 8 C 0
1 ,Sierra Tango Charlie
2 Kilo Bravo Yankee
3 Go lf Mike Delta
,
4 J uliet
Papa
Alpha
X-ray
foxtrot
November
7
Zulu
Romeo
Sierra
'<ho
Whiskey
Quebec
,
8 India 0=, Delta
Sierra Um. Unifo rm
10 ~ Hotel Juliet Victor
11
Explanatton =CQUNTIF($A$1 $C$10,Al ) counts the number of names In the range A I :Cl0 that are equal to the
name in cell AI If CQUNTlF ($A$I$C$10,Al ) = 3, Excel formats the cell Because we selected the range A1Cl0
before we clicked on Condlllonal Formatting, Excel automatIC ally copies the formula to the other cells Thus , cell A2
contains the formula =COUNTlF($A$1 $C$10,A2)=3, cell A3 =COUNTIF($A$I$C$10,A3)=3, etc NotICe hoY; we
created an absolute reference ($A$I$C$10) to fIX thiS reference_
Note. you can use any formula you like For example, use thIS formula =CQUNTlF($A$I$C$10,Al 3 to highlight
the names that occur more than 3 times
Indiabulls
HOME LOANS
_ " . . TN . . .,.
';-'. . ..
HOME UIAJIS 0 '.50%. P.,
wQU-
Shade Alternate Rows
This example shows you how to use conditional formatting to shade attemate rows Shading every other ffloN in a
raoge makes rt easier to read your data
Select a range
A 8 C 0 E
,
1 Last Name ISales Country Quarter
Qt, ,
, Smith
Johnson
$16,753.00
$14,808.00
UK
USA Qt,.
Jon@s
5
Williams $10,644.00 UK
$1, 390.00 USA
Qt"
Qt, ,
6 Brown $4,865.00 USA Qt,.
7 Williams SU.438.00 UK Qt"
,
8 Johnson
Smith
$9,339.00 UK
$18,919.00 USA
Qt"
Qt, ,
10 Jon@s $9,213.00 USA Qt,.
II lones $7,433.00 UK Qt"
U Brown $3,255.00 USA Qt"
,.
13 Williams
Williams
$14,867.00 USA
$19, 302.00 UK
Qt, ,
Qt,.
15 Smith $9,698.00 USA Qt"
161
2. On the Home tab, In the Styles group, click Cond~1OIlii1 Formatllng
Conditional Format
F~ Tlble~
IS
Md culatlon I=heck cell _I Exp /a notary ... b ",,-----,I_ .'
~ut
Styles
lop/Bottom Rules
D D:~t.1 B~rs
a CoIorSuie
D lc:on Sets
o HewRuIe..,
r, .ctnr Rules ~.
rn Manage Buies...
I'f~
II A.abCCYyZz
II ,olmat.. I
I 0'
~
C,ntel
Res utt
1
A
c 0 E
2 $16,753.00 UK atr 3
3 USA
4 Will iams Q1r2
5
6 Brown
7
$4,865.00 USA
... Qlr4
QI!'
,
8 au 2
Qtr4
15
16
......
14 Williams $19, 302.00 UK Qtr4
E~planatlOO the MOD function gIVes the remall"der of iI divlSlOI1 The ROW() fUnc::tlOl"l retums the row number For
example, for the seventh row, MOD(7.2) equals 1 7 IS divided by 2 (3 limes) 10 gIVe a remalJ'Kler of 1 For the eght
row, MOO(8,2) equals 0 8 is dIVided by 2 (exactly 4 Illnes) 10 gIVe a remall'der of 0 As a resun, all odd rows return 1
(TRUE ) and will be shOOed
Compare Two Lists
This example describes how to compare two lists using cood~ional formatting For example, you may have two lists
of NFL teams
A 8 C
1 Miami Dolphins Atlanta Falcons
2 Cincinnati Bengals New Yert Giants
3 Detroi t LIons Oenver Broncos
,
5 Indianapolis Colts
New England Patriots
Tampa Bay Buccaneers
Washington Red sklns
7 Houston Texans Indianapolis Col ts
, Jacksonville Jaguars
8
Chicago Bears
San Diego Chargers
New England Patriot s
10 San Diego Chargers Cincinnati sengals
11 New York Giant s Arilona Cardinals
12 New Orl eans 5alnts M in nesota Vikings
,.
13 Tampa Bay Buccaneers
Seattle Seahawks
Pitt sburgh Steelers
San Francisco 4gers
15 Atlanta Falcons New Orleans Saints
Tennessee Titans Houston TeKans
"
17 Wash ington Redsk ins Seattle Seahawks
18 Baltimore Ravens Jackso nville Jaguar.;
Baltimore Ravens
"
20 Det roit Uons
21
To hlghhght the teams In the first list that are not in the second list, eKecute the following steps
1 First, select the range Al.AI8 and name rt firstlJst, select the range 81 820 and name rt secondlJst
rN~O'Omc.O'oO===;' i'"
Good Neutral
Styl~1
Resun Ml3fl'11 DoIph'ns and Tennessee Trtans are not ,n the secood list
1
2 New York Gi ants
3 Uons Denver Broncos
4 Francisco 4ger5 Chicago Bears
,
5
England Patriots
Ta mpa Bay Buccaneers
washington Redsk ins
7 Texans Indianapolis Colts
,8
Bears
Jaguars San Diego Chargers
New England Patriots
Diego Chargers Cincinnati Bengals
York Giants Arlzona Cardinals
Orleans Saints Minnesota Vikings
Bay Buccaneers Pinsburgh Steelers
San Francisco 4gers
New Orleans Saints
Texans
Seattle Seahawks
Ravens Jacksonville Jaguars
Bal timor e Ravens
Detroit lions
21
Explaoauoo =COUNTIF(secoodllst,Al) coools the nurber ofleams in secordlJs\ that are equal 10 the team If) eel
AI If COUNTlF(secoocLlSl,Al) :: O. the team 10 eel A tIS notl'l the second list As a restil. Excel fils the eel W11h a
blue background color Because we selected the filOlJe AlA 18 before we clicked on CondI\JooaI FOfTOatbng. Excel
3IAoma\lcaly copes the forrrUa 10 the oCher eels Thus eel A2 contans the formula =COUNTlF(secoocLJsl,A2}=O.
eel A3 =COUNTlF(secoocLJSl.A3}=-O. etc
8 To hIghIIghI the teams 111 the second list that are not In the first 1IsI, selecl the range 81 820. creale a new r\k>
usng the formula =COUNTlF(IirsIlJsL81)=O, and selthe formallD orange iii
Result Denver 8roocos, ArIzona Cardinals, t.1innesota Vlkngs and Prttsbu-gh Steelers are no! III the first ~I
B
1
2 New Vort. Giants
3 lions lIoncas
,
4 Francisco 4gers
Colts
Chicago Bears
Tampa Bay Buccaneers
6 Patriots Washington Redsklns
7 Indianapolis Colts
,
8 San Diego Chargers
New England Patriots
Cincinnati sengals
Giants c.....
MIl. 14lVldllp
Bay Buccaneers
Seahilwks san Francisco 4gers
New Orleans Saints
Ho"'too Te)(ilns
Seattle Seahawks
18 1acksonville Jagua rs
Baltimore Rilvens
"20 Detroit Lions
21
Conflicting Rules
Sometimes multiple cood~ional formatllng rules in Excel conflict A higher rule always wins This example illustrates
two different resuRs
1 The value 95 is higher than 80 but is also the highest value (Top 1). The formats (yellow fill vs green fill and yellow
text color vs green text color) conflict A higher rule alwavs WIllS As a resuR, the value 95 IS colored yellow
Rule ...
Rule (applied in ordel show n) Format App lies to Stop If True
0' Cl ost
Resu~
1
A
81
2
3
4 "
43
S 2
1 95 1
s
:j 11
"57
:1
11
2 Move the second n*! 141 The value 9515 the highest value {Top 1} but 15 also Ngt1ef than 80. The formals (green
flI vs yelow flI and green text color vs yelow text color) cOflflct. A I'lIghef n*! always WflS As a restAl, the value 95
IS colored green
o tjew Rule... I .
., . ,.
Resu~
1
2 ,
B1
3
"
,
4 43
, 2
7 ",
,
8 11
,. 86
11 "
Note only use the Stop If True check bo~es for backwards compabbllity wnh earier verslOOS of MIcrosoft EJccei
Indiabulls
HOME LOANS
Checklist
This ex ample teac hes you how to create a chec klist In Excel First, turn on the Developer tab_ Next, you can create
a checklist
A B 0
1 Holiday Checklist
, Passport
2
Sun cream
Swimming costume
5 MoneV
6 Medication
7 Camera
,
8 A good book
Toothbrush
10 Trave l insurance documents
11 Mobile phone
12
13 Total items I.
I. Items packed 8
15
16 Am I good to go?
17 -
To create thIS checklist, execute the followll19 steps
~
L:2r
Visual Maeros
Basic
~ Rl!<ord Macro
~ Us", R",lativ", R""H"'ne~
! Macro SKunty
Code
tf
Add-
m,
exe",1 (OM
~
AdcIins AdcIins
Addlns
In~
~
Design
~ Mode
Prop"'rti~
Q:JVi~Cod'"
00 Run Dialog
Controls
A B ( o
1 Holiday Checklist
2 Passport
3 Sun cream
4 Swimming cost ume
4 To remove "Check Box 1", right click the check box , click the text and delete~.
5. Select cell B2
6. Click on the lower right comer of cell B2 and drag rt down to cell Bll
A B C 0
1 Holiday Checklist
I
2 Passport 0
l Sun cream
4 Swimming costume
5 Money
6 Medication
7 Camera
,
B A good book
Toothbrush
10 Travel insu rance documents
11 Mobile phone
12
+
7 Right rid the first check box ard click Formal Control
A B C 0
1 Holiday Checklist
~ ,0"
2 Passport
l Sun cream C'"
4 Swimming costume U~
5 Money [ 0 faste
6 Medication [
7 Camera [
yrOup'"lI
Order
,
B A good book
Toothbrush
0
0 Assign Mitcro...
FOflTlat Objert ? x
Colon and Lines Size Protection Properties Art Te:d Co ntrol
Value
@J./.n<hecked
o !;hecked
o M ixed
Celi Jink: scs2I
-~
010 shadln,;!
OK Canul
10. The count the number of rtems packed, Insert a COUNTIF funcllon Into cell 814
814 I. =COU NTI F(C2:Cll,TR UE)
A
C 0
-
,.
15
Am I good to go?
17
11 H!de colurmC
121nsenaniFfuncbonll1locellB16
Result:
A 8 o E
1 Holiday Checklist
2 Passport 0
3 Sun cream 0
4 Swimming costume 0
,
5 Money
Medication
0
0
7 Camera 0
,
8 A good book
Toothbrush
0
0
10 Travel insurance documents 0
11 Mobile phone 0
12
13 Total items 10
14 Items packed 10
15
"JAm I good to go?
17
...
I
Note we created a coodillonal formalllllQ rule to change the background color of cell 816 depending on the celrs
value