Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
11 views82 pages

Excel Experts - Workshop File

Uploaded by

121314promax
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views82 pages

Excel Experts - Workshop File

Uploaded by

121314promax
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 82

Dazzle with Data Using Excel Magic!

Created by Julie Marcoux, Dalhousie University

JUMP TO MAIN MENU

CONTACT INFORMATION
Last updated April 2024

This file is shared under CC BY-NC 4.0


Return to Dazzling Title Screen

Welcome to a workshop in which you will be amazed with Excel magic tricks.
But don't worry, most of the tricks will be revealed!
You too can become an Excel expert!

Let's start with easy tricks using StatCan data


1_1 Let's concentrate on concatenation
We'll take a quick look at LEFT, MID, RIGHT, and FIND. 1_2
1_3 We'll build a list of unique values by eliminating duplicates.
You guys know about "paste as values" already, right? Everyone? 1_4
1_5 We'll use our list of unique values and SumIf and SumIfs to do some magic!

Let's use made up examples to have even more fun!


2_1 Let's take a look at VLOOKUP!
We're going to witness the power of CSE formulas. 2_2
2_3 We're going to color all empty cells in the worksheet in blue.
We're going to learn about my favorite Find/Replace tricks. 2_4
2_5 Did you think we were going to forget about OR and AND? As IF!
We're going to COUNT from A to Z! 2_6

Need More Help?


Easy
Not too bad
Oh no
OH NOOO
e
or
m
nd
a
rs
64
17

a
ye
to
to

18

65
e

0
21
m

e
Na

m
20

om
co

co
ce

op
IV

IV

r
In

In

in
in

ne

e
BD

BD

tP

nt
ov

Ow
CD

SU

SU

Re
To

Lo

Lo

Lo
Pr

12 1 1 Barrington 6523 1030 3840 1580 2535


12 1 4 Clark's Harbour 725 130 445 150 280
12 1 6 Shelburne 4336 630 2440 1195 1725
12 1 8 Shelburne 1644 310 875 440 525
12 1 9 Lockeport 476 55 210 175 180
12 2 1 Argyle 7870 1230 4520 2040 3155
12 2 4 Yarmouth 10067 1680 5775 2490 3865
12 2 6 Yarmouth 6829 1175 3745 1700 1430
12 2 40 Yarmouth 33 181 x x x 0
12 3 1 Clare 7678 950 4315 2250 3140
12 3 4 Digby 7242 1090 4035 2105 2775
12 3 6 Digby 2001 280 1030 585 420
12 3 9 Bear River (Part) 6 141 x x x 0
12 4 1 Medway River 11 15 x x x x
12 4 9 Ponhook Lake 10 15 x x x x
12 4 10 Queens 10422 1400 5705 3160 4095
12 4 15 Wildcat 12 49 x x x 0
12 5 1 Annapolis, Subd. D 3049 515 1785 745 1205
12 5 2 Bear River (Part) 6 0x x x x
12 5 4 Annapolis, Subd. A 5980 820 3160 1945 2535
12 5 6 Bear River 6B 15 x x x x
12 5 8 Annapolis Royal 530 30 225 265 180
12 5 9 Annapolis, Subd. B 4587 705 2470 1245 1555
12 5 14 Annapolis, Subd. C 5218 890 3100 1190 1885
12 5 16 Middleton 1873 310 995 510 425
12 6 1 Lunenburg 25545 3730 14465 7200 10340
12 6 4 Bridgewater 8790 1255 4855 2380 2470
12 6 6 Lunenburg 2396 325 1160 715 690
12 6 8 Mahone Bay 1064 145 480 375 355
12 6 9 Chester 10693 1485 5905 3170 4205
12 6 11 Gold River 21 81 x x x 0
12 6 14 Pennal 19 30 x x x x
12 6 16 New Ross 20 0x x x x
12 7 1 Kings, Subd. A 22355 4345 12935 4740 6970
12 7 2 Annapolis Valley First Nation 743 160 440 145 195
12 7 4 Berwick 2455 350 1190 645 650
12 7 11 Kings, Subd. C 8348 1395 4915 2015 2485
12 7 12 Kentville 6630 1125 3835 1400 1635
12 7 16 Kings, Subd. B 11951 2165 7120 2625 3845
12 7 21 Kings, Subd. D 5264 795 3035 1380 1950
12 7 24 Wolfville 5057 515 3110 1230 940
12 7 27 Glooscap 35 111 x x x 10
12 8 3 West Hants 19509 3445 11195 4485 6660
12 8 8 East Hants 22892 4525 14135 4200 7625
12 8 14 Indian Brook 14 2739 680 1655 405 635
12 9 19 Cole Harbour 30 208 x x x 10
12 9 34 Halifax 439819 77805 284175 73310 109540
12 9 37 Beaver Lake 17 20 x x x x
12 9 38 Sheet Harbour 36 10 x x x x
12 9 800 Wallace Hills 14A 15 x x x x
12 10 1 Colchester, Subd. C 12476 2340 7430 2650 4325
12 10 2 Stewiacke 1557 290 885 375 440
12 10 3 Millbrook 27 921 250 545 75 50
12 10 6 Truro 12954 1985 7375 3060 2700
12 10 8 Colchester, Subd. B 19806 3520 11380 4715 6770
12 10 12 Colchester, Subd. A 3762 625 2115 955 1465
12 11 1 Cumberland, Subd. A 3201 440 1665 1050 1295
12 11 6 Cumberland, Subd. B 6786 1010 3600 1740 2455
12 11 9 Cumberland, Subd. C 5694 940 3120 1595 2220
12 11 11 Amherst 9404 1660 5245 2340 2565
12 11 12 Oxford 1170 235 660 250 355
12 11 14 Cumberland, Subd. D 4283 510 2205 1425 1760
12 12 1 Pictou, Subd. A 6153 940 3395 1810 2525
12 12 4 Pictou 3107 500 1660 825 960
12 12 6 Pictou, Subd. B 6137 1020 3390 1515 2235
12 12 8 Westville 3540 690 2005 835 1125
12 12 9 Stellarton 4007 735 2345 905 1165
12 12 11 Pictou, Subd. C 8386 1370 4735 2205 3270
12 12 14 New Glasgow 9471 1655 5275 2265 2505
12 12 16 Trenton 2407 415 1435 520 810
12 12 19 Fisher's Grant 24 449 115 305 30 15
12 12 23 Merigomish Harbour 31 0x x x x
12 13 1 St. Mary's 2161 285 1150 690 945
12 13 4 Guysborough 4585 615 2345 1555 1925
12 13 8 Mulgrave 627 95 345 190 245
12 14 1 Antigonish, Subd. A 8963 1750 4935 2185 3030
12 14 2 Antigonish 4656 660 2795 1000 955
12 14 6 Antigonish, Subd. B 6138 1145 3605 1380 2390
12 14 10 Paqtnkek-Niktuek No. 23 372 130 225 15 10
12 15 1 Inverness, Subd. C 3167 445 1705 960 1310
12 15 2 Port Hawkesbury 3210 550 1865 725 860
12 15 5 Malagawatch 4 20 x x x x
12 15 6 Inverness, Subd. B 4865 795 2480 1470 1745
12 15 8 Whycocomagh 2 877 325 505 40 40
12 15 11 Inverness, Subd. A 5207 730 2680 1665 2030
12 16 1 Richmond, Subd. C 3136 445 1720 940 1210
12 16 6 Richmond, Subd. A 3763 545 1975 1160 1360
12 16 11 Richmond, Subd. B 1610 165 865 585 695
12 16 14 Chapel Island 5 405 130 250 25 15
12 17 8 Membertou 28B 1103 355 665 90 50
12 17 20 Eskasoni 3 3521 1300 1995 225 175
12 17 30 Cape Breton 93694 14450 53780 23790 30100
12 18 1 Victoria, Subd. B 4077 585 2150 1255 1620
12 18 3 Wagmatcook 1 691 270 360 65 30
12 18 6 Victoria, Subd. A 2673 415 1495 720 1110
re
nt
Re

485 Main Menu


80
340 1_1
265 1_2
55 1_3
300 1_4
565 1_5
1830
0
475
645
610
0
x
x
885
0
165
x
340
x
145
500
420
500
1165
1790
405
170
830
0
x
x
2490
75
390
1305
1325
1340
345
1500
0
1715
1760
90
110
80965
x
x
x
995
275
10
3650
1930
180
290
535
305
1915
180
255
280
495
395
435
720
445
1935
285
10
x
105
295
50
745
1250
205
15
120
550
x
420
10
365
245
370
85
0
25
130
12215
240
0
110
* Main Menu Exercise Data worksheet

1_1 CONCATENATION

What are we doing here?


We're going to use & to concatenate some strings/text

This is amazing! What if I want to learn more?


Just Google "Excel string functions"

How do I get started again?


This example is ready to go, just keep reading!
Once you think you understand, go do the exercise!

* INSTRUCTIONS
Use the & operator to concatenate text, just like you would use + or - to add or substract numbers. Use the address of
If the cell contains a number, it will be converted to text. Use "" to insert text.
Use """ to insert the " symbol, look carefully at the formula that results. (In macros, we use "" for some reason, but yo
Notice that only the result displayed by cells with formulas is concatenated, not the formula itself.

* Data Formulas using data

* Let's concatenate the content of cells B25 to B29


Use & to concatenate. =B25&B26&B27&B28&B29
Use the address of a cell to
Use & to concatenate.Use the address of a cell to concatenate it.If the cell contains a num
concatenate it.
If the cell contains a
number, it will be converted
to text.
26
is a number.

* Let's insert some text and spaces to the content of cells B32 and B33
Use "" to insert text. ="Text inserted. "&B32&" "&B33
Wow there are spaces! Text inserted. Use "" to insert text. Wow there are spaces!

* Let's insert "Wow!" and the contents of B36 and B37


Use """ to insert the "
symbol, ="""Wow!"" "&B36&B37
look carefully at the
"Wow!" Use """ to insert the " symbol, look carefully at the resulting formula
resulting formula

* Let's insert C37 and the contents of B41


=B41&" "&C37
Notice that the content displayed
Notice that the content by cells with formulas is
displayed by cells with concatenated, not the formula
formulas is concatenated, itself. "Wow!" Use """ to insert the
not the formula itself. " symbol, look carefully at the
resulting formula

* SUPPLEMENTARY INFORMATION

* Recent versions of Excel will allow you to use the TEXTJOIN formula to concatenate text strings with a delimiter
Use & to concatenate. =TEXTJOIN(" ",TRUE,B46:B47)
Use the address of a cell to
Use & to concatenate. Use the address of a cell to concatenate it.
concatenate it.

If cell C47 doesn't seem to display the concatenated version of B45 and B46 with a text in between, you might not hav
TEXTOIN is a great option when everything needs to be concatenated with the same delimiter.

* Recent versions of Excel will allow you to use the CONCAT formula to concatenate text strings
Use & to concatenate. =CONCAT(B53:B54)
Use the address of a cell to
Use & to concatenate.Use the address of a cell to concatenate it.
concatenate it.

This is very similar to using the & symbol to concatenate.


If you want to concatenate several cells in a range, you might find it easier to add a space or delimiter directly in the c

* Recent versions of Excel also allow you to concatenate text with flash fill
Google "Flash fill Excel" to find out more.

Flash fill will work best if there's a common pattern to how you want to concatenate cells.
Just like other methods here, it can concatenate across multiple columns (or rows)
However, it will not update itself dynamically, which means that flash fill is best used when no more modifications wil
sheet

stract numbers. Use the address of a cell to concatenate its contents.

we use "" for some reason, but you don't need to know that right now)
e formula itself.

catenate it.If the cell contains a number, it will be converted to text.26is a number.

at the resulting formula


te text strings with a delimiter

catenate it.

text in between, you might not have the right version of Excel.
e delimiter.

e text strings

a space or delimiter directly in the cells to concatenate.

ed when no more modifications will be made to a spreadsheet.


* Main Menu Instructions Data worksheet

* CONCATENATION EXERCISE
The 2021 CSD worksheet contains Nova Scotia data from the 2021 census. You get confused when you try to make sen
decide you want to create a single column containing the abbreviation "NS", the number of the census division (CD colu
the subdivision (SUBDIV column) separated by a "-" . Use concatenation in order to achieve this. See the expected resu
of what your concatenated string should look like.

You don't need to transfer any data to this worksheet in order for the concatenation to work. You can just select the ce
when typing in your formula, or reference it using the provided example. But I'm in a good mood, so I've gone ahead an
this worksheet in columns E and F

* Referencing cell A2 in the 2021 CSD worksheet

* Typing in Results in the number


='2021 CSD'!A2 12

* Table to use to practice concatenation


Insert your formula in this
* Row in 2021 CSD column Expected result CD
2 NS 1-1 1
3 NS 1-4 1
4 NS 1-6 1
5 NS 1-8 1
6 NS 1-9 1
7 NS 2-1 2
8 NS 2-4 2
9 NS 2-6 2
10 NS 2-40 2
11 NS 3-1 3
12 NS 3-4 3
13 NS 3-6 3
14 NS 3-9 3
used when you try to make sense of the geography, so you
er of the census division (CD column), and the number of
ieve this. See the expected results column to get an idea

work. You can just select the cell in the other worksheet
ood mood, so I've gone ahead and copied the data over to

Did it work?

SUBDIV Success?
1 Not yet...
4 Not yet...
6 Not yet...
8 Not yet...
9 Not yet...
1 Not yet...
4 Not yet...
6 Not yet...
40 Not yet...
1 Not yet...
4 Not yet...
6 Not yet...
9 Not yet...
* Main Menu Exercise Data worksheet

1_2 LEFT, RIGHT, MID, and FIND STRING FUNCTIONS

What are we doing here?


We're going to extract parts of the text contained in a cell.
This is REALLY useful!

This is amazing! What if I want to do more?


Just Google "Excel string functions"
How do I get started again?

This example is ready to go, just keep reading!


Once you think you understand, go do the exercise!

* INSTRUCTIONS
The LEFT function will extract a specified number of characters starting from the left of a string. Don't worry, both text
The RIGHT function does the same thing, but it starts from the right.
The MID function lets you extract a specified number of characters, starting from a specified location.
The FIND function will try to find a character, and give you the number of its position in a string. We use it to do MAGI

* Lets use LEFT to extract the Let's use RIGHT to extract


Data province the last number
=LEFT(B25,2) =RIGHT(B25,1)
NS 1-8 NS 8
NS 2-4 NS 4
NS 2-40 NS 0
NS 3-1 NS 1
NS 3-9 NS 9
NS 4-10 NS 0
QC 26-3 QC 3
ON 8-446 ON 6

Let's use MID to grab the 3


* characters following the Let's see what FIND does
Data space when we search for "-"
=MID(B36,4,3) =FIND("-",B36)
NS 1-8 1-8 5
NS 2-4 2-4 5
NS 2-40 2-4 5
NS 3-1 3-1 5
NS 3-9 3-9 5
NS 4-10 4-1 5
QC 26-3 26- 6
ON 8-446 8-4 5
Let's use MID and FIND to Let's use RIGHT and FIND to
* grab the number in the grab the number on the
Data middle right
=MID(B47,4,(FIND("-",B47)- =RIGHT(B47,(LEN(B47)-
4)) FIND("-",B47)))
NS 1-8 1 8
NS 2-4 2 4
NS 2-40 2 40
NS 3-1 3 1
NS 3-9 3 9
NS 4-10 4 10
QC 26-3 26 3
ON 8-446 8 446

* SUPPLEMENTARY INFORMATION

* In-depth look at the MID formula and embedded formulas


=MID(B47,4,(FIND("-",B47)-4))
To figure out what the heck Here, we use MID, then we So that last part,
is happening in a formula, look at text in a cell, then (FIND("-",B47)-4) goes
look for the comma "," we give the number of together. It uses FIND to
which separates the characters from which to find the number associated
arguments. start the extraction, then with the "-" symbol in cell
we give the number of B47 then subtracts 4. That
characters to extract. To do gives us the number of
that last part, we use FIND, characters to extract before
which itself will look for a we hit the "-" symbol.
symbol "-" in a given cell
(B47).

* Recent versions of Excel also allow you to split text with flash fill
Google "Flash fill Excel" to find out more.

Flash fill will work best if there's a common pattern to how you want to split your cells.
However, it will not update itself dynamically, which means that flash fill is best used when no more modifications wil

* Look into Text to Columns


Google "Text to Columns" to find out more.

Text to columns can split your text at a given delimiter.


However, it will overwrite columns to the right of your initial column, so use carefully!
sheet

m the left of a string. Don't worry, both text and numbers can be manipulated as strings.

from a specified location.


s position in a string. We use it to do MAGIC!

Counting from the left, that's the number of characters until we get to "-"
LEN gives you the total number of characters in a string, by the way.
Congrats on finding the hidden bonus function!

I could have made this


example even more
complicated by using the
FIND formula to return the
number associated to the
space after the province,
using that as the number
from which to start the
extraction, and than using it
again when it comes time to
subtract.

best used when no more modifications will be made to a spreadsheet.


* Main Menu Instructions Data worksheet

* LEFT, RIGHT, MID, FIND, LEN EXERCISE


This exercise is harder than it looks, but I believe in you!
Scroll down and look at that list of names.
Figure out a way to extract the first name and the last name using a formula.
Now you'll be able to alphabetize the list by last name!

* Table with names to extract


Names First Name Last Name
Barbara Gordon
Bruce Wayne
Cassandra Cain
Damian Wayne
Helena Rosa Bertinelli
Jason Todd
Richard John Grayson
Roy Harper
Selina Kyle
Stephanie Brown
Tim Drake
Example of a list sorted by last name
Do the exercise and ordering by last name becomes very easy to do!
Brown Stephanie
Cain Cassandra
Drake Tim
Gordon Barbara
Harper Roy
John Grayson Richard
Kyle Selina
Rosa Bertinelli Helena
Todd Jason
Wayne Bruce
Wayne Damian
* Main Menu Exercise Data worksheet

1_3 ELIMINATING DUPLICATES

What are we doing here?


We're going to get rid of duplicates to get a list of unique values.
It's really easy, we just have to click lots of stuff in Excel's menu.

This is amazing! What if I want to do more?


Carefully read every single entry in Excel's help file… :D

How do I get started again?


This example is ready to go, just keep reading!
If you need a reset, copy-paste the table at the bottom of this worksheet
Once you think you understand, go do the easiest exercise yet!

* INSTRUCTIONS
Select the data for which you want to remove duplicates. In Excel's menu, select the "data" ribbon and then "Remove

* Data table Steps

* Remove duplicates across two columns

Count of item Item Select cells in the table to the right (B25 to C31)
1 Golden ring Click on the "data" ribbon, and then "Remove duplicates"
1 Golden ring
4 Bears
2 Golden ring
1 Turtle Dove
5 Bears
Make sure that there is a checkmark for "My data has hea
Reset example (scroll down)
Click "Ok". One duplicate value will be removed.
"Golden ring" is in the list twice because it is paired with "

* Remove duplicates across one column

Count of item Item When you want to find unique values in one column, it's e
1 Golden ring But for the sake of this demonstration, select cells in the t
1 Golden ring Click on the "data" ribbon, and then "Remove duplicates"
4 Bears Excel realizes that there is another column besides this on
2 Golden ring Select "Continue with the current selection" and then "Re
1 Turtle Dove Make sure that there is a checkmark for "My data has hea
5 Bears Click "Ok". Three duplicate values will be removed.
The "Count of item" column no longer makes sense. Selec
Reset example (scroll down)

* SUPPLEMENTARY INFORMATION

* Conditional formatting

Count of item Item


1 Golden ring
1 Golden ring
4 Bears
2 Golden ring
1 Turtle Dove
5 Bears

Conditional formatting (Home ribbon, Styles section) has a "duplicate values" option under "highlight cell rules".
It works very differently - it highlights any item that has a duplicate, leave empty of formatting items that are complet
In our example table, "Turtle Dove" is only found in only one cell, so it's been left in the default format (white backgro
However, "Golden ring" is in three different cells, so it's been highlighted.

* RESET EXAMPLES

Count of item Item


1 Golden ring
1 Golden ring
4 Bears
2 Golden ring
1 Turtle Dove
5 Bears

Copy the above table, and then click to teleport to the desired reset location. Paste.
Because of how Excel handles links, you had to scroll down to get here.
You may or may not need to scroll down when clicking on one of the two below example buttons.

First Example (2 columns)


Second example (1 column)
sheet

elect the "data" ribbon and then "Remove duplicates" from the "Data Tools" section

he table to the right (B25 to C31)


ta" ribbon, and then "Remove duplicates" in the "Data Tools" section.

there is a checkmark for "My data has headers" and that both columns are selected.

duplicate value will be removed.


in the list twice because it is paired with "1" in one row, and with "2" in another row.

to find unique values in one column, it's easier to copy-paste it elsewhere.


of this demonstration, select cells in the table to the right (B38 to C44)
ta" ribbon, and then "Remove duplicates" in the "Data Tools" section.
at there is another column besides this one, but we don't want it.
e with the current selection" and then "Remove duplicates…"
there is a checkmark for "My data has headers".
e duplicate values will be removed.
em" column no longer makes sense. Select cells B38 to B44 and delete them.

s" option under "highlight cell rules".


mpty of formatting items that are completely unique in a range.
n left in the default format (white background).

elow example buttons.


* Main Menu Instructions Data worksheet

* REMOVE DUPLICATES EXERCISE


Don't worry, this one is REALLY easy. Go copy-paste columns A and B from the 2021 CSD worksheet
into columns G and H of this worksheet. Then remove the duplicates. Easy!
You should find 77 duplicate values, with 19 unique values remaining.
Although sometimes these counts change a bit depending on the copy-paste method you used.
*
sheet

he 2021 CSD worksheet

e method you used.


* Main Menu Exercise Data worksheet

1_4 PASTE AS VALUES

What are we doing here?


I'm making extra sure you know about Paste Special.
It is SUCH a useful thing to know.
I mostly use it to transform formulas into data.

This is amazing! What if I want to do more?


I guess you could explore the different options in the 'Paste Special' menu?

How do I get started again?


The example is ready to go, just keep reading!
If you need a reset, copy-paste from the bottom of this worksheet
Use the "Paste as values" button for copy-pasting as data.

* INSTRUCTIONS
Select cells containing formulas and copy them using your favorite method.
Then click on the arrow under "Paste" in the "Home" ribbon and select one of the options as appropriate.

If you don't quite understand what happens below in the example, reinitialize it by copy pasting the data and formula
Click on C32 and look at the formula bar. Copy paste C32 to C37 in the worksheet and see what happens. C32 and C37
Click on C32 again and copy it. In the "Clipboard" section of the "Home" ribbon, click on the dropdown arrow under "P
Without moving, select the first option under "Paste values".
Click on C32 again and look at the formula bar. Copy-paste C32 to C37 and see what happens. C32 and C37 should be

Alternatively, go to the "Formulas" ribbon and click on "Show Formulas" in the "Formula Auditing" section.

* Data Steps | Formulas


I'm using I'm using concatenation. Let's transform that into values.
concatenation Try copying in place and pasting as values.
Let's transform that See what happens when you copy-paste from the formulas column before and after doin
into values.
Try copying in place
and pasting as values.
See what happens when
you copy-paste
from the formulas column
before and after
doing the paste as values.

* RESET EXAMPLE
I'm using I'm using concatenation. Let's transform that into values.
concatenation Try copying in place and pasting as values.
Let's transform that See what happens when you copy-paste from the formulas column before and after doin
into values.
Try copying in place
and pasting as values.
See what happens when
you copy-paste
from the formulas column
before and after
doing the paste as values.

Select cells B47 to C57. Copy


Click on cell B32. Paste (using whatever method you usually use to paste content).
sheet

of the options as appropriate.

ze it by copy pasting the data and formulas at the bottom of the spreadsheet.
sheet and see what happens. C32 and C37 should be different.
bon, click on the dropdown arrow under "Paste".

ee what happens. C32 and C37 should be identical.

he "Formula Auditing" section.

the formulas column before and after doing the paste as values.
the formulas column before and after doing the paste as values.
* Main Menu Instructions Data worksheet

* PASTE AS VALUES EXERCISE


OH NO! Someone has directly referenced data from the 2021 CSD worksheet in this worksheet.
This displeases you, for some reason. Perhaps you are afraid of what will happen if you decide to delete the data works
You are right to be afraid, if ANYTHING happens to 2021 CSD, then this entire worksheet stops working.

For extra security, you decide to transform all the formulas in this worksheet as values, except for the 15+ population t
Start by previewing formulas by clicking on "Show Formulas" in the "Formula Auditing" section of the "Formulas" ribbo
then turn off "Show Formulas". Transform the formulas in the table into values, skipping the formula that sums up the
You can check your work by clicking on "Show Formulas" in the "Formula Auditing" section of the "Formulas" ribbon.

* Table to copy-paste as value


Province SUBDIV Name Tot Pop 2021
12 Barrington 6523
12 Clark's Harbour 725
12 Shelburne 4336
12 Shelburne 1644
12 Lockeport 476
12 Argyle 7870
12 Yarmouth 10067
12 Yarmouth 6829
12 Yarmouth 33 181
12 Clare 7678
12 Digby 7242
12 Digby 2001
12 Bear River (Part) 6 141
Total population: 55713
sheet

et in this worksheet.
ppen if you decide to delete the data worksheet?
re worksheet stops working.

t as values, except for the 15+ population total.


a Auditing" section of the "Formulas" ribbon
ues, skipping the formula that sums up the population total.
uditing" section of the "Formulas" ribbon.

Did it work?
Prov - County - TotPop Was the formula removed?
NS-Barrington-6523 Try again <-You want formulas on this row of the table removed
NS-Clark's Harbour-725 Try again <-You want formulas on this row of the table removed
NS-Shelburne-4336 Try again <-You want formulas on this row of the table removed
NS-Shelburne-1644 Try again <-You want formulas on this row of the table removed
NS-Lockeport-476 Try again <-You want formulas on this row of the table removed
NS-Argyle-7870 Try again <-You want formulas on this row of the table removed
NS-Yarmouth-10067 Try again <-You want formulas on this row of the table removed
NS-Yarmouth-6829 Try again <-You want formulas on this row of the table removed
NS-Yarmouth 33-181 Try again <-You want formulas on this row of the table removed
NS-Clare-7678 Try again <-You want formulas on this row of the table removed
NS-Digby-7242 Try again <-You want formulas on this row of the table removed
NS-Digby-2001 Try again <-You want formulas on this row of the table removed
NS-Bear River (Part) 6-141 Try again <-You want formulas on this row of the table removed
YAY! <-You want to keep the formula on this row of the table
* Main Menu Exercise Data worksheet

1_5 SUMIF AND SUMIFS

What are we doing here?


We're going to learn about SumIF and SumIFs.
These let us use criteria in order to add numbers.

This is amazing! What if I want to do more?


I'm not sure! Maybe learn about CSE formulas in 2_2?
How do I get started again?

This example is ready to go, just keep reading!


Once you think you understand, go do the exercise!

* INSTRUCTIONS
Both SumIF and SumIFs use ranges, and you're going to want to use the $ symbol for those so that the ranges will stay
move in the worksheet.

SumIF has three arguments. First, give it the range of cells in which it is going to lookup a value that will fulfill your des
Next, give it your criteria so that it can search in the provided range and see if anything fits your criteria.
Lastly, tell it what it is adding up.

SumIFs needs at least three arguments. First, give it the range of cells that it is going to add.
Next, give it the range where you are going to check a criteria.
Lastly, tell it what criteria it needs to check.
You can repeat the second and third steps for other criteria to check IN OTHER COLUMNS. SumIFs does not understan
for more than one criteria in a same column (or at least, not without involving brain breaking arrays or adding SumIFs

* SumIF Example

* Tool cost table


Status Name Tool
Hero Peter Parker Web Slinger
Hero Bruce Wayne Bat car
Villain Dr. Horrible Freeze Ray
Hero Peter Parker Venom antidote
Ambiguous Dentists Scary looking equipment

* Adding up the cost of tools for everyone with a Hero status!


Try changing "Hero" to "Villain" or "Ambiguous" and see what happens!
Criteria Sum of cost of tools Text of formula
Hero 125,110.67 $ =SUMIF($B$35:$B$39,B44,$E$35:$E$39)

* Adding up the cost of tools for everyone who is a Hero OR Ambiguous - 2 possibilities in a same column!
Try changing the criteria in the first column and see what happens!
Criteria Sum of cost of tools Text of formula
Hero 125,662.92 $ =SUMIF($B$35:$B$39,B49,$E$35:$E$39)+SUMIF($B$35:$B$
Ambiguous

* SumIFs Example

* Coolness and annual salary table


Status Name Coolness
Hero Peter Parker Cool
Hero Bruce Wayne Super cool
Villain Dr. Horrible Super cool
Hero Ted Parker Cool
Ambiguous Daredevil Super cool

* Adding up the salary of everyone with the Hero status!


Try changing "Hero" to "Villain" or "Ambiguous" and see what happens!
Criteria Sum of salaries Text of formula
Hero 3,169,999.00 $ =SUMIFS($E$56:$E$60,$B$56:$B$60,B65)

* Adding up the salary of every Super cool Hero - criteria over two different columns!
Try changing the criteria in the first column and see what happens!
Criteria Sum of cost of tools Text of formula
Hero 2,999,999.00 $ SUMIFS($E$56:$E$60,$B$56:$B$60,B70,$D$56:$D$60,B71)
Super cool

* SUPPLEMENTARY INFORMATION

* Important difference between SumIF and SumIFs

The first argument in SumIF is the range containing the criteria, while the first argument in SumIFs is the range to add

* In-depth look at the SumIFs formula


=SUMIFS($E$56:$E$60,$B$56:$B$60,B70,$D$56:$D$60,B71)
Sure, this formula entered In the first part, Next, we tell Excel where to
in cell C70 looks like a lot of $E$56:$E$60, we tell Excel look for a criteria in the
gibberish, until you that we want to add table. We want it to look at
remember to look for the numbers in the last column the "Status" column
comma "," which separates (column E) of the coolness (column B) that identifies
the arguments. and annual salary table. heroes and villains in the
"Coolness" table:
$B$56:$B$60

The "$" sign is used for absolute referencing. It mean that if we copy-paste this formula elsewhere, it is still going to lo
When entering a formula, highlight an argument and hit F4 on your keyboard to quickly toggle on absolute referencin
sheet

ymbol for those so that the ranges will stay the same no matter where you

g to lookup a value that will fulfill your desired criteria.


if anything fits your criteria.

t is going to add.

HER COLUMNS. SumIFs does not understand 'OR' logic, you can't check
ng brain breaking arrays or adding SumIFs together).

Cost <- Try changing the costs and


24.85 $ see what happens to the totals below
125,030.00 $
350,000.00 $
55.82 $
552.25 $

B$39,B44,$E$35:$E$39)

possibilities in a same column!


B$39,B49,$E$35:$E$39)+SUMIF($B$35:$B$39,B50,$E$35:$E$39)

Annual salary <- Try changing the salaries and


45,000.00 $ see what happens to the totals below
2,999,999.00 $
15,000.00 $
125,000.00 $
10,000.00 $

$E$60,$B$56:$B$60,B65)

E$60,$B$56:$B$60,B70,$D$56:$D$60,B71)

rst argument in SumIFs is the range to add up together.

We then want Excel to Rinse and repeat for the


check the contents of that next criteria! We look in the
column against our desired "Coolness" column (column
criteria. Here, we've given it D - $D$56:$D$60) and check
B70, the address of a cell the coolness against our
that contains "Hero" or desired criteria in cell B71.
"Villain" or "Ambiguous".

this formula elsewhere, it is still going to look at the exact same range/table.
rd to quickly toggle on absolute referencing.
Main Menu Instructions Data worksheet
*

* SUMIF AND SUMIFS EXERCISE


We're going to estimate the total population (contained in column E of the 2021 CSD worksheet) for each census divisio
You'll notice that census divisions appear more than once in the 2021 CSD worksheet.

First of all, I've prepared a lot of things for you, using concepts we've already covered:
1 - I've copied columns B, C, D and E of the 2021 CSD worksheet into columns H, I, J, and K of this worksheet.
2 - I changed a "1" CD to a "5" (in H2) for the purposes of making sure that you are using absolute addresses in your ran
and to illustrate that content in columns does not need to be in order...
3 - I've copied-pasted column H into column M.
4 - I removed duplicates from column M.
5 - I copy-pasted column M into the exercise's column B below.

Now, I trust YOU to enter a formula in column C that will use SumIF and the values in column B to find the total popula
(column K) by census division according to the 2021 CSD worksheet. And do the same in column D for SumIFs.
There are 96 rows in column I: row 1 has the header, and rows 2 to 96 contain data.

* Table to use to practice SumIF and SumIFs


Census Division SumIf TotPop SumIfs TotPop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
sheet
CD SUB SUBDIV Name
5 1 Barrington
1 4 Clark's Harbour
2021 CSD worksheet) for each census division in NS. 1 6 Shelburne
1 8 Shelburne
1 9 Lockeport
2 1 Argyle
ns H, I, J, and K of this worksheet. 2 4 Yarmouth
you are using absolute addresses in your ranges 2 6 Yarmouth
2 40 Yarmouth 33
3 1 Clare
3 4 Digby
3 6 Digby
3 9 Bear River (Part) 6
values in column B to find the total population 4 1 Medway River 11
the same in column D for SumIFs. 4 9 Ponhook Lake 10
4 10 Queens
4 15 Wildcat 12
Did it work? 5 1 Annapolis, Subd. D
Expected result Success? 5 2 Bear River (Part) 6
7,181 Not yet… 5 4 Annapolis, Subd. A
24,947 Not yet… 5 6 Bear River 6B
17,062 Not yet… 5 8 Annapolis Royal
10,501 Not yet… 5 9 Annapolis, Subd. B
27,775 Not yet… 5 14 Annapolis, Subd. C
48,599 Not yet… 5 16 Middleton
62,914 Not yet… 6 1 Lunenburg
45,140 Not yet… 6 4 Bridgewater
440,072 Not yet… 6 6 Lunenburg
51,476 Not yet… 6 8 Mahone Bay
30,538 Not yet… 6 9 Chester
43,657 Not yet… 6 11 Gold River 21
7,373 Not yet… 6 14 Pennal 19
20,129 Not yet… 6 16 New Ross 20
17,346 Not yet… 7 1 Kings, Subd. A
8,914 Not yet… 7 4 Berwick
98,318 Not yet… 7 11 Kings, Subd. C
7,441 Not yet… 7 12 Kentville
Annapolis Valley First
7 2 Nation
7 16 Kings, Subd. B
7 21 Kings, Subd. D
7 24 Wolfville
7 27 Glooscap 35
8 3 West Hants
8 8 East Hants
8 14 Indian Brook 14
9 19 Cole Harbour 30
9 34 Halifax
9 37 Beaver Lake 17
9 38 Sheet Harbour 36
9 800 Wallace Hills 14A
10 1 Colchester, Subd. C
10 2 Stewiacke
10 3 Millbrook 27
10 6 Truro
10 8 Colchester, Subd. B
10 12 Colchester, Subd. A
11 1 Cumberland, Subd. A
11 6 Cumberland, Subd. B
11 9 Cumberland, Subd. C
11 11 Amherst
11 12 Oxford
11 14 Cumberland, Subd. D
12 1 Pictou, Subd. A
12 4 Pictou
12 6 Pictou, Subd. B
12 8 Westville
12 9 Stellarton
12 11 Pictou, Subd. C
12 14 New Glasgow
12 16 Trenton
12 19 Fisher's Grant 24
12 23 Merigomish Harbour 31
13 1 St. Mary's
13 4 Guysborough
13 8 Mulgrave
14 1 Antigonish, Subd. A
14 2 Antigonish
14 6 Antigonish, Subd. B
14 10 Paqtnkek-Niktuek No. 23
15 1 Inverness, Subd. C
15 2 Port Hawkesbury
15 5 Malagawatch 4
15 6 Inverness, Subd. B
15 8 Whycocomagh 2
15 11 Inverness, Subd. A
16 1 Richmond, Subd. C
16 6 Richmond, Subd. A
16 11 Richmond, Subd. B
16 14 Chapel Island 5
17 8 Membertou 28B
17 20 Eskasoni 3
17 30 Cape Breton
18 1 Victoria, Subd. B
18 3 Wagmatcook 1
18 6 Victoria, Subd. A
Tot Pop Unique
2021 CD
6,523 5
725 1
4,336 2
1,644 3
476 4
7,870 6
10,067 7
6,829 8
181 9
7,678 10
7,242 11
2,001 12
141 13
15 14
15 15
10,422 16
49 17
3,049 18
0
5,980
15
530
4,587
5,218
1,873
25,545
8,790
2,396
1,064
10,693
81
30
0
22,355
2,455
8,348
6,630

743
11,951
5,264
5,057
111
19,509
22,892
2,739
208
439,819
20
10
15
12,476
1,557
921
12,954
19,806
3,762
3,201
6,786
5,694
9,404
1,170
4,283
6,153
3,107
6,137
3,540
4,007
8,386
9,471
2,407
449
0
2,161
4,585
627
8,963
4,656
6,138
372
3,167
3,210
20
4,865
877
5,207
3,136
3,763
1,610
405
1,103
3,521
93,694
4,077
691
2,673
* Main Menu Exercise

2_1 VLOOKUP

What are we doing here?


Vlookup is fun. It'll go look up stuff for you. You like having fun, right?

This is amazing! What if I want to do more?


You could also try Hlookup and in recent versions of Excel, Xlookup.
Google wildcards in Vlookup. And learn about TRIM (important).
When you're feeling confident in your skills, Google 'Excel' and 'Index Match'

How do I get started again?


This example is ready to go, just keep reading!
If you need a reset, copy-paste the table at the bottom of this worksheet
Once you think you understand, go do the easiest exercise yet!

* INSTRUCTIONS
Vlookup will put data in your cell by looking up values in another column. It has four arguments.
First, it needs to know what it will be looking up.
Second, it wants to know the range in which it will be looking up whatever it is you need it to look up.
Third, it wants the number of the column in the range from which it will be extracting data.
Lastly, it wants to know if you need an exact match or not. "FALSE" is almost always the option you want to use here.

Whenever you're working with ranges or arrays, it's usually a good idea to use the "$" symbols.
And keep in mind that Vlookup never worries about capitalization.

In the examples below, we have a nice table of sounds that animals make…
…while Farmer Ted has a list of animals for which he would like to automatically associate sounds.

* Simple Vlookup example and error handling

* Table of animals and the sounds that they make Farmer Ted's list of animals

Animals Sounds Animal Names


Cat Miow Felix
Giraffe ??? Spot
Cricket Cricket cricket Hortense
Cow Mooo Rover
Pig Oink oink Bacon
Duck Quack quack Donald
Dog Woof Jimmy
Barbecued
No Gators in table of animals -> Later
Tournedos
Soushi

* SUPPLEMENTARY INFORMATION

* In-depth look at the Vlookup formula


=vlookup(F46,$B$36:$C$42,2,False)
First, we tell Excel we want to lookup "Cat" or whatever is contained in cell F46.
Second, we tell Excel we'll be looking that up in our table of animal sounds, in a range, B36 to C42 ($B$36:$C$42).
Third, the number "2" tells Excel that what we want to retrieve is the content of the second column in our range.
Animals are in the first column, sounds in the second column. So look for "Cat", and tell us what sound the "cat" make
Fourth "False" tells Excel that we want an exact match.

* Handling error messages


When Vlookup can't find what it's looking for, it returns an error message #N/A. You'll notice above that this happene
cell G44. This is really annoying when trying to analyze your data - the error propates to your various formulas. If you w
Vlookup inside the IfError formula to return a message saying that the value was not found instead. Look at 2_5 if you
about using IF logic in your formulas.

* INSTRUCTIONS
Vlookup also works with wildcards. Like "*" & F71 & "*". Um…just…look at the example, I guess.

* Vlookup with wildcards

* Table of animals and the sounds that they make Farmer Ted's list of animals

Fuzzy animals - Exact


matches won't work Sounds Animal Names
A cat Miow Felix
The giraffe ??? Spot
Cricket Cricket Cricket cricket Hortense
Wow Cow Mooo Rover
Big pig Oink oink Bacon
Duck goose Quack quack Donald
Wow dog wow Woof Jimmy
Barbecued
No Gators in table of animals -> Later
Tournedos
Soushi

* SUPPLEMENTARY INFORMATION

* Vlookup, Hlookup, Xlookup, Index Match


Vlookup's biggest strength is that it's easier to teach and practice with than the other methods!
Use Hlookup to lookup values across columns instead of across rows.
If you have a recent version of Excel, use Xlookup instead of Vlookup. It has the benefit of handling errors without ne
If you are very confident with Excel, or need efficiency (such as when working with hundreds of thousands of rows of d

* Table of animals and the sounds that they make Vlookup, Xlookup, and Index Match examples
Animals Sounds Formula
Cat Miow Vlookup
Giraffe ??? Xlookup
Cricket Cricket cricket Index Match
Cow Mooo
Pig Oink oink Element
Duck Quack quack Value to lookup
Dog Woof Animal sounds table
Animal column
Animal to look up Cat Sound column
Exact match
as four arguments.

s you need it to look up.


tracting data.
always the option you want to use here.

e the "$" symbols.

lly associate sounds.

's list of animals Simple Vlookup Error handling

=IFERROR(VLOOKUP(F
=VLOOKUP(F36,$B$3 36,$B$36:$C$42,2,FAL
Animals 6:$C$42,2,FALSE) SE),"NOT FOUND!!!")
Cat Miow Miow
Dog Woof Woof
Giraffe ??? ???
Dog Woof Woof
Pig Oink oink Oink oink
Duck Quack quack Quack quack
Cricket Cricket cricket Cricket cricket
Pig Oink oink Oink oink
Gator #N/A NOT FOUND!!!
Pig Oink oink Oink oink
Cat Miow Miow

a range, B36 to C42 ($B$36:$C$42).


of the second column in our range.
", and tell us what sound the "cat" makes.

A. You'll notice above that this happened to Later the Gator in


ropates to your various formulas. If you want, you can encapsulate
was not found instead. Look at 2_5 if you want to learn a bit more

e example, I guess.

's list of animals Simple Vlookup With Wildcards

=VLOOKUP("*"&F71&
=VLOOKUP(F71,$B$7 "*",
Animals 1:$C$77,2,FALSE) $B$71:$C$77,2,FALSE)
Cat #N/A Miow
Dog #N/A Woof
Giraffe #N/A ???
Dog #N/A Woof
Pig #N/A Oink oink
Duck #N/A Quack quack
Cricket #N/A Cricket cricket
Pig #N/A Oink oink
Gator #N/A #N/A
Pig #N/A Oink oink
Cat #N/A Miow
he other methods!

he benefit of handling errors without nesting inside an IFERROR.


with hundreds of thousands of rows of data), look into Index Match

lookup, and Index Match examples


Active formula Formula text
Miow =VLOOKUP(C102,$B$94:$C$100,2,FALSE)
Miow =XLOOKUP(C102,$B$94:$B$100,$C$94:$C$100,"???",0)
Miow =INDEX($B$94:$C$100,MATCH(C102,$B$94:$B$100,0),2)

Example
C102
$B$94:$C$100
$B$94:$B$100
$C$94:$C$100 or 2
FALSE or 0
* Main Menu Instructions

* VLOOKUP EXERCISE
You've been compiling a list of famous people, the city and country they come from, and how the average temperature
However, you're a busy person! You can't be expected to type up the country and the temperature each time you put
So to speed things up here, use Vlookup to find the appropriate country in column H, and the status/temperature in co

* Table with values to look up


City Country Status
Moncton Canada Cold and wet
Ottawa Canada Cold
Winnipeg Canada Colder
Honolulu Hawaii Nice and warm
Christmas Village North Pole Magical
Las Vegas United States Too hot
Halifax Canada So much rain
rom, and how the average temperature of that city had an impact on their career.
and the temperature each time you put in the name of the city.
mn H, and the status/temperature in column I.

Your table with values to find


Celebrities City of origin Look up the country
Atwood, Margaret Ottawa
Bastarache, Michel Moncton
Claus, Santa Christmas Village
Fox, Terry Winnipeg
Kay, Guy Gavriel Winnipeg
Keith, Alexander Halifax
Mars, Bruno Honolulu
McLachlan, Sarah Halifax
Morissette, Alanis Ottawa
Obama, Barack Honolulu
Roy, Gabrielle Winnipeg
Sinatra, Frank Las Vegas
Look up the status
* Main Menu Exercise

2_2 CSE FORMULAS

What are we doing here?


Depending on your version of Excel, CSE formulas are top secret formulas
that you have to do a special key stroke in order to activate.
Or they're weird formulas that you create with the normal = method.
Either way, they are based on arrays, which I'm too scared to explain much.

This is amazing! What if I want to do more?


Google "CSE formulas Excel". There's tons of explanations out there!

How do I get started again?


This example is ready to go, just keep reading!
Once you think you understand, go do the hardest exercise yet!

* INSTRUCTIONS
Before going further, let's figure out if your version of Excel requires you to use a special key stroke to activate CSE for
Look here ----------------> $36.61

If you see "$4.00" or if you click on C21 and see curly brackets {} in the formula bar,
you must type in your formula, then press Ctrl-Shift-Enter to activate your CSE formulas.
You will notice curly brackes appear in the formula bar. You can't make a CSE formula work correctly by typing in the

If you see "$36.41", you can use the normal = method to create CSE formulas. You won't see curly brackets in the for
Doing Ctrl-Shift-Enter should also work and will make curly brackets appear in the formula bar. Don't type these brack
But I recommend just entering formulas using = as normal.

In either case, the "*" symbol between CSE instances tends to work as an "AND".
The "+" symbol between CSE instances tends to work as an "OR" but you must be ready to throw down some "If" in y

Because most people are familiar with the SUM formula, I used these for my examples, but among other tricks,
CSE formulas can be used to add "IF" logic to formulas that don't already have that component. See section 2_5 for m
In the first example, we're getting the SUM function to give us the grand total of the sum of quantities multiplied by u
In the second example, we're getting the number of vehicles that are red cars. Change the criteria and you should stil
In more recent versions of excel, we could have used =sumIFs to find red cars, but not red or yellow vehicles.

* Simple CSE formula (no multiplying or adding arrays)

* Grocerly list with quantities and unit prices


Grocery list Quantities Unit Price
Ground beef 2 10.25 $
Potatoes 16 0.25 $
Maple Syrup 1 8.95 $
Apples 4 0.79 $

* CSE formulas
Formula version Active formula Formula text
Entered normally $36.61 =SUM($C$44:$C$47*$D$44:$D$47)
Ctrl-Shift-Enter $36.61 {=SUM($C$44:$C$47*$D$44:$D$47)}

* Complex CSE formula (multiplying arrays)

* Vehicle list with color, vehicle, and total count


Color Vehicle Total
Red Trucks 2
Red Cars 3
Yellow Cars 1
Blue Bicycles 6
Yellow Bicycles 2
Red Cars 4

* CSE formulas
Formula version Active formula Formula text
Red car [normal] 7 =SUM(($B$58:$B$63=F58)*($C$58:$C$63=F61)*($D$58:$D
Red car [CSE] 7 {=SUM(($B$58:$B$63=F58)*($C$58:$C$63=F61)*($D$58:$D

* Complex CSE formula (adding arrays)

* Vehicle list with color, vehicle, and total count


Color Vehicle Total
Red Trucks 2
Red Cars 3
Yellow Cars 1
Blue Bicycles 6
Yellow Bicycles 2
Red Cars 4

* CSE formulas
Formula version Active formula Formula text
Red or yellow [normal] 12 =SUM((($B$74:$B$79=F$74)+($B$74:$B$79=F$77))*($D$74
Red or yellow [CSE] 12 {=SUM((($B$74:$B$79=F$74)+($B$74:$B$79=F$77))*($D$7
pecial key stroke to activate CSE formulas.

ula work correctly by typing in the curly brackets manually.

won't see curly brackets in the formula bar.


ormula bar. Don't type these brackets in manually.

eady to throw down some "If" in your formula.

ples, but among other tricks,


component. See section 2_5 for more on IF formulas.
e sum of quantities multiplied by unit price.
nge the criteria and you should still get the right result.
not red or yellow vehicles.
$44:$D$47)}

Criteria
Color to add
Red

Vehicle to add
Cars

8)*($C$58:$C$63=F61)*($D$58:$D$63))
58)*($C$58:$C$63=F61)*($D$58:$D$63))}

Criteria
Color to add
Red

Other color to add


Yellow

$74)+($B$74:$B$79=F$77))*($D$74:$D$79))
$74)+($B$74:$B$79=F$77))*($D$74:$D$79))}
* Main Menu Instructions

* CSE FORMULA EXERCISE


There's no "PercentileIf" function in Excel. Let's create our own in column G!
This is a REALLY hard exercise, so hopefully you'll be able to do it.
You DO need to use "If" in order to get it to work, so you might want to read Excel's help about the If function or look a
Remember that if you don't have the latest version of Excel, you will need to use Control-Shift-Enter to activate the form

The Percentile.Inc function takes two arguments, it wants to know where the data is, and then it wants "k" which is a n
If you put k = 0, it will give you the lowest value found. If you put k = 1, it will give you the biggest value found.

Adapt the Percentile function so that it will give you the result for the city of your choice.
The city is in F19 and the centile/k is in G19. Test by checking the lowest (0) and highest values (1) for each city.

If you can't do it, I've hidden the answer in cell H43. But first, try a simple version of the percentile function and then ad

* Table of precipitation by city by date


Date City Precipitation (mm)
April 21 Ottawa 46
Vancouver 23
Moncton 2
Montreal 42
Fredericton 0
April 22 Ottawa 18
Vancouver 25
Moncton 5
Montreal 16
Fredericton 0
April 23 Ottawa 55
Vancouver 120
Moncton 8
Montreal 44
Fredericton 5
April 24 Ottawa 0
Vancouver 56
Moncton 0
Montreal 0
Fredericton 0
April 25 Ottawa 20
Vancouver 86
Moncton 4
Montreal 18
Fredericton 4
cel's help about the If function or look at section 2_5.
e Control-Shift-Enter to activate the formula.

ata is, and then it wants "k" which is a number between 0 and 1.
ve you the biggest value found.

d highest values (1) for each city.

n of the percentile function and then add complexity!

Find the percentile for a city of your choice


City Centile K CSE Percentile Formula
Ottawa 1

=PERCENTILE.INC(IF($C$18:$C$42=F18,$D$18:$D$42),G18)
2=F18,$D$18:$D$42),G18)
* Main Menu Exercise

2_3 SELECT WITH CRITERIA

What are we doing here?


You're going to love this. It's simple and easy to do.
We're simply going to select cells according to certain criteria,
by using Excel's very own menus!

The most useful applications I've found is getting to formulas quickly


(yes, I know about displaying formulas instead of results in the formula menu),
and finding empty cells.

This is amazing! What if I want to do more?


There are other ways of doing the same thing.
You can do cool stuff with macros of course,
and also by being really good at using find/replace…

How do I get started again?


Hit "Find blanks" to see a demonstration of what selecting with criteria can do!
If you need a reset, copy-paste from the bottom of this worksheet.
Once you think you understand, go do the most fun exercise!

* INSTRUCTIONS
Either select a range of cells in which to search, or just don't do anything special to search the entire worksheet.
Go to "Find & Select" in the "Editing" section of the "Home" ribbon and click on "Go To Special". Alternatively, press F5

You will be able to select cells according to a specific criteria. Select a criteria and click on "Ok".
Use "Enter" to quickly go from one cell to another.
When cells are all selected like that, you can also apply some formatting to all cells at once if you'd like to do so.
When you're finished, just click anywhere on the worksheet to un-select the cells. See? I wasn't kidding, this is really e

In my example, we're selecting all empty cells in range E38 to G43, and then formatting them a bit differently to revea

* Selecting blank cells example - Draw a happy face :)


Select cells E41 to I46. Go to Home - Editing section - Find & Select - Go to Special.
Click on "Blanks" and then "Ok". Use the fill tool in the font section of the home ribbon
to apply a background color.

1 2 3 4 5
6 8 10
11 12 13 14 15
17 18 19
21 25
26 27 28 29 30
* RESET EXAMPLE

Select cells E50 to I55. Copy. 1 2 3 4 5


Click on cell E41. Paste. 6 8 10
11 12 13 14 15
17 18 19
21 25
26 27 28 29 30
earch the entire worksheet.
To Special". Alternatively, press F5. Click on "Special".

t once if you'd like to do so.


ee? I wasn't kidding, this is really easy!

tting them a bit differently to reveal the hidden smiley face!


* SELECT WITH CRITERIA EXERCISE
Find all the cells with formulas in rows 8 to 14. Practice navigating from one formula to another, and then apply formatti
Formulas pop out. You want the hidden message to be revealed even when the cells are no longer selected.

* Formulas are hidden below


* * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * *
r, and then apply formatting to make the cells with
ger selected.

* * * * * * * * * * *
* * * * * * * * * * *
* * * * * * * * * * *
* * * * * * * * * * *
* * * * * * * * * * *
* * * * * * * * * * *
* * * * * * * * * * *
* Main Menu Exercise

2_4 FIND/REPLACE TRICKS

What are we doing here?


You're getting kind of tired, aren't you?
Let's keep it very simple for now. We're… mostly going to look at
some Find/Replace options. You can find text… and replace it with other text.

This is amazing! What if I want to do more?


Try out the options that I haven't covered.
Google "find replace in Excel" to find a few tricks. And "Excel wildcards".
How do I get started again?

Just read the instructions, then go do the exercise.

* INSTRUCTIONS
You can access find/replace by using the Ctrl-F or Command-F shortcut key, and then clicking on the "replace" tab.
Alternatively, you can click on "Find and select" in the "Edition" section of the "Home" ribbon, and then select "Replac
Or with a Mac, look at your special editing menu above Excel.

Put in what you want to find in the first text box, and put in what you want to replace it with in the second text box.
Click on options... to get more options.

An interesting but tricky tip is using find/replace to quickly highlight cells that have specific text.
Just click on the "format" button in the "replace by" section, don't input anything in the "replace by" box, and you're f
containing the text you're searching for in any way you'd like!
To stop the behavior, click on the "Format" dropdown and select "Clear Replace Format".

You can often clean up data by searching with exact match for cells containing only a space and replacing that with no
(Although there are also formulas that serve a similar function.)

You can use * as a wildcard, or ? as a wildcard that only finds one character.
Use the tilde ~ to search for the symbols * or ? somewhere in your cells.

You can do find/replace for an entire worksheet, for an entire Excel file or only in a specified range of cells.

* I think that you can go straight to the exercise!


and then clicking on the "replace" tab.
he "Home" ribbon, and then select "Replace".

to replace it with in the second text box.

at have specific text.


thing in the "replace by" box, and you're free to format the cells

lace Format".

ng only a space and replacing that with nothing at all.

nly in a specified range of cells.


* Main Menu Instructions

* FIND/REPLACE TRICKS EXERCISE


1 - Using the color of your choice, quickly highlight all cells that have a smiley face. That should be a total of 14 cells.
2 - Count the number of cells in this worksheet that contain the word face. The answer should be 3 (or 5 if you count in
3 - Count the number of cells that contain the letter "e". The answer should be 11 if you only looked at the below text,

* List to use to practice find/replace tricks


I have a smiley face :) I have a frowny face :( :) yay yay
It's cold :( I won the lottery :) I had to work late. :/
I love chocolate :) I like cake :) I don't like ants :(
Smiley faces scare me :( I'm having fun today :) :) :) :) :) :) :) :)
You wouldn't find any of
I'm helping people with
I'm not feeling excellent :( these cells with an exact
Excel :)
match :(
ce. That should be a total of 14 cells.
answer should be 3 (or 5 if you count instances in this section)
11 if you only looked at the below text, 17 if you looked at the entire worksheet.
* Main Menu Exercise

2_5 OR, AND, and IF

What are we doing here?


We're looking at some logic formulas.
IF which lets you return what you want according to a criteria.
AND which checks if one or more criteria are all true.
OR which checks if at least one criteria is true.

This is amazing! What if I want to do more?


I don't know? Maybe look up boolean operators?
A lot of what we do here is boolean logic.
And definitely look up TRIM, and UPPER and LOWER.

How do I get started again?


This example is ready to go, just keep reading!
If you need a reset, copy-paste the table at the bottom of this worksheet
Once you think you understand, go do the exercise!

* INSTRUCTIONS
The IF formula takes a criteria, usually in the form of a comparison such as if a cell is equal, or bigger, or smaller than a g
The next two arguments are optional but I recommend always entering them. They let you decide what is returned by th
A value if the criteria is true, or a value if the criteria is false.

The AND and OR formulas return "True" or "False".


The AND formula requires that ALL criteria be met in order for the formula to return "TRUE".
The OR formula requires that at least one of the criteria be met in order for the formula to return "TRUE".

You can have the IF formula return a blank by entering "" as the value if true or false,
and a number like 0 or 1 by simply putting in the number without quotation marks.
And you can use an AND or OR formula within an IF formula.

* Scariness table and criteria

* Simple IF example
Let's flag all the cases where the scariness is 5 or more.

Scariness
Horror source Nature (out of 10) Amount Distance (km)
Bermuda Triangle Phenomenon 5 1 2,290
Vampires Monster 4 0 10
Zombies Monster 9 0 10
Germs Natural 5 100,000,000 1
Unfulfillment Philosophical 10 0 0
Noises Phenomenon 1 12 0
Loch Ness Monster Monster 3 1 4,218

It might be best to assign a cell for the criteria - what if we change our minds about how much scariness we can tolerate
Scariness criteria 5 <- Try changing this number and see what happens in the "Sim

Scariness
Horror source Nature (out of 10) Amount Distance (km)
Bermuda Triangle Phenomenon 5 1 2,290
Vampires Monster 4 0 10
Zombies Monster 9 0 10
Germs Natural 5 100,000,000 1
Unfulfillment Philosophical 10 0 0
Noises Phenomenon 1 12 0
Loch Ness Monster Monster 3 1 4,218

AND example
Let's flag all the cases where the scariness is 5 or more and the threat is within 10 KM
Scariness criteria 5 Distance 10

Scariness
Horror source Nature (out of 10) Amount Distance (km)
Bermuda Triangle Phenomenon 5 1 2,290
Vampires Monster 4 0 10
Zombies Monster 9 0 10
Germs Natural 5 100,000,000 1
Unfulfillment Philosophical 10 0 0
Noises Phenomenon 1 12 0
Loch Ness Monster Monster 3 1 4,218

OR example
Let's flag all the cases where the scariness is 5 or more or the threat is within 10 KM
Scariness criteria 5 Distance 10

Scariness
Horror source Nature (out of 10) Amount Distance (km)
Bermuda Triangle Phenomenon 5 1 2,290
Vampires Monster 4 0 10
Zombies Monster 9 0 10
Germs Natural 5 100,000,000 1
Unfulfillment Philosophical 10 0 0
Noises Phenomenon 1 12 0
Loch Ness Monster Monster 3 1 4,218

IF and AND example


Let's flag all the cases where the scariness is 5 or more and the threat is within 10 KM
Scariness criteria 5 Distance 10

Scariness
Horror source Nature (out of 10) Amount Distance (km)
Bermuda Triangle Phenomenon 5 1 2,290
Vampires Monster 4 0 10
Zombies Monster 9 0 10
Germs Natural 5 100,000,000 1
Unfulfillment Philosophical 10 0 0
Noises Phenomenon 1 12 0
Loch Ness Monster Monster 3 1 4,218
r bigger, or smaller than a given value.
ecide what is returned by the IF formula.

eturn "TRUE".

Formulas

Simple IF formula
I AM CONCERNED =IF(D41>=5,"I AM CONCERNED", "NOTHING TO SEE HERE")
NOTHING TO SEE HERE
I AM CONCERNED
I AM CONCERNED
I AM CONCERNED
NOTHING TO SEE HERE
NOTHING TO SEE HERE

h scariness we can tolerate?


ee what happens in the "Simple worry" column of the below table.

Simple IF formula with a


cell address for the
criteria
I AM CONCERNED =IF(D53>=$C$50,"I AM CONCERNED", "Nothing to see here")
Nothing to see here
I AM CONCERNED
I AM CONCERNED
I AM CONCERNED
Nothing to see here
Nothing to see here

AND formula - True


means we are worried
0 =AND(D66>=$C$63,F66<=$F$63)
FALSE
TRUE
TRUE
TRUE
FALSE
FALSE

OR formula - True means


we are worried
1 =OR(D79>=$C$76,F79<=$F$76)
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
IF and AND formula
This is fine! =IF(AND(D92>=$C$89,F92<=$F$89),"I AM CONCERNED","This is fine!")
This is fine!
I AM CONCERNED
I AM CONCERNED
I AM CONCERNED
This is fine!
This is fine!
* Main Menu Instructions

* IF, AND, and OR EXERCISE


You are worried about the various threats that surround you at all times.
Use a combination of the IF and AND formulas to flag cases with "BE VERY WORRIED" in column H (Big Worry)
where the scariness is at least 5, the amount of a thing is at least 1, and the distance is 10 or lower.

Then, flag cases with "Maybe worry" in column I (Small Worry) where the scariness is at least 8,
or where the amount is higher or equal to 50, or the distance is 10 or lower.
* Criteria

Scariness of at least Amount of at least


Big worry 5 and 1
Small worry 8 or 50

* Table of threats
Scariness (out of
Horror source Nature 10) Amount
Bermuda Triangle Phenomenon 5 1
Vampires Monster 4 0
Zombies Monster 9 0
Germs Natural 5 100,000,000
Unfulfillment Philosophical 10 0
Noises Phenomenon 1 12
Loch Ness Monster Monster 3 1
olumn H (Big Worry)

Distance of no
more than
and 10
or 10

Tables of worries by criteria

Distance (km) Big Worry Small Worry


2,290
10 <-
10 <-
1 -> <-
0 <-
0 <-
4,218
* Main Menu

2_6 COUNTA

What are we doing here?


We're going to take a look at CountA.
It counts the number of non-blank value. So easy! No need to even practice!

This is amazing! What if I want to do more?


Google countA, I guess? Or look at the different kinds of counts.

How do I get started again?


This example is ready to go, just keep reading!

* INSTRUCTIONS
CountA just counts the number of non-blanks. That's it. Short and sweet! Great for data quality control.

* CountA example
I have Two blanks Everything
is good
a blank no blanks
four rows Three rows Five rows
with data with data with data

=COUNTA(B20:B24) =COUNTA(C20:C24) =COUNTA(D20:D24)


4 3 5

* SUPPLEMENTARY INFORMATION

* Spaces

If CountA is returning a number higher than you were expecting, it could be that one of the cells contains a space inste
Try using find/replace (see 2_4) and matching the whole cell content to find spaces and replacing them with nothing.

There is

a space in B37
so it's counting
5 non-blank rows

=COUNTA(B36:B40)
5
data quality control.

ne of the cells contains a space instead of a blank.


and replacing them with nothing.
Main Menu

Need more help?


You could try contacting me! I'm always happy to help with Excel questions.

As of 2024 you can reach me:


By email [email protected]

More self-teaching Excel files?


http://dal.ca.libguides.com/data/excel

You might also like