EXCEL TRAINING! IF STATEMENTS =IF([formula],[value if true

advertisement
EXCEL TRAINING!
1. IF STATEMENTS
a. =IF([formula],[value if true],[value if false])
i. =IF(D2<12,1,0) returns 1 if D2 is greater than 12, 0 if D2 is not greater than 12
ii. If D2 is not a number, or equals 12, or is less than 12, the value will be zero
iii. If D2 has an error, the output will also be an error
b. =SUMIF sums together numbers by matching cells to broader categories
i. =SUMIF(B:B,B2,C:C) outputs the sum of all values in column C where the value
in column B is the same as B2
ii. =C2/SUMIF(B:B,B2,C:C) tells us the percentage of the SUMIFed values from
column C that cell C2 represents.
c. =AVERAGEIF gives the average for a specified category
i. =AVERAGEIF(B:B,B2,C:C) outputs the average for all values in column C where
the value in column B is the same as B2
2. PIVOT TABLES
a. Pivot tables will change your life
b. To create: Select columns. Insert > Pivot Table
c. Use rows to tally up averages & counts
i. Rows = email, values = count of recipients
ii. Add contrib_amt to the list of values
d. Adjust values metrics by clicking on item and using “Value Field Settings”
i. Change contrib_amt to average instead of count
ii. Add a values column sum of contrib_amt
e. Use rows and columns to create crosstabs
i. Rows = email, columns = contrib_amt, values = count of recipients
f. Add additional data to the pivot table
i. Go back to pivot table, use Options > Change Data Source to add column F
g. Nested rows within a pivot table
i. Add Morning_Donation to rows
ii. Move Morning_Donation higher in the heirarchy
h. Refresh data in a pivot table
i. Go back to main data sheet and alter Morning_Donation to have text values
rather than binary values
ii. Go back to pivot table, use Options > Refresh
i. Copy-pasting from a pivot table – generally best to use “paste as values”
j. Pivot charts – the new thing changing my life, and now yours
3. VLOOKUP
a. VLOOKUP will also change your life
b. You need four pieces of information for the VLOOKUP command
i. =VLOOKUP([1],[2],[3],[4])
1. The name of the cell you are using as a key (i.e. B2)
2. The table of cells you are looking things up in (i.e. A1:B4 – but make
sure the first column matches your key)
3. The column number of the data you want to display
4. Whether you will accept close matches (TRUE) or only exact matches
(FALSE)
ii. =VLOOKUP(B2,'Subject Lines'!A1:B4,2,FALSE)
c. Watch out for shifting cell references!
i. Try these options instead
1. =VLOOKUP(B2,'Subject Lines'!$A$1:$B$4,2,FALSE)
2. =VLOOKUP(B2,'Subject Lines'!A:B,2,FALSE)
d. There is also HLOOKUP, which functions similarly but does a horizontal lookup instead of
a vertical lookup.
e. What to do if you get the dreaded “#N/A”: use an IF and ISNA statements
i. =IF(ISNA(VLOOKUP(L2,Sheet2!L:L,1,FALSE)),0,VLOOKUP(L2,Sheet2!L:L,1,FALSE))
4. LEFT, RIGHT, CONCATENATE
a. Easy commands that help truncate & remix text
b. =LEFT(B2,6) will return the first six characters in cell B6
c. =RIGHT(B2,6) will return the last six characters in cell B6
d. =RIGHT(LEFT(B2,6),4) will return only the last four characters out of the first six
characters of B2 – in other words, the characters in slots 3,4,5,6
e. =CONCATENATE(A2,D2) smashes the contents of those two cells together
f. =CONCATENATE(A2," - ",D2) returns A2 and C2 put together, but with spaces and a dash
in between)
g. =CONCATENATE(A2," - ",LEFT(B2,6)) returns A2, a space and a dash, and the left six
characters of B2
5. CONDITIONAL FORMATTING
a. Fun stuff to play around with, and makes your tables much easier to interpret
b. Found in the Home ribbon (Conditional Formatting button)
c. Favorites:
i. Color scales, shade according to each cell’s relative rank within a series
ii. Greater than / less than / equal to
iii. Above average
d. Conditional formatting can be especially useful when you have data that will
change/update and you want to see particular values quickly and easily
e. Modify/delete rules with “Manage Rules” menu option
i. This is also how you rank rules, if the same cell has multiple rules
6. FILTER AND SORT
a. Select all columns in your dataset – if you leave columns out, they will get out of order
relative to the other data
b. Use the Sort button in the Data ribbon to create tiered sorts
c. Alternatively, click Data > Filter
d. Click on the little arrows and sort by whatever column you like, or choose specific
categories to display.
e. Caution: When data gets hidden, it doesn’t sort.
7. OTHER FUN FUNCTIONS & FORMULAS
a. Text to Columns
i. Splits text apart either using specific characters (like a space, a tab, a comma,
etc) or delimited by length
b. LEN is the Length function, and returns the number of characters in a given cell
c. PERCENTRANK delivers the percentile of an individual value within an array.
i. =PERCENTRANK(C:C,C2) gives the percentile rank of C2 among all values in
column C.
d. AVERAGE, MAX, MIN, MEDIAN, MODE
i. Pretty self-explanatory, these functions give you descriptive statistics for any
range of cells you want
e. Name manager – give a particular block of cells a name so that you can keep referring to
it, rather than
f. RAND delivers a random number between 0 and 1 – handy for picking a sample
i. Caution: random numbers will regenerate, so copy-paste-as-values
ii. Pick a winner by generating a random number of all entrants and the going with
the highest (or lowest)
8. CHARTS
a. In the Insert ribbon there is a section for adding various types of charts
b. Alternatively, use Pivot Charts!
c. Excel is sometimes bad at anticipating how you want to display your data
d. Figure out the types of charts you use the most and learn how to trick Excel into making
them for you quickly.
e. Modify the displayed data by clicking into the chart and then changing the dimensions
of the colored boxes that appear around your data
f. Change the formatting by right-clicking on any element of the chart and choosing
“format [element name]”
g. Change the max/min and units of the axes using “format axis”
Download