Upload
others
View
17
Download
0
Embed Size (px)
Citation preview
Intermediate/Advanced Excel Functionality
IRAP Professional Development Workshop Series
Zak Buschbach
Summer 2015
Links for Today
• Dataset for today:
• http://tinyurl.com/irapexceladvanced
• Shortcut guide:
• http://tinyurl.com/excelshortcutsirap
Locking Cell References with $
• When auto-filling formulas, you may want to “lock” cell references, rather than allowing the references to update dynamically • Relative vs. Absolute Cell References
• Relative: (A2)
• Absolute: ($A$2)
• Relative Column/Absolute Row: (A$2)
• Absolute Column/Relative Row: ($A2)
AutoSum
• Multiple columns can be AutoSummed/Averaged/etc.
• For example, use this to make a subtotals row
Nesting Formulas
• Nesting formulas is crucial to many of the most powerful things you can do in Excel
Defining Ranges
• A range is any set of two or cells
• While ranges can be referenced by the cells that they are composed of (A2:A101) (A:A) (A2:B101) etc, naming ranges allows for simpler formulas and less repetition
• Select the range you
want to define
• Give the range a
name by clicking the
“Name Box,” entering
a name, and hitting
Enter/Return
Defining Ranges
• Once a range is defined, you can reference the range by its name instead of the set of cells in any formula
• For example, in a VLOOKUP
OLD
NEW
Ranking Formulas
• =SMALL, =LARGE, =RANK • =SMALL – nth smallest element in a range (range, n)
• =LARGE – nth largest element in a range (range, n)
• =RANK – the rank of x in a range (number, range, ascending/descending)
ROUNDING
• Three ways to round • =ROUND – standard rounding
• =ROUNDUP – round up if partials should count as wholes
• =ROUNDDOWN – round down if partials should not be counted
• =ROUND…(cell, # of decimal places)
Workday Calculations
• =WORKDAYS – Start Date, Number of Workdays Until Deadline, Holiday Array • Gives deadline
• =NETWORKDAYS – Start Date, End Date, Holiday Array • Gives number of workdays
DOB to Age
• This lengthy formula will take dates of birth and output a text string of the age • Uses =NOW() which outputs the current date and time in Excel-readable
format
Practical DOB to Age Application
• Nest the DOB to Age calculation in an IF formula to return a live updating “of-age” text response
IF FORMULAS
IF Formulas
• =IF()
• =IFERROR ()
AVERAGE/IF/S
• AVERAGE and AVERAGEIF/AVERAGEIFS take the arithmetic mean • In this example, AVERAGEIFS is used to only take the mean of non-
zero amounts of money earned on campus
SUMIF
• SUMIF – adds cells that meet a criterion • Example: Add up the money made by those who made more than $100
• Compare to SUM – all money made on-campus
SUMIFS
Set multiple conditions for adding cells
Example:
Sum of all money made by Greek students
making over $100 on campus
COUNTIF
• COUNTIF • Counts the number cells in the range that meet the condition
COUNTIFS
COUNTIFS does multiple conditions for counting cells
For example: Count up the number of Greek Athletes in the dataset
TEXT FORMULAS
=LEN – Length of a text string
• =LEN() • Produces the length of the string in the indicated cell
Combine =LEN with =IF
• Not Nested – Uses a “helper column”
• Nested – no helper column necessary
Rule:
Name tags can’t be
longer than 15
characters
Is the name too
long?
A more complex nested IF and LEN formula that uses “&” and produces two different results
Rule:
Concatenate the first and last name, abbreviating the last name
only if the full name (including space) is over 12 characters
PROPER
• =PROPER() • Capitalizes the first letter of each word from the source cell
• Useful for when the formatting of your source database is all or partially lowercase
PROPER with CONCATENATE
TRIM and LEFT/RIGHT/MID
• =TRIM() • Removes extra spaces, leaving one between each word
• Particularly useful if there are extra spaces at the end of some of your strings, which can cause problems in matching data
• =Left/Right/Mid() • =LEFT(cell reference, number of leftmost characters to return)
• =RIGHT(cell reference, number of rightmost characters to return)
• =MID(cell reference, starting position, length of characters to return)
Index/Match – A more flexible VLOOKUP
• VLOOKUP is great but limited in only being able to lookup values in the left-most column of the source table • INDEX(MATCH()) overcomes this obstacle, but is more complex to employ
• Recall: VLOOKUP(thing to lookup, table to look in, column to return, sorted?)
• INDEX(column to return, MATCH(thing to lookup, where to look,0))
• Example: • First define Name & SAT columns as defined ranges of “names” and “sats”
• Goal: Find out the name of the person who got a 2090 SAT score (assume everyone got unique scores for this example – otherwise the first such person will always be returned by VLOOKUP or INDEX/MATCH
Array Functions
• Array formulas can accomplish a number of things • They are a way to eliminate “helper columns”
• CTRL+SHIFT+ENTER • When you enter an array function, you must enter this key
combination
Formula Checking with “Show Formulas”
Ctrl + ` ― Show Formulas
Slicers
Slicers allow you to filter multiple
PivotTables on a single variable, with
one click
Slicers Continued
Choose the
filter variable
and the
PivotTables to
connect to the
slicer
Slicers Continued
Three Pivots
with a
connected
Slicer – no filter
applied
Slicers Continued
All three
Pivots
recalculate
when a
slicer
option is
chosen
Go To > Special
• Ctrl + G
Applying Go To Special to Clean-up Data
• A common application of Go to Special • Take data from the web that is poorly formatted and turn it into a usable
Excel spreadsheet
• In this example, USNWR Top 50 Liberal Arts College data (link)
USNWR Example
• What it looks like when you paste it into Excel:
USNWR Example
• Paste Values and Clean-up Numbering Scheme
Tables and Charts
• In-text charts • Sparklines
• =REPT(“|”,x)
• Examples of good and bad charts