Microsoft+Excel+Comprehensive+ +Course+Outline+ +Todd+McLeod
Microsoft+Excel+Comprehensive+ +Course+Outline+ +Todd+McLeod
Getting started 9
Introduction 9
Exercise files 9
Getting your certificate 9
Course orientation 10
Understanding spreadsheets 10
Understanding versions 10
Personalization 11
Accessibility 11
Course outline 12
File extensions and open with 12
Course files 13
Hands-on exercises #1 13
#1 - Quiz 13
Quiz review 13
#2 - Your computer's word size 14
Writing formulas 14
Introduction 14
Workbooks and worksheets 15
Useful keyboard shortcuts 15
Working with Excel files 15
Autosave and autorecover 16
Finding your way around Excel 16
Mouse pointer awareness 17
Writing formulas 17
Relative, absolute, & mixed references 18
Ranges & names 18
Hands-on exercises #2 18
#3 - Quiz 18
Quiz review 18
#4 - Data entry 27
#5 - Adjusting views 27
#6 - Quick average, count, sum 28
#7 - Relative references 28
#8 - Absolute references 28
#9 - Mixed references 28
Todd McLeod,1
#10 - Gradebook equal weighting 28
#11 - Gradebook weighted 29
#12 - Gradebook points method 29
#13 - Trip budget 29
#14 - Cookie recipe 29
Functions 29
Sum & average 29
Max, min, documentation 30
Count, countif 30
Round, roundup, rounddown 30
Rand & randbetween 30
Concat & textjoin 30
Days & now 30
If 31
Hands-on exercises #3 31
#15 - Quiz 31
Quiz review 31
#16 - Basic functions - part 1 32
#16 - Basic functions - part 2 33
#16 - Basic functions - part 3 33
#17 - Random names - part 1 33
#17 - Random names - part 2 34
#18 - If 35
#19 - Documentation examples 35
Popular Excel functions 35
Top 10 35
Striping rows 38
Drop down menu 38
Xlookup 38
Vlookup 39
Gradebook with xlookup, vlookup, & curve 39
Xmatch 39
Choose 40
Date, year, month, day, left, mid, right, edate, datedif 40
Find & findb 41
Index 42
Hands-on exercises #4 42
#20 - Quiz 42
Quiz review 42
#21 - Secret message 43
#22 - Date exercises 44
Todd McLeod,2
#23 - Time exercises 44
#24 - Conditional formatting - stripe rows 44
#25 - Conditional formatting - sandbox 44
#26 - Data validation - number and text 44
#27 - Data validation - drop-down menu 44
#28 - Xlookup - life expectancy 45
#29 - Xlookup gradebook 45
#30 - Find peace 45
#31 - Gapminder 45
Introduction to formatting 45
Introduction 45
Font 46
Clear formats 46
Format painter 46
Cut, copy, paste 46
Alignment 47
Inserting & deleting cells, rows, and columns 47
Format cells dialog box 47
Number formats 47
Custom fonts 48
Hands-on exercises #5 48
#32 - Quiz 48
Quiz review 48
#33 - Copy data from wikipedia 50
#34 - Get data from gapminder 50
#35 - Number formatting 50
#36 - Alignment 51
#37 - Font formatting 51
#38 - Fill and border 51
#39 - Clearing formatting 51
#40 - Spreadsheet formatting 51
#41 - Transpose data 52
#42 - Adjust height & width 52
#43 - Link, text box, note, comment, indent 52
#44 - congrats, reviewing keyboard shortcuts, & some new stuff 52
#44 - review continued 55
*** *** *** INTERMEDIATE EXCEL *** *** *** 55
Working with Data 55
Acquiring data 55
Previewing data generators 55
Generating data - Hawaii Shoe Company - step #1 55
Todd McLeod,3
Generating data - Hawaii Shoe Company - step #2 56
Generating data - Hawaii Shoe Company - step #3 56
Generating data - Hawaii Shoe Company - step #4 56
Generating data - Outdoor Gear Coop - exploration #1 56
Generating data - Outdoor Gear Coop - exploration #2 56
Generating data - names - exploration #1 56
Freeze panes 56
Sort 57
Filter 57
Advanced filter 57
Filter function 57
Find & replace 57
Hands-on exercises #6 57
#45 - Hawaii shoe company generator 57
#46 - Outdoor gear generator 58
#47 - Name generator 58
#48 - Birth name data 58
#49 - Birth name data #2 58
#50 - jeopardy questions filter 59
#51 - jeopardy questions advanced filter 59
#52 - outdoor gear advanced filter 59
#53 - filter & freeze panes data 60
#54 - copy data from web, freeze frame, sort, filter 60
#55 - replace data 60
#56 - filter data using OR 60
Progressing with data 60
Flash fill 60
Remove duplicates 61
Consolidate 61
Trace precedents 61
What if - sensitivity analysis - goal seek 61
What if - sensitivity analysis - data table 61
What if - sensitivity analysis - scenario 62
Forecasts 62
Hands-on exercises #7 62
#57 - consolidate 62
#58 - goal seek 62
#59 - remove duplicates 63
#60 - scenarios 63
#61 - data table 63
#62 - relative, absolute, mixed references 63
Todd McLeod,4
#63 - forecast 63
Displaying data 64
Group 64
Visually representing data 64
Chart creation 65
Chart creation II 65
Chart formatting 65
Chart formatting II 66
Chart sparklines 66
Combo chart 66
Chart trendlines 66
Hands-on exercises #8 67
#64 - Line chart and trendline 67
#65 - sparklines 67
#66 - combo charts 67
#67 - subtotal 67
#68 - graph data 67
Viewing & printing 68
Split, hide, and unhide a worksheet window 68
Multiple windows 68
Printing your worksheet 68
Custom views 69
Insert pictures, illustrations, equations, symbols 69
Selection pane 69
Translating 70
Proofing 70
Protecting (locking) workbooks, sheets, and cells 70
Object linking & embedding (OLE) 70
Hands-on exercises #9 71
#69 - custom views 71
#70 - conditional formatting 71
#71 - selection pane and stacking order 72
#72 - protect a workbook and worksheets 72
#73 - Arrange windows 72
#74 - print a worksheet to a pdf 73
*** *** *** ADVANCED EXCEL *** *** *** 73
Pivot tables 73
Pivoting your data 73
Grouping in pivot tables 74
Refreshing pivot tables 74
Slicers and timeline - filtering pivot tables 75
Todd McLeod,5
Pivot charts 75
Hands-on exercises #10 76
#75 - create pivot tables 76
#76 - manually group fields 76
#77 - slicers and timeline 76
#78 - pivot chart, slicer, and timeline 77
Odds and ends 78
Styles and themes 78
Word art, align, rotate, group, and signatures 78
Working with names 78
Different error types 79
Working with errors 79
Watch and calculation options 79
Stats, accessibility, smart lookup, hide ink 80
Help ribbon odds and ends 80
Get and transform data with power query 80
Introduction 80
Get & transform steps 81
Power query editor example 1 82
Power query editor example 2 82
Split by delimiter 85
Replace 85
Extract 85
Format 86
Pivot & unpivot with power query 86
Data from the web and data types 86
Creating our own data type & refresh 87
Power query editor - home ribbon 87
Power query editor - transform ribbon 87
Data generator 88
Hands-on exercises #11 88
#79 - separating data 88
#80 - get and transform surfer first names 88
#81 - get and transform surfer last names 88
#82 - pivot & unpivot 89
#83 - transform data 89
#84 - conditional column 89
#85 - explore documentation 89
Data model 90
Understanding relational data 90
An overview of the data model 90
Todd McLeod,6
Add tables to the data model 90
Creating relationships 91
Pivot tables and pivot charts 91
Using functions in the data model's power pivot 91
Writing a measure 91
Hands-on exercises #12 92
#86 - data model #1 92
#87 - data model #2 93
Working with 1,048,576+ records 93
Excel's limitations 93
Connecting to data and appending data 93
Data model operations 94
Data joins - append & join / merge 94
Append data 94
Data joins - Left outer join 94
Data joins - right outer join 95
Data joins - full outer join 96
Data joins - inner join 97
Data joins - left anti join 97
Data joins - right anti join 98
Hands-on exercises #13 98
#88 - append data 98
#89 - append data update 99
#90 - outer joins and inner join 99
#91 - anti-joins 99
3-D maps 99
Introduction 99
3D maps and America's energy story 100
Creating scenes with 3D maps 100
Hands-on exercises #14 100
#92 - 3-D map Europe's population 100
#93 - 3-D map America's energy story 101
Creating macros 101
Understanding macros 101
Recording a macro 102
Recording a prank 102
Relative vs absolute reference macros 102
Hands-on exercises #15 103
#94 - remove data with a macro 103
#95 - clean up data 103
*** *** PROGRAMMING EXCEL WITH VBA *** *** 104
Todd McLeod,7
VBA basics 104
Introduction 104
Orientation to VBA 104
Playing in the immediate window 105
Recording a macro 106
Deleting a macro from the personal workbook 106
The benefits of editing code 107
Debugging code 107
Hands-on exercises #16 107
#96 - record two macros 107
#97 - record a formatting macro 108
Getting started with coding 108
Coding concepts 108
Selecting objects 109
Adjusting object properties 109
With statement 110
Documentation #1 - embarking on an adventure 111
Documentation #2 - getting started with vba 111
Documentation #3 - the object model 112
Documentation #4 - exploring excel's object model 112
Hands-on exercises #17 113
#98 - modify worksheet name 113
#99 - modify a region 113
#100 - documentation 114
Coding fundamentals 114
Variables 114
Working with variables 114
Calling code 116
For loops 116
Conditional statements - if, select 117
Hands-on exercises #18 119
#101 - coding math 119
#102 - using a for loop 120
#103 - using conditional logic 120
#104 - calling code 121
Useful tools 121
Message box 121
Input box 122
Types of message boxes 122
Hands-on exercises #19 123
#105 - message box 123
Todd McLeod,8
#106 - input box 123
#107 - yes no cancel box 125
User defined functions 125
Easy steps 125
Hands-on exercises #20 127
#108 - user defined function 127
Congratulations 127
Great work! 127
Bonus lecture 128
Getting started
Introduction
Here is a brief overview of what we will cover in this section:
● Introduction
● Exercise files
● Getting your certificate
● Course orientation
● Understanding spreadsheets
● Understanding versions
● Personalization
● Accessibility
● Course files
video: 001 preview
Exercise files
Any file, or files, that I use in a video can be found in the "COURSE CONTENT" panel of the
video in which those files are used. You can also access ALL of the files used in the course by
going to the COURSE FILES area of the GETTING STARTED section.
● If you try to download more than one file at a time, your web browser might ask you if
you want to "download multiple files from this website." Click "yes" to download the files.
video: 002 preview
Todd McLeod,9
Course orientation
● Learning pace
○ change video speed
● This is your course
○ do what you need
○ use it in the way that is best for you
○ quizzes and hands-on exercises are optional
● Course goal
○ a great teacher will teach the student not to need the teacher
○ parable: give a person a fish, or teach them to fish
● Be an adventurer
○ spirit of exploration
● Practice
○ practice leads to progress
● Have fun
○ personal anecdotes
video: 004 preview
Understanding spreadsheets
● Spreadsheets allow us to work with numbers. Spreadsheets are like customizable
calculators. Spreadsheets also allow us to organize and manage data.
○ MS Word allows us to work with words.
○ MS Excel allows us to work with numbers & data.
● Dan Bricklin - father of spreadsheets (1979)
video: 005
Understanding versions
● there are two main versions of microsoft excel
○ WEB BASED
■ it runs on the web
■ you use a web browser to access it
○ COMPUTER BASED
Todd McLeod,10
■ you install it on your computer
■ the computer based version has more functionality than than the web
based version
● Historically, every few years, Microsoft would release a new version of Excel. With
Microsoft 365, versions are released continuously.
○ Microsoft 365 vs installed
■ web based app, software-as-servce, SAS vs. installed app, pc
■ Office 365 revenue overtook traditional license sales for Office in 2017.
● "Microsoft 4Q17: Office 365 revenue surpasses traditional licenses". Ars Technica. Condé Nast. July 21,
2017. Archived from the original on February 1, 2019. Retrieved February 6, 2019.
■ Microsoft 365 was formerly called Office 365
● microsoft 365
○ apps
○ benefits
■ one drive
■ editor (like grammarly)
■ stock photos / videos
■ fonts
■ partner benefits
■ live tech support
links:
● purchasing
○ costco
○ amazon
○ microsoft
● google drive
○ google's sas
○ google's apps
video: 006
Personalization
● installing
● starting excel
● customizing excel
○ changing look and feel
● coming soon features
● keyboard shortcuts
○ ctrl+f
■ find
video: 007 preview maybe
Accessibility
● closed captions
● ease of access settings in Windows
Todd McLeod,11
● microsoft store
○ powertoys
○ mouse pointer highlight
■ safety: app certification
anecdote: poem
video: 008
Course outline
● you can download the course outline as a PDF from here
● keyboard shortcuts
○ ctrl+f
■ find
● EDIT IN
● a few more notes that came up as I recorded the course (video: 09a)
○ excel notification: external data connections have been disabled (video: 09b)
○ OPEN WITH and finding EXCEL.EXE (video: 09c)
video: 009
Todd McLeod,12
Course files
● all files for the course can be found here
video: none
Hands-on exercises #1
#1 - Quiz
Quizzes help you learn the material more quickly. By taking this quiz, you are engaging your
mind. By working to recall the material, the material is more deeply integrated. Take this quiz to
more quickly learn!
video: none
Quiz review
● Any exercise files used in a video lecture are associated with that video lecture and can
be downloaded while you're watching that video lecture.
● You can find all of the files used in this course under the "course files" portion of the
"getting started" section.
● You can change the speed of the lecture videos.
● Who was the creator of spreadsheets:
○ Bill Gates
○ Bill The Cat
○ Dan Bricklin
○ Elon Musk
● When were spreadsheets created?
○ 1962
○ 1972
○ 1979
○ 1989
● Practice leads to progress.
● A good general description of spreadsheets is that they allow us to work with numbers
and data.
● The web version of Microsoft Excel is part of "Microsoft 365"
● When you subscribe to Microsoft 365, you can download a version of Microsoft Excel
that can be installed on your computer.
● At the time of recording, as talked about in the video lecture, who offered the best pricing
for Microsoft 365:
○ Microsoft
○ Amazon
Todd McLeod,13
○ Costco
○ Some guy named "Mikapalooza" on Reddit
● Microsoft Excel is
○ word processing software
○ spreadsheet software
○ database software
○ image editing software
● Microsoft word is to words, as Microsoft Excel is to numbers.
● To have his mouse highlighted, Todd is using:
○ graphic files installed on his machine
○ a piece of software from Microsoft store called "mouse pointer highlight"
○ some "autohotkey" software
○ computer magic
● To make Excel more readable, you can change it to a high-contrast black and white
theme.
video: 11
Writing formulas
Introduction
video 13
Todd McLeod,14
Workbooks and worksheets
A workbook has worksheets. When you open a Microsoft Excel file you are opening a
workbook. Inside that workbook you will find worksheets. You can add and delete
worksheets as needed. Here is what we will learn:
● Starting Excel
○ workbook
○ worksheet
■ columns
■ rows
■ cells
■ active cell
● keyboard shortcuts
○ ctrl + scroll wheel
■ zoom
file: 14-books-sheets.xlsx
video: 14
Todd McLeod,15
○ associate "xlsx" files with Excel
● keyboard shortcuts
○ ctrl + s
■ save
○ ctrl + w
■ closing
○ ctrl + n
■ new
○ ctrl + o
■ open
file: 16-books-sheets.xlsx
video: 16
Todd McLeod,16
■ you can edit data in a cell by
● double-clicking the cell
● or up in the formula bar
■ cells overflow if there is no data in the adjacent cell
■ #######
● shows that there is data in that cell
○ widen the column to see it
● double-click the divider to perfectly adjust
○ you can make columns wider
○ you can make rows taller
● RIBBON MENUS
○ showing / hiding
● VIEW / SHOW
○ gridlines
○ headings
○ formula bar
● VIEW / WORKBOOK VIEWS
○ normal
○ page break preview
○ page layout
● PAGE LAYOUT / PAGE SETUP
○ print
■ gridlines
■ headings
● STATUS BAR
○ average
○ count
○ sum
file: 18-Finding-Your-Way-Around-Excel.xlsx
video: 18
Writing formulas
Learn the basics of writing formulas in Excel including the point-and-click method for writing
formulas.
● writing formulas
○ =
Todd McLeod,17
○ ‘=
● point-and-click method
● order of operations
● relative references
● formula ribbon
○ show formulas
● shortcut
○ ctrl + `
■ show formulas
file: 20-Writing-Formulas
video: 20
Hands-on exercises #2
#3 - Quiz
Quizzes help you learn the material more quickly. By taking this quiz, you are engaging your
mind. By working to recall the material, the material is more deeply integrated. Take this quiz to
more quickly learn!
video: none
Quiz review
The area highlighted in red is known as a …
Todd McLeod,18
● row
● column
● cell
● formula
Todd McLeod,19
The intersection of a row and a column is a ...
● row
● column
● cell
● rare event
Todd McLeod,20
The address of the highlighted cell is ...
● D6
● C6
● B6
● E6
Todd McLeod,21
This area is known as the ...
● control center
● options arena
● ribbon
● choice panel
Todd McLeod,22
The area highlighted in red is known as the ...
● data entry box
● login field
● formula bar
Todd McLeod,23
The area highlighted in red is known as a ...
● workbook tab
● worksheet tab
● thumbnail
Todd McLeod,24
The area highlighted in red allows you to ...
● scroll left & right through a single spreadsheet
● scroll left & right through spreadsheet tabs
● move the active cell over one cell
Todd McLeod,25
All formulas in Excel begin with which operator
● -->
● =
● /
● formulas are enclosed in {}
To use the "point-and-click" method to write a formula, just click on whichever cell you want to
enter for a reference.
● True
● False
You can see all of the formulas on a worksheet by going to the "formula" ribbon and then
choose "show formulas"
● True
● False
Todd McLeod,26
This formula "=(B9+B10)*$F14" uses
● only relative references
● has an absolute reference
● has a mixed reference
#4 - Data entry
Create a new excel spreadsheet. Do the following:
● create a new worksheet
○ name it “Happy items”
○ give the worksheet tab a color
○ move the worksheet tab to the front of the tabs
● starting in cell B2
○ list five items that make you happy
■ one item in each cell: B2, B3, B4, B5, B6
● Delete the other worksheets
○ right-click the worksheets
● edit the entry in cell B3
○ use the double-click method
● edit the entry in cell B4
○ use the formula bar
file: 24-mcleod-five-happy-things
video: 24
#5 - Adjusting views
Create a new workbook. Do the following:
● view ribbon
○ make sure you are using normal view
■ cycle between
● normal view
● page layout
● page break preview
○ toggle gridlines & headings
● page layout ribbon / page setup dialogue box
○ for printing
■ show gridlines
■ show row and column headings
● collapse the ribbon menu
○ pin the ribbon menu back into place
Todd McLeod,27
file: 25-view-gridlines
video: 25
#7 - Relative references
Open the workbook attached to this lecture. Write a formula which adds up B4:B7. Use relative
references in your formula. Use the autofill handle to copy that formula across B8:M8
file: 27-relative-references
video: 27
#8 - Absolute references
Open the workbook attached to this lecture. Write a formula which calculates the tax. Use an
absolute reference. Use autofill to copy the formula over as applicable.
file: 28-absolute-references
video: 28
#9 - Mixed references
Open the workbook attached to this lecture. Write a formula to fill in each table. Use mixed
references. Use autofill to copy the formula.
file: 29-mixed-references
video: 29
Todd McLeod,28
#11 - Gradebook weighted
● Calculate the grade for each student. Each graded item does not carry equal weight.
To calculate the grade for each student, you will need to do a weight average
calculation.
● Calculate the class average for each graded item.
file: 31-gradebook-weighted
video: 31
Functions
Todd McLeod,29
file: 35-func-sum
video: 35-func-sum
Count, countif
The count function allows you to count how many items are in a series.
● count
● countif
file: 37-func-count
video: 37-func-count
Todd McLeod,30
● now
file: 41-func-days
video: 41-func-days
If
The if function allows you to make a decision based upon the value in a cell.
file: 42-func-if
video: 42-func-if
Hands-on exercises #3
#15 - Quiz
Quizzes help you learn the material more quickly. By taking this quiz, you are engaging your
mind. By working to recall the material, the material is more deeply integrated. Take this quiz to
more quickly learn!
video: none
Quiz review
● Concatenate is a deprecated function.
● Textjoin allows you to specify a delimiter.
● On the data ribbon, "text to columns" allows you to break text apart either by a delimiter
or by a fixed width.
● Examples of how to use a function can be found in the documentation for Excel
functions.
● What is the keyboard shortcut for moving the ACTIVE CELL to the end of contiguous
entries?
○ ctrl + shift + e
○ ctrl + arrow (down, up, left, or right)
○ ctrl + shift + y
○ ctrl + shift + end
● What is the keyboard shortcut for selecting data from the ACTIVE CELL to other cells?
○ ctrl + shift + e
○ ctrl + shift + arrow (down, up, left, or right) OR shift + arrow (down, up, left, or
right)
○ ctrl + shift + y
○ ctrl + shift + end
● What keyboard technique do we use to select non-contiguous data like in the picture?
○ hold down the CTRL key and select data
○ hold down the FN key and select data
○ hold down FN + TAB and select data
Todd McLeod,31
○ use the scroll wheel and meow like a cat
● Using only the keyboard, from the active cell, how do you select the active cell and the
two cells to the right?
○ shift + right-arrow key
○ ctrl + right-arrow key
○ fn + shift + right-arrow key
○ fn + shift + ctrl + windows key + f12 + f1 + right-arrow key
video: 43-quiz-review
Todd McLeod,32
#16 - Basic functions - part 2
Use the following functions in the spreadsheet "44-basic":
● sum
● average
● max
● min
● count
● counta
● countif
● roundup
● rounddown
file: 44-basic
video: 45-basic
Todd McLeod,33
■ 1 column last names
○ use these functions
■ COUNTA
■ RANDBETWEEN
■ INDEX
2. REGULAR CHALLENGE
○ into new spreadsheet
■ select the names
■ COPY / PASTE / VALUES
○ split the names
■ DATA / TEXT TO COLUMNS
○ combine the names
■ TEXTJOIN
file: 47-random-names
video: 47-random-names
Todd McLeod,34
file: 47-random-names
video: 48-random-names
#18 - If
Using the if function, display whether or not an individual is OVER or UNDER budget
file: 49-random-IF
video: 49-random-IF
Top 10
● SUM function
○ Use this function to add the values in cells.
● IF function
○ Use this function to return one value if a condition is true and another value if it's
false. Here's a video about using the IF function.
● LOOKUP function
○ Use this function when you need to look in a single row or column and find a
value from the same position in a second row or column.
○ AVOID using this one!
Todd McLeod,35
○
Todd McLeod,36
● VLOOKUP function
○ Use this function when you need to find things in a table or a range by row. For
example, look up an employee's last name by her employee number, or find her
phone number by looking up her last name (just like a telephone book).
● MATCH function
○ DON'T USE THIS ONE - USE XMATCH
○ The XMATCH function searches for a specified item in an array or range of cells,
and then returns the item's relative position.
● CHOOSE function
○ Use this function to select one of up to 254 values based on the index number.
For example, if value1 through value7 are the days of the week, CHOOSE
returns one of the days when a number between 1 and 7 is used as index_num.
○ interesting examples in documentation of combining functions
● DATE function
○ Use Excel's DATE function when you need to take three separate values and
combine them to form a date.
■ For example, you might have a worksheet that contains dates in a format
that Excel does not recognize, such as YYYYMMDD.
● DAYS function
○ Returns the number of days between two dates.
● FIND, FINDB functions
○ FIND and FINDB locate one text string within a second text string. They return
the number of the starting position of the first text string from the first character of
the second text string.
● INDEX function
○ Use this function to return a value from within a range / table / array.
video: 51-top-10
Todd McLeod,37
Striping rows
file: 52-XLOOKUP-STRIPES
video: 52-XLOOKUP-STRIPES
● https://support.microsoft.com/en-us/office/create-a-drop-down-list-7693307a-59ef-400a-
b769-c5402dce407b
file: 53-XLOOKUP-DROP-DOWN-MENU
video: 53-XLOOKUP-DROP-DOWN-MENU
Xlookup
Use the XLOOKUP function to find things in a table or range by row. For example, look up the
price of an automotive part by the part number, or find an employee name based on their
employee ID. With XLOOKUP, you can look in one column for a search term and return a result
from the same row in another column, regardless of which side the return column is on.
● Note: XLOOKUP is not available in Excel 2016 and Excel 2019, however, you may come
across a situation of using a workbook in Excel 2016 or Excel 2019 with the XLOOKUP
function in it created by someone else using a newer version of Excel.
Todd McLeod,38
● The XLOOKUP function searches a range or an array, and then returns the item
corresponding to the first match it finds. If no match exists, then XLOOKUP can return
the closest (approximate) match.
● =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode],
[search_mode])
file: 54-XLOOKUP
video: 54-XLOOKUP
Vlookup
Vlookup allows us to look a value up in a table of values, then return an associated value.
For instance, in a gradebook a student might have a score of 84%. I could use vlookup to then
insert “B” next to the student’s grade.
file: 55-VLOOKUP
video: 55-VLOOKUP
Xmatch
The XMATCH function searches for a specified item in an array or range of cells, and then
returns the item's relative position.
Todd McLeod,39
—
file: 57-xmatch
video: 57-xmatch
Choose
Use this function to select one of up to 254 values based on the index number.
file: 58-choose
video: 58-choose
Todd McLeod,40
■ For example, you might have a worksheet that contains dates in a format
that Excel does not recognize, such as YYYYMMDD.
file: 59-DATE
video: 59-DATE
Todd McLeod,41
file: 60-find
video: 60-find
Index
● returns a value from a table / range / array.
● returns a reference from a table / range / array.
file: 61-index
video: 61-index
Hands-on exercises #4
#20 - Quiz
Quizzes help you learn the material more quickly. By taking this quiz, you are engaging your
mind. By working to recall the material, the material is more deeply integrated. Take this quiz to
more quickly learn!
video: none
Quiz review
● To use Excel effectively, you must look up functions in documentation and read
about them.
● The function DATEDIF will accurately calculate the difference between dates.
● You should never use the DATEDIF function.
● You should strongly avoid using the LOOKUP function.
● When doing a "lookup," you should avoid using the LOOKUP function and instead use
the XLOOKUP function.
● If you're not familiar with the function you are going to use, you should read the
documentation for that function.
● If it has been awhile since you have skimmed the documentation on a function you
regularly use, it would be a good idea to look at it.
Todd McLeod,42
● To get to this dialog box:
Todd McLeod,43
file: 63-secret-message
video: 63-secret-message
Todd McLeod,44
● 69-life_expectancy_years.csv
video: 69-data-validation-drow-down-menu
#31 - Gapminder
Play with gapminder - very cool data and data visualization!
● https://www.gapminder.org/tools/
And check out the data:
● https://www.gapminder.org/data/
video: 73-gapminder
Introduction to formatting
Introduction
Formatting your worksheets is important.
● content and form
○ It is not only what you say that matters (the content) but also how you say it (the
form). When studied, the greatest impact upon others isn’t the content, but the
form. The 7 38 55 study from UCLA says that what impacts people in public
speaking is:
■ 7% the content
Todd McLeod,45
■ 38% how it’s said
■ 55% body language
○ This is true in public speaking, this is true in art, this is true in job interviews, and
this is true in your Excel spreadsheets. Take your content and give it good form
(make it look good).
● game plan
○ HOME ribbon
■ except "styles" and "format as table" - cover that later
video: 74-intro-content-form
Font
● HOME / FONT
Font is feeling
file: 75-formatting-fonts
video: 75-formatting-fonts
Clear formats
● HOME / EDITING / CLEAR
○ clear all
○ clear formats
○ clear contents
○ clear comments and notes
○ clear hyperlinks
● how to insert
○ comment
○ note
○ hyperlink
file: 76-formatting-clear
video: 76-formatting-clear
Format painter
● HOME / CLIPBOARD
file: 77-formatting-painter
video: 77-formatting-painter
Todd McLeod,46
○ copy
■ copy as picture
○ paste
■ keep source formatting
■ match destination formatting
■ paste special
● many options
○ transpose (already saw this)
○ paste as values (already saw this)
file: 78-cut-copy-paste
video: 78-cut-copy-paste
Alignment
● HOME / ALIGNMENT
○ horizontal alignment
○ vertical alignment
○ merge and center
○ wrap text
file: 79-alignment
video: 79-alignment
Number formats
Formatting numbers
● general
● number
● currency
● accounting
● date
● time
● percentage
● fraction
Todd McLeod,47
● scientific
● text
● special
● custom
file: 82-format-numbers
video: 82-format-numbers
Custom fonts
In graphic design, font determines feeling. There are two broad categories of fonts: serif and
sans-serif. A serif font has feet; a sans-serif font does not. For text on computer screens,
sans-serif is the most popular and, perhaps by consensus, best choice. You can find the most
popular fonts in the world on Google Fonts. Once the fonts are installed on your computer, you
can use them in your spreadsheets. Take-aways:
● use a sans-serif font
● use Google Fonts to get the most popular fonts
file: 83-custom-fonts
video: 83-custom-fonts
Hands-on exercises #5
#32 - Quiz
Quizzes help you learn the material more quickly. By taking this quiz, you are engaging your
mind. By working to recall the material, the material is more deeply integrated. Take this quiz to
more quickly learn!
video: none
Quiz review
● When conveying information to someone, what is more important
○ content
○ form
● Obviously content matters, but when studied, what has a greater impact on people:
○ what you say
○ how you say it
● You can install new fonts on your computer by going to Google Fonts.
● If you double-click the format painter, you can paint formatting from one cell to many
cells.
● You can copy a portion of a spreadsheet as a picture.
● When you copy something from the web, when you paste it in Excel, you can choose to
"match destination formatting."
Todd McLeod,48
● There are many options for pasting which you can explore, but primarily Todd uses
paste, paste as values, or match destination formatting.
● To format your spreadsheet, adjusting the horizontal and vertical alignment can produce
a nice effect.
● Looking at this picture, you can quickly increase or decrease the size of a font by
pressing the large or small A.
● Looking at this picture, the arrow in the bottom right corner tells you that there are
more options available.
Todd McLeod,49
● According to Todd, going on vacation to Hawaii sounds great, but everything is so pricey
now!
video: 84
Todd McLeod,50
● insert comment
● insert text box
● insert shape
● change stacking order
○ move to back
● group
○ group graphic items together
● delete a textbox
file: 87-number-formatting
video: 87-number-formatting
#36 - Alignment
Use the "format cells" dialog box "alignment" tab to align cell contents.
file: 88-alignment
video: 88-alignment
Todd McLeod,51
#41 - Transpose data
Transpose the data from a column to a row. Important: only select the data, do not select the
entire column. If you select the entire column, you will not be able to paste transpose.
file: 93-transpose
video: 93-transpose
Todd McLeod,52
■ ctrl + v
● paste
■ ctrl + shift + v
● paste without formatting in google chrome
The Second Coming
BY WILLIAM BUTLER YEATS
Turning and turning in the widening gyre
The falcon cannot hear the falconer;
Things fall apart; the centre cannot hold;
Mere anarchy is loosed upon the world,
The blood-dimmed tide is loosed, and everywhere
The ceremony of innocence is drowned;
The best lack all conviction, while the worst
Are full of passionate intensity.
Todd McLeod,53
stony sleep Were vexed to nightmare by a rocking cradle, And
what rough beast, its hour come round at last, Slouches towards
Bethlehem to be born?
■ ctrl + x
● cut
■ ctrl + z
● undo
■ ctrl + y
● redo
■ alt + tab
● cycle through open applications
■ ctrl + scroll wheel
● zoom in, zoom out
■ ctrl + backtick
● show / hide formulas
■ ctrl + f
● find
● REPLACE
■ ctrl + t
● new tab in google chrome
■ escape
● escape from some condition
■ F4
● add $s
● cycle through ab$olute, mixed, relative references
■ click → then → shift + click
● select first item, last item, and every item inbetween
■ ctrl + click
● select non-contiguous data
■ ctrl + arrow (down, up, left, or right)
● moves the ACTIVE CELL to the end of contiguous entries
■ shift + arrow (down, up, left, or right)
● OR ctrl + shift + arrow (down, up, left, or right)
● selects data from the ACTIVE CELL to other cells
■ ctrl + w
● close a workbook
■ ctrl + o
● open a workbook
■ ctrl + n
● new workbook
■ ctrl + s
● save a workbook
■ alt
Todd McLeod,54
● in excel, shows letters and gives you options to go to
different areas by pressing a key on your keyboard
■ ctrl + alt + del
● task manager
file: 96-review-congrats-milestone
video: 96-review-congrats-milestone
Acquiring data
Excel is made for working with numbers; for taking data and turning it into information. In this
section, we are going to dive into the data ribbon. To work with data, we will need to get some
data. A few sources we can use to acquire data with which to work:
● Gapminder - https://www.gapminder.org/data/
● Yahoo finance - market history
● https://www.census.gov/
○ US Census quickfacts
● ctrl + shift + t
○ in google chrome, this opens browser tabs you have closed
file: 98-acquire-data
video: 98-acquire-data
Todd McLeod,55
Generating data - Hawaii Shoe Company - step #2
● randomly generating the product sold
● randomly generating the quantity sold
file: 101-generating-data-HI-shoes-step-2
video: 101-generating-data-HI-shoes-step-2
Freeze panes
Freeze frames allows us to freeze certain columns or rows in your worksheet. This is helpful so
that you can see headers associated with data as you scroll through the data.
file: 107-freeze-panes
video: 107-freeze-panes
Todd McLeod,56
Sort
Sort allows us to quickly sort data. This is a powerful tool.
file: 108-sort
video: 108-sort
Filter
Filter allows us to filter our data by criteria we specify. When we filter data, we tell Excel to only
show certain data based upon certain criteria.
file: 109-filter
video: 109-filter
Advanced filter
Advanced filter allows you to do the following:
● see your filter criteria
● do "AND" & "OR" filtering
● use wildcards such as "*"
● use other operators such as not equal "<>"
● show unique records
● multiple criteria in one column
file: 110-advanced-filter
video: 110-advanced-filter
Filter function
This is the filter function.
file: 111-filter-func
video: 111-filter-func
Hands-on exercises #6
Todd McLeod,57
● xlookup
● textjoin
● insert / recommended pivot tables
● randbetween
file: 113-HOE-45-generating-data-HI-shoes
video: 113-HOE-45-generating-data-HI-shoes
Todd McLeod,58
● Created shortcut to Excel on the desktop
file: 117-names.zip
file: 117-birth-name-data-2
video: 117-birth-name-data-2
Todd McLeod,59
#53 - filter & freeze panes data
Using the “121-filter-freeze-frame.xlsx” spreadsheet,
● display countries which have a life expectancy greater than age 75 in 2016
● use freeze frames to hold the column and row headings in place
file: 121-filter-freeze-frame
video: 121-filter-freeze-frame
Flash fill
Flash fill recognizes patterns and then completes the pattern, filling in empty cells. To
demonstrate this, we will open the spreadsheet used in this video, enter the full name of one
person, then use “flash fill” to enter the rest of the names.
file: 125-flash-fill
video: 125-flash-fill
Todd McLeod,60
Remove duplicates
You can remove duplicate data using the “remove duplicates” tool from the data ribbon.
● download the spreadsheet used in this video then remove the duplicates.
● try changing the data in one row of a duplicate, then “remove duplicates” in such a way
that this row with changed data is not removed.
file: 126-remove-duplicates
video: 126-remove-duplicates
Consolidate
Consolidate will take data in different locations and run calculations on that data.
file: 127-consolidate
video: 127-consolidate
Trace precedents
● formulas / trace precedents
○ remove arrows
● formulas / trace precedents N TIMES
file: 128-trace-precedents
video: 128-trace-precedents
Todd McLeod,61
● data table with two variables
file: 130-data-table
video: 130-data-table
Forecasts
forecast sheet
file: 132-forecasts
video: 132-forecasts
Hands-on exercises #7
#57 - consolidate
Open the spreadsheet with the unemployment data for individuals above the age of 15. There
are two sets of four worksheets. Use consolidate on each of the sets of data.
● What is the difference?
● How did this difference occur?
file: 133-consolidate
video: 133-consolidate
Todd McLeod,62
video: 134-goal-seek
#60 - scenarios
Create the following scenarios
● one
○ 50% on the final
○ 100% on chapter 1, 2, 3
● two
○ 75% on the final
○ 50% on chapter 1, 2, 3
● three
○ 90% on the final
○ 0% on chapter 1, 2, 3
Show a scenario summary when you are done.
file: 136-scenario
video: 136-scenario
#63 - forecast
Using the “close” price, what is the forecast for this stock over the next couple of years with
95% confidence?
file: 139-forecast
video: 139-forecast
Todd McLeod,63
Displaying data
Group
We can organize our data into groups. You can group columns or rows together. When you
group data, navigation appears to the left of rows or to the top of columns. You can click on
these navigation elements to expand or contract your data. This allows you to quickly reveal,
or hide, groups of data. Note: compare with “hide” columns / rows.
file: 140-group
video: 140-group
Todd McLeod,64
Chart creation
When you create a chart, what you select is crucially important. Generally speaking, you will
want to select
● data, without totals
● column headers
● row headers
Sometimes that means selecting non-contiguous regions. To do that
● ctrl + click-&-drag
If you don't like the way a chart looks when you create it, try selecting different data and creating
the chart again. In this video, we will create the following charts:
● pie
● line
● column
● bar
file: 142-chart-creation
video: 142-chart-creation
Chart creation II
Creating the following charts:
● stacked column
● stacked bar
● donut
You can also switch the representation of the data on the x / y axis:
● right click a chart
○ change chart type
■ column, line, pie, bar ….
○ select data
■ switch row / column
● changes the way data is displayed
file: 143-chart-creation-II
video: 143-chart-creation-II
Chart formatting
A lot of creating charts is a trial and error process:
● create different charts until you get one you like
● try formatting options until you get the look you like
You can ROTATE 3-D pie charts.
● click a chart
○ plus ( + ) to the right
■ show/hide different aspects of the chart
● click part of a chart
○ delete it by pressing delete
Todd McLeod,65
file: 144-chart-formatting
video: 144-chart-formatting
Chart formatting II
When formatting charts, embrace a spirit of exploration and experimentation. Pay attention
to what you are left-clicking and right-clicking. Look at the options available. Explore and
experiment until you get the look you want.
● click a chart
○ paintbrush to the right
■ change look
● right click a chart
○ change chart type
■ column, line, pie, bar ….
○ select data
■ switch row / column
● changes the way data is displayed
○ move chart
■ new sheet
● rotating a 3D chart
file: 145-chart-formatting-II
video: 145-chart-formatting-II
Chart sparklines
Sparklines are small charts that occupy a single cell.
file: 146-chart-sparklines
video: 146-chart-sparklines
Combo chart
Combo charts allow you to combine two charts. Creating a combo chart requires a few steps:
● create a chart with one column of data
● copy/paste a second column of data onto the chart
● select the chart, then change the chart type to a combo chart
You can create a secondary axis so that data of different scales can still be graphed together.
● consider including an axis title so that others can easily interpret the data.
file: 147-combo-chart.xlsx
file: 147-secondary-axis.png
video: 147-combo-chart
Chart trendlines
Use a trendline to show the general trend of some data. You can use trendlines with some
charts. To insert a trendline, first click on your chart, then go to:
Todd McLeod,66
file: 148-chart-trendlines
video: 148-chart-trendlines
Hands-on exercises #8
#65 - sparklines
Add sparklines for the data.
file: 150-sparklines
video: 150-sparklines
#67 - subtotal
Subtotal this data:
● sport
● sales
file: 152-subtotal
video: 152-subtotal
Todd McLeod,67
Viewing & printing
Multiple windows
You can also simultaneously view different areas of a spreadsheet by having multiple
windows.
● new window
○ arrange all
○ switch windows
○ view side-by-side
■ synchronous scrolling
■ reset window position
file: 155-multiple-windows
video: 155-multiple-windows
Todd McLeod,68
● letter, legal, etc
■ margin
● center
■
○ print preview
■ CTRL + P
● print to file
file: 156-printing-worksheets.xlsx
file: 156-printing-worksheets.pdf
video: 156-printing-worksheets
Custom views
You can use a custom view to save specific display settings (such as
● hidden rows and columns
● cell selections
● filter settings
● window settings
● print settings
○ page settings
○ margins
○ headers and footers
○ sheet settings
You can save a custom view of a spreadsheet in custom views. This allows you to easily switch
back to a certain view of your worksheet.
● documentation
● compare this with the "data / what if / scenario manager"
○ A Scenario is a set of values that Excel saves and can substitute automatically
on your worksheet. You can create and save different groups of values as
scenarios and then switch between these scenarios to view the different results.
○ scenario manager
file: 157-custom-views
video: 157-custom-views
Selection pane
The selection pane will help you select a specific object on a page.
file: 159-selection-pane
video: 159-selection-pane
Todd McLeod,69
Translating
The translate function in Excel doesn’t work all that well, but it does work some of the time.
file: 160-translating
video: 160-translating
Proofing
The proofing tools include a spell checker and thesaurus. It is always good to spell check your
work before sharing it with others.
file: 161-proofing
video: 161-proofing
Todd McLeod,70
video: 163-ole
Hands-on exercises #9
Todd McLeod,71
#71 - selection pane and stacking order
Using the selection pane, have the items on the worksheet stacked in this order, FROM TOP
TO BOTTOM:
● heart
● sun
● star
● lightning bolt
file: 166-selection-pane-stack-order
video: 166-selection-pane-stack-order
Todd McLeod,72
#74 - print a worksheet to a pdf
● print this worksheet to a pdf
● make it look pretty!
file: 169-print-pretty-to-pdf
video: 169-print-pretty-to-pdf
Pivot tables
Todd McLeod,73
file: 170-pivot-tables
video: 170-pivot-tables
file: 171-grouping-pivot-tables
video: 171-grouping-pivot-tables
Todd McLeod,74
● pivot table analyze / options / data / refresh when opening
file: 172-refreshing-pivot-tables
video: 172-refreshing-pivot-tables
Pivot charts
We can build charts based upon pivot tables. When we do this, the chart is connected to the
pivot table. The chart is known as a pivot chart. When the pivot table is refreshed, the chart will
be refreshed.
file: 174-pivot-charts
video: 174-pivot-charts
Todd McLeod,75
Hands-on exercises #10
file: 175-pivot-tables-practice
video: 175-pivot-tables-practice
Todd McLeod,76
● create slicers for "Manufacturer" and "Customer"
○ set the manufacturer slicer to filter for "Martmot"
○ set the customer slicer to filter for "Cabela's" and "REI"
● create a timeline filter
○ set the timeline filter to show data from 2030 - 2050
file: 177-slivers-timeline-filters
video: 177-slivers-timeline-filters
○ if needed, right click the chart, choose "select data" and then choose to "switch
row/column"
● create a slicer for "Customer"
○ set the customer slicer to filter for "Backcountry Edge, Backcountry Gear,
Cabela's, CampBound"
● create a timeline filter
○ set the timeline filter to show data from 2027-2032
file: 178-pivot-chart-slicer-timeline
video: 178-pivot-chart-slicer-timeline
Todd McLeod,77
Odds and ends
Todd McLeod,78
Different error types
● #####
● #VALUE!
● #SPILL!
● #NAME?
● #DIV/0!
● #REF!
● #N/A!
● #NULL!
● #NUM!
file: 182-errors
video: 182-errors
file: 183-working-with-errors
video: 183-working-with-errors
Todd McLeod,79
Stats, accessibility, smart lookup, hide ink
● workbook stats
● check accessibility
● smart lookup
● hide ink
○ The Offspring
○ He may not have a clue and he may not have style But everything he lacks well
he makes up in denial
○ Now he's getting a tattoo yeah, he's getting ink done He asked for a 13, but they
drew a 31
file: 185-review-leftovers
video: 185-review-leftovers
Introduction
● something cool
○ moving the task bar
● excel shortcut "save as"
○ F12
● what's next?
○ our diagram of excel ribbons
■ get and transform
■ queries and connections
■ manage data model
● get and transform, aka → , power query
○ GET data
○ TRANSFORM data
○ microsoft power query webpage
○ access data stored in hundreds of sources and reshape it
■ from different file types
■ from different folders
● add data to folder
■ from web
■ as a connection
● new xlsx files
○ 187-LIVE-tom-cruise-filmography
Todd McLeod,80
○ 187-START-tom-cruise-filmography
● example
○ get Tom Cruise's filmography from IMDB into excel
■ use copy / paste
■ just the movie names
● example 2
○ get Tom Cruise's filmography from Wikipedia into excel
■ use data > get & transform data > from web
■ just the movie names
○
file: 187-START-tom-cruise-filmography
file: 187-LIVE-tom-cruise-filmography
video: 187-tom-cruise-filmography
● steps
○ queries and connections
■ data > queries & connections > queries & connections
■ there's nothing there
○ use get & transform
■ if you want, convert range of data to a table
● insert > table
○ ctrl + t
● if you don't convert your range to a table, it will happen
automatically when you do the next step
Todd McLeod,81
● name your table
■ data > get and transform > from table / range
○ power query editor opens
■ [transform data]
● many ways to transform data
■ close and load OR close and load to
○ queries and connections
■ data > queries & connections > queries & connections
■ your query connection is there now
○ re-open power query editor
■ data > get & transform > get data > launch power query editor
■ open your query
● queries column on the left
● double-click
■ [transform data]
■ close and load
file: 188-START-intro-get-transform-power-query
file: 188-LIVE-intro-get-transform-power-query
video: 188-intro-get-transform-power-query
Todd McLeod,82
○ combine > combine & transform data
○ choose a sample file
■ preview
■ ok
● split column 'Customer Id'
○ home > split column > split by delimiter
● rename columns
■ Customer ID
■ Customer Name
● add column 'Profit'
○ select 'Revenue' column then the 'Cost' column
■ the order you select the columns is important
● first select the column to subtract from
● second select the column to subtract
○ add column > from number > standard > subtract
○ rename column
● add column 'Duration'
○ select Departure Date' column then the 'Arrival Date' column
■ the order you select the columns is important
● first select the column to subtract from
● second select the column to subtract
■ add column > from data & time > date > subtract days
■ rename column
● remove column 'Review' & 'Source.Name'
○ right click
○ remove any other columns you don't want
● check columns data type
○ home > transform > data type
○ click on the column and see the data type
○ change data type to currency for
■ revenue
■ cost
■ profit
■ (notice $ symbol at top of column)
● name your query
○ view > layout > query settings
● close and open query settings
○ view > query settings
○ review your query settings
■ like a macro
● close and open queries
● close and load
○ file > close > close & load
● create a pivot table
Todd McLeod,83
○ sort data by 'arrival date'
Todd McLeod,84
Split by delimiter
Get and transform has a “split by delimiter” tool. We can use the “split by delimiter” tool to
have more control over splitting data. To do this, we will
● create a table of data
● data → get and transform → from table
● transform
○ split by delimiter
■ left most
■ right most
file: 191-START-split.xlsx
file: 191-LIVE-split.xlsx
video: 191-split-by-delimiter
Replace
Inside the “get & transform” area, once you are in the query editor, you can choose replace.
Replace allows you to replace certain text.
● fill
○ up, down
● replace
○ management with ruling class
○ .edu with .mil
○ 444 with 777
○ 7 in last column with 9
■ note data type: change to text, replace, change back to whole numbers
file: 192-START-replace.xlsx
file: 192-LIVE-replace.xlsx
video: 192-replace
Extract
Inside the “get & transform” area, once you are in the query editor, you can choose extract.
Extract is much like split. Extract allows you to extract text.
● extract the following
○ credentials between **
○ 456 from row of numbers
● between delimiters
○ text before delimiter
○ text after delimiter
● range
○ start at 0
■ zero based indexed
○ 2 characters
● last characters
Todd McLeod,85
○ 3
● first characters
● length
○ see the length of what's in columns
file: 193-START-extract.xlsx
file: 193-LIVE-extract.xlsx
video: 193-extract
Format
Inside the “get & transform” area, once you are in the query editor, you can choose format.
Format allows you to format text, like making text all uppercase or lowercase.
file: 194-START-format.xlsx
file: 194-LIVE-format.xlsx
video: 194-format
Todd McLeod,86
Creating our own data type & refresh
The title of this video says it all.
● microsoft documentation
● get data from the web
○ https://en.wikipedia.org/wiki/List_of_presidents_of_the_United_States
● use "dot" notation to extract field data
Todd McLeod,87
video: 199-power-query-transform
Data generator
file: 200-START-data-generator
file: 200-LIVE-data-generator
file: 200-TA-REVIEWS.zip
video: 200-data-generator
Todd McLeod,88
#82 - pivot & unpivot
Using the workbook associated with this exercise, pivot the data using these guidelines:
row value columns
Todd McLeod,89
○ https://docs.microsoft.com/en-us/power-query/
● Power Query M formula language
○ https://docs.microsoft.com/en-us/powerquery-m/
file: 207-documentation.xlsx
video: 207-explore-documentation
Data model
Todd McLeod,90
Creating relationships
We need to tell power pivot how are data is related. We do this through drag and drop.
file: 211-LIVE-create-relationships
FILE: 211-START-create-relationships
video: 211-create-relationships
Writing a measure
Measures in Power Pivot are calculations used in data analysis. Examples commonly found in
business reports include sums, averages, minimum or maximum values, counts, or more
advanced calculations that you create using a Data Analysis Expressions (DAX) formula. You
write measures in the bottom area of power pivot.
● Any Name You Want:=Sum(rColumnName)
Todd McLeod,91
○ format as currency with “$” button
■ hawaiian $ - cool!
■ right-click format is available
● documentation
○ https://support.microsoft.com/en-us/office/measures-in-power-pivot-86484821-a3
24-4da3-803b-82fd2e5033f4
file: 214-LIVE-measure
file: 214-START-measure
video: 214-measure
● add a slicer
○ make sure to insert the slicer from
■ PivotTable Analyze > filter > insert slicer
○ slicer: salesperson
file: 215-LIVE-data-model-01
file: 215-START-data-model-01
video: 215-data-model-01
Todd McLeod,92
#87 - data model #2
Using the worksheet associated with this exercise,
● turn your sheets of data into tables
○ name your tables
○ prefix with “t”
● add all of the tables to the data model
● create relationships between the tables
○ diagram view
● add a measure to the transactions table
○ total revenue
■ format as currency
● create this pivot table
row value columns
Excel's limitations
● we can't add more than 1,048,576 records to a spreadsheet
file: 217-DATA-customers-01.csv
file: 217-DATA-customers-02.csv
video: 217-excel-limitations
Todd McLeod,93
○ load to data model
file: 218-LIVE
file: 218-START
file: 218-PREP-data-generator.xlsx
video: 218-connecting-to-data
Append data
● We have already seen append in action. For thoroughness, however, this entire video is
devoted to showing how to append two queries.
● Once you have queries appended to each other, you can add data to one of the original
tables from which a query was created, and everything updates.
● Precision matters - computer science is engineering
● personal note about
○ gratitude and the potential for growth that comes from learning
file: 220-LIVE-append-data
file: 220-START-append-data
video: 220-append-data
Todd McLeod,94
file: 221-LIVE-left-outer-join
file: 221-START-left-outer-join
video: 221-left-outer-join
file: 222-LIVE-right-outer-join
Todd McLeod,95
file: 222-START-right-outer-join
video: 222-data-right-outer-join
file: 223-LIVE-full-outer-join
file: 223-START-full-outer-join
video: 223-full-outer-join
Todd McLeod,96
Data joins - inner join
file: 224-LIVE-inner-join
file: 224-START-inner-join
video: 224-inner-join
Todd McLeod,97
file: 225-LIVE-left-anti-join
file: 225-START-left-anti-join
video: 225-data-left-anti-join
file: 226-LIVE-right-anti-join
file: 226-START-right-anti-join
video: 226-right-anti-join
Todd McLeod,98
#89 - append data update
Additional sales transactions for February have been found. Add the new data to your table
using copy/paste so that they are included in the appended data.
file: 228-LIVE-append-data-update
file: 228-START-append-data-update
video: 228-append-data-update
#91 - anti-joins
In the workbook associated with this exercise:
● do a left anti join on the data
● do a right anti join on the data
file: 230-LIVE-anti-joins
file: 230-START-anti-joins
video: 230-anti-joins
3-D maps
Introduction
The 3-D map feature allows us to map data by location.
● get data from here
○ https://en.wikipedia.org/wiki/List_of_United_States_cities_by_population
● transform the data
○ keep: city, state, population columns
● 3D map the data
○ location: city or state
○ height: population
file: 231-LIVE-3D-population
file: 231-START-3D-population
video: 231-3D-population
Todd McLeod,99
3D maps and America's energy story
An introduction to something we will create using America's power station data.
file: 232-LIVE-energy-story
file: 232-START-energy-story
video: 232-energy-story
Todd McLeod,100
○ make the size the population
file: 234-LIVE-3D-europe-population
file: 234-START-3D-europe-population
video: 234-3D-europe-population
Creating macros
Understanding macros
● Macros allow you to automate your work
○ If you have a process that you repeat over and over, you can “record” that
process and then assign that process to a shortcut key or an icon.
● macros and security
● on the view ribbon
○ view > macros
● turn on
○ developer ribbon
■ file > options > customize ribbon > developer
● under "customize the ribbon" and under "main tabs" select the
"developer" check box.
● when you record a macro
○ VBA code is automatically written
○ this will be useful to us b/c we can later look at this code to learn code
○ every action must be precise
■ think about what you're going to do before you hit record
● formatting example
○ use relative references
● assigning a macro to a keyboard shortcut
○ always use "CTRL + SHIFT"
● recording a macro
○ stop
● seeing macro
○ developer > code > macros or view > macros > view macros
■ macro dialogue box
● run
● edit
● delete
Todd McLeod,101
● adding to quick access toolbar
○ more commands → macros → modify
○ show below ribbon
● saving a workbook with macros
○ "save as macro enabled workbook"
○ xlsm
file: 236-LIVE-understanding-macros
file: 236-START-understanding-macros
video: 236-understanding-macros
Recording a macro
removing every other line …
● file: 237-LIVE-recording-a-macro
● file: 237-START-recording-a-macro
● video: 237-recording-a-macro
Recording a prank
macro keyboard shortcuts will overwrite other keyboard shortcuts.
● file: 238-LIVE-recording-a-prank
● file: 238-START-recording-a-prank
● video: 238-recording-a-prank
Todd McLeod,102
■ turn on USE RELATIVE REFERENCES
■ click in cell A1
■ start recording
● enter text
○ Mom
○ Dad
○ Juniper
■ stop recording
■ run macro in different cells
● comparing the code
○ VBA button or keyboard shortcut ALT + F11
● file: 239-LIVE-rel-abs-macros
● file: 239-START-rel-abs-macros
● video: 239-rel-abs-macros
Todd McLeod,103
*** *** PROGRAMMING EXCEL WITH VBA *** ***
VBA basics
Introduction
Three perspectives help with programming
● you're learning a foreign language
● you're gaining a power
○ taking the red pill
○ reality will become malleable
● we are all, always, operating on the edge of understanding
● video: 242-VBA-intro
Orientation to VBA
● Visual Basic for Applications (VBA)
○ wikipedia
● Visual Basic Editor (VBE)
○ open
■ developer > code > visual basic
○ in coding, this is known as an integrated development environment (IDE)
● windows side-by-side
● project panel
○ VBE > view > project explorer
○ workbook
■ worksheets
■ modules
● properties panel
○ VBE > view > properties
■ objects
● have properties
Todd McLeod,104
● have methods
○ choose a sheet, then change this property
■ name: JAMES BOND
● coding window
○ VBE > view > code
● immediate window
○ VBE > view > immediate window
● object browser
○ VBE > view > object browser
○ we'll see more about this in a bit
● file: 243-LIVE-VBA-orientation
● file: 243-START-VBA-orientation
● video: 243-VBA-orientation
Todd McLeod,105
■ you can also ask questions
● questions always start with
○ ?
● examples
○ ?Worksheets.Count
○ ?Range("C3").Value
○ ?ActiveCell.Address
○ ?ActiveSheet.Name
○ ?WorkSheets(3).Name
■ you need at least 3 worksheets for the above line to work
○ ?ActiveSheet.Paste
● file: 244-LIVE-immediate-window
● file: 244-START-immediate-window
● video: 244-immediate-window
Recording a macro
● adjust coding window font size
○ VBE > tools > options > editor format
● first way
○ relative references
○ record macro
■ save to "this workbook"
○ make active cell bold
○ look at code
■ see the module in the "this workbook"
● second way
○ relative references
○ record macro
■ save to "personal workbook"
○ make active cell italic
○ look at code
■ see the module in the "personal workbook"
● explore module storage
○ VBAProject (<workbook name>)
■ modules
○ VBAProject (PERSONAL.XLSB)
■ modules
● file: 245-LIVE-recording-macro
● file: 245-START-recording-macro
● video: 245-recording-macro
Todd McLeod,106
● go into VBE
○ see the module in the personal workbook
○ delete it
● file: 246-LIVE-delete-macro-personal-workbook
● file: 246-START-delete-macro-personal-workbook
● video: 246-delete-macro-personal-workbook
Debugging code
● Show on the debug ribbon
○ right click ribbon > debug
● tools
○ step into
○ breakpoint
○ play
● compile error
○ when you type something incorrectly
● file: 248-LIVE-debugging-code
● file: 248-START-debugging-code
● video: 248-debugging-code
Todd McLeod,107
■ california
■ japan
file: 249-LIVE-record-two-macros
file: 249-START-record-two-macros
video: 249-record-two-macros
Coding concepts
● event driven programming
● object oriented programming (OOP)
○ objects
■ cell
■ column
■ row
■ range
■ sheet
■ table
■ chart
■ workbook
○ properties
■ .Interior.Color = rgbPink
■ .Font.Name = "Roboto"
■ .Font.Bold = True
○ methods | functions | things it does
■ select
Todd McLeod,108
■ copy
■ paste
● select, then do
○ select a cell, then do something
○ select a graphic, then do something
○ you do that in Excel
○ you also have to do that in code
ActiveCell.Font.Bold = True
ActiveCell.Font.Italic = True
ActiveCell.Value = "wassup"
● dot notation
● file: 251-LIVE-coding-concepts
● file: 251-START-coding-concepts
● video: 251-coding-concepts
Selecting objects
● single cell
○ Range("C2").Select
○ Range("C2").Range("C2").Select
○ Cells(3,2).Select
○ [C2].Select
○ Range("A2").Offset(0,2).Select
● a range of cells
○ Range("C2:F4").Select
● a worksheet
○ Sheets(1).Select
○ Sheets("<sheet name>").Select
● file: 252-LIVE-selecting-objects
● file: 252-START-selecting-objects
● video: 252-selecting-objects
Todd McLeod,109
○ single cell
■ Range("C2").Select
■ ActiveCell.Value = "Hello World"
■ ActiveCell.Interior.Color = rgbPink
■ ActiveCell.Interior.Color = rgb(255, 0, 0)
■ ActiveCell.Interior.Color = rgb(0, 255, 0)
■ ActiveCell.Interior.Color = rgb(0, 0, 255)
■ ActiveCell.Interior.Color = rgb(255, 199, 233)
■ ActiveCell.Font.Name = "Roboto"
■ ActiveCell.Font.Bold = True
■ ActiveCell.Clear
○ range of cells
○ Range("C2:D4").Select
○ Selection.Value = "Hello World"
○ Selection.Interior.Color = rgbPink
○ Selection.Interior.Color = rgb(255, 0, 0)
○ Selection.Interior.Color = rgb(0, 255, 0)
○ Selection.Interior.Color = rgb(0, 0, 255)
○ Selection.Interior.Color = rgb(255, 199, 233)
○ Selection.Font.Name = "Roboto"
○ Selection.Font.Bold = True
○ Selection.Clear
nice example - you need some data to do this:
○ Selection.Columns.Autofit
○ worksheet
■ Sheets(1).Select
■ ActiveSheet.Name = "Marvelous"
■ Sheets("Marvelous").Select
■ ActiveSheet.Name = "Amazing"
■ Worksheets("Amazing").Name = "Fantastic"
● file: 253-LIVE-adjusting-object-properties
● file: 253-START-adjusting-object-properties
● video: 253-adjusting-object-properties
With statement
Todd McLeod,110
Public Sub exWith() Public Sub exWith()
ActiveCell.Font.Name = "Roboto" With ActiveCell.Font
ActiveCell.Font.Bold = True .Name = "Roboto"
ActiveCell.Font.Italic = True .Bold = True
ActiveCell.Font.Size = 14 .Italic = True
End Sub .Size = 14
End With
End Sub
● video: 254-documentation
Todd McLeod,111
● file: 256-LIVE-doc-getting-started-vba
● file: 256-START-doc-getting-started-vba
● video: 256-doc-getting-started-vba
● file: 257-LIVE-doc-object-model
● file: 257-START-doc-object-model
● video: 257-doc-object-model
○ ActiveSheet
○ is it an object?
Todd McLeod,112
■ can we find it in the object list?
■ ctrl + f
● no "ActiveSheet" object
○ search box in top left corner, "activesheet"
■ what are the options?
● which one makes the most sense?
● Workbook.ActiveSheet or Application.ActiveSheet
○ explore ActiveSheet
○ does the worksheet object have the name property?
● file: 258-LIVE-doc-excel-exploration
● file: 258-START-doc-excel-exploration
● video: 258-doc-excel-exploration
Worksheets(3).Activate
ActiveSheet.Tab.Color = RGB(255, 105, 80)
file: 259-LIVE-modify-worksheet-name
file: 259-START-modify-worksheet-name
video: 259-modify-worksheet-name
Todd McLeod,113
● hint:
○ google "vba excel borders all around"
file: 260-LIVE-modify-region
file: 260-START-modify-region
video: 260-modify-region
#100 - documentation
● find the MOD operator for VBA in documentation
● hint: look under
○ language reference > reference > operators
● here's the link
video: 261-doc-mod
Coding fundamentals
Variables
● understanding variables
○ variables remember things
○ when need to remember things, and so do computers
● declaration
○ Dim x As Integer
● DIM
○ defined in memory
● type
○ computers need to know what data type is being stored
● assignment
○ x=2
○ in this case, the = sign is an assignment operator
○ it is not the beginning of a formula or function like in a spreadsheet
● application
○ Range("C2").Value = x
video: 262-variables
Todd McLeod,114
■ otherwise, variables may be assigned to the variant type
● memory expensive
■ option explicit
● you will now see this at the top of your code
● you have to be explicit - you must say what type
○ as opposed to having the computer implicitly assign a type
○ auto list members
■ intellisense
● code completion prompt
○ ctrl + space
● VBE > view > toolbars
○ edit
● variable names
○ no spaces
○ must start with a letter
○ not conflict with keywords
■ don't name after existing objects, properties, or methods
○ camelCase
' meaning of life
Public Sub mol()
Dim x As Integer
x = 42
Range("C2").Value = x
End Sub
Todd McLeod,115
x = Range("A1").Value
x=x+1
Range("C2").Value = x
End Sub
● file: 263-LIVE-working-with-variables
● file: 263-START-working-with-variables
● video: 263-working-with-variables
Calling code
● create these modules | subs, then run them
Sub foStuff()
ActiveCell.Font.Bold = True
ActiveCell.Font.Italic = True
ActiveCell.Interior.Color = rgbPink
End Sub
For loops
loop over a block of code
Public Sub forLoopEx1()
Dim x As Integer
For x = 1 To 42
Cells(x, 1).Value = x
Next x
End Sub
at an angle
Todd McLeod,116
Public Sub forLoopEx2()
Dim x As Integer
For x = 1 To 42
Cells(x, x).Value = x
Next x
End Sub
Todd McLeod,117
Public Sub forLoopEx1()
Dim x As Integer
For x = 1 To 42
Cells(x, 1).Value = x
Next x
End Sub
Next x
End Sub
Todd McLeod,118
Case 14
ActiveCell.Interior.Color = rgbPink
Case 21
ActiveCell.Interior.Color = rgbBlue
Case 42
ActiveCell.Interior.Color = rgbYellow
Case Else
End Select
Next x
End Sub
● file: 266-LIVE-if-statements
● file: 266-START-if-statements
● video: 266-if-statements
' you must have a number in call A1 ' you must have a number in call A1
Public Sub mathExample() Public Sub mathExample2()
Dim x As Integer Dim x As Integer
x = Range("A1").Value x = Range("A1").Value
Dim result As Integer x=x+1
result = x + 1 Range("C2").Value = x
Range("C2").Value = result End Sub
End Sub
file: 267-LIVE-coding-math.xlsx
file: 267-LIVE-coding-math.xlsm
file: 267-START-coding-math.xlsx
Todd McLeod,119
video: 267-coding-math
file: 268-LIVE-using-a-for-loop.xlsm
file: 268-START-using-a-for-loop.xlsm
video: 268-using-a-for-loop
Todd McLeod,120
End If
Next x
End Sub
file: 269-LIVE-conditional-logic.xlsm
file: 269-START-conditional-logic.xlsm
video: 269-conditional-logic
file: 270-LIVE-calling-code.xlsm
file: 270-START-calling-code.xlsm
video: 270-calling-code
Useful tools
Message box
file: 271-LIVE-msgbox
file: 271-START-msgbox
video: 271-msgbox
Todd McLeod,121
Input box
Public Sub exInputBox()
InputBox "What's important?", "The Big Question"
End Sub
● variable naming
○ the greater the scope, the more the name should be self-documenting
■ strResponse
○ the smaller the scope, the smaller the variable name
■ s
● documentation
file: 272-LIVE-input-box
file: 272-START-input-box
video: 272-input-box
Todd McLeod,122
(
x = MsgBox "Look Dave, I can see you're really upset about this. I honestly think you ought to
sit down calmly, take a stress pill, and think things over.", vbYesNoCancel, "Hal 2000" )
ActiveCell.Value = x
End Sub
' if 6 yes
If x = 6 Then
MsgBox "Thank you, Dave", vbInformation, "HAL 2000"
Else
MsgBox "I know I've made some very poor decisions recently, but I can give you my complete assurance
that my work will be back to normal. I've still got the greatest enthusiasm and confidence in the mission.
And I want to help you. Dave, stop. Stop, will you? Stop, Dave. Will you stop Dave? Stop, Dave.",
vbInformation, "HAL 2000"
End If
End Sub
file: 273-LIVE-msg-box-types
file: 273-START-msg-box-types
video: 273-msg-box-types
file: 274-LIVE-msg-box
file: 274-START-msg-box
video: 274-msg-box
Todd McLeod,123
○ put "DRINKS" in A1
○ add the drink to the end of a list of drinks for the bartender to make
● here is some code for you to reference:
ActiveCell.End(xldown).Select
ActiveCell.End(xldown).Select
ActiveCell.End(xlUp).Select
ActiveCell.Offset(1,0).Select
solution
Public Sub exBarDrinks()
' set A1 to DRINKS
Range("A1").Select
ActiveCell.Value = "DRINKS"
file: 275-LIVE-input-box
file: 275-START-input-box
video: 275- input-box
Todd McLeod,124
#107 - yes no cancel box
● create an input box that
○ asks users a question
○ allows them to choose either yes or no or cancel
■ remember "yes" returns the value 6
○ store their response in a variable
○ use conditional logic to show one of two different MsgBox responses
● here is some code for you to reference:
' if 6 yes
If x = 6 Then
MsgBox "Thank you, Dave", vbInformation, "HAL 2000"
Else
MsgBox "I know I've made some very poor decisions recently, but I can give you my complete assurance
that my work will be back to normal. I've still got the greatest enthusiasm and confidence in the mission.
And I want to help you. Dave, stop. Stop, will you? Stop, Dave. Will you stop Dave? Stop, Dave.",
vbInformation, "HAL 2000"
End If
End Sub
file: 276-LIVE-yes-no-box
file: 276-START-yes-no-box
video: 276-yes-no-box
Easy steps
● give your function a descriptive name
End Function
Todd McLeod,125
' SCENARIO: three families go to Disneyland
' they agree to split collective bills per person
' for each family
' we need (cost per person) * (people in family)
' (total cost / total people) * (people in family)
End Function
End Function
End Function
Todd McLeod,126
file: 277-LIVE-udf-easy-steps
file: 277-START-udf-easy-steps
video: 277-udf-easy-steps
● use this UDF in the spreadsheet to find the percent change over time
file: 278-LIVE-udf
file: 278-START-udf
video: 278-udf
Congratulations
Great work!
You have done great work - the greatest work. You have taken steps to create a better life for
yourself, and for others. As an individual improves their own life, they improve the world. The
skills you are acquiring are some of the most valuable skills demanded today: knowing how to
use Excel. Great job.
● education has the power to transform lives
○ transform your own life
Todd McLeod,127
○ transform the lives of others
video: 279-great-work
Bonus lecture
● https://www.udemy.com/user/toddmcleod
● www.heartmindway.com
video: 280-bonus-lecture
Todd McLeod,128