44
Excel training that “sticks” by Laura Winger

Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Embed Size (px)

DESCRIPTION

Microsoft Excel is one of the most powerful tools, and if you use Excel on a regular basis for your job, chances are you are under utilizing it and could increase your productivity and free up hours each week with improved Excel skills. My Excel Excellence courses provide hands-on experience with realistic business examples and simplified explanations. Become a whiz at VLookUp's, PivotTables, and even program your own Macros! This slide deck is a preview from my first session on Formulas. Formulas are used for more than math, they can be used for re-formatting data, extracting data and putting data together (“concatenating”). Learn how to harness the power of Excel and put the computer to work for you!

Citation preview

Page 1: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel training that “sticks” by

Laura Winger

Microsoft Excel Excellence

Page 2: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 2

• Your instructor– Laura Winger, CPIM, CSCP– Six Sigma Black Belt from Honeywell and Bourns– BSE in Industrial Engineering for Arizona State– MBA from Arizona State with a focus on Operations / Supply Chain

Management– Experience in purchasing (Avnet), quality, operational excellence,

project management, VMI leader (Honeywell),production planning (Henkel / Dial)

– Hobbies include writing, swing dancing, running, hiking, painting, interior design, learning foreign languages, traveling, beer/wine/cheese tasting, martial arts, other types of dance, glassblowing

Page 3: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

“It is when the tools of production are transparent, that we are inspired to create.”

- Chris Anderson, The Long Tail

Page 4: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 4

• Show up! You can’t learn if you’re not here!• Participate! Turn off the cell phone, close the

email, and stay engaged.• Ask questions! • Do the homework!• Reflect and apply - Think about what you’ve

learned and how you might use this in your workplace or home life.

Page 5: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 5

Formulas

– Common Formulas

– References

– Numeric Formulas

– Formula Tips and Terminology

– Informational Logic

– Conditional Math

– Lookup functions

– Strings and Dates

• Formatting and Filtering

• Sorting and Pivot Tables

• Stats and Graphs Access Basics PowerPoint Tricks and Case Studies Macro Basics

Page 6: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 6

Formulas

What did Excel do while you were typing?

Capitalization does not matter in

formulas!

• Warm-upType this into a cell:

=sum(4,2)

and hit “Enter”. Did you get 6?

Page 7: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 7

Formulas

• Ideas to think about– Formulas are used for more than math

• Re-formatting data• Extracting data• Putting data together (“concatenating”)

– You will naturally memorize formulas which you frequently use• Practice, practice, practice! those which you see most useful to you

– You don’t have to memorize all the formulas• Knowing such formulas exist is the key; if you forget the specific

syntax, you can look it up multiple ways:– Browse through the Formulas ribbon– Use Insert Function, you can search in there– Look it up on the Internet

Page 8: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 8

Numeric Formulas

Don’t worry about capitalization.

• Exercise 11. Use =sum(C4:C5)

• You should get 6.

2. Use =sum(C10:F11)• You should get 8.

3. Use =sum(C16,E17)• You should get 8.

4. Use =average(C22:E24)• You should get 4.55556

5. Use =count(C28:E30)• You should get 6, because three of

the cells are empty.

Page 9: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 9

Formulas - References

• Relative, absolute and mixed references– Use F4 to toggle through combinations

Reference (Description) Changes to

$A$1 (absolute column and absolute row) $A$1

A$1 (relative column and absolute row) C$1

$A1 (absolute column and relative row) $A3

A1 (relative column and relative row) C3

Page 10: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 10

Formulas - References

• Take your answer for (1.) and move it down (or copy it down) one row below.– It should change to 2, because there were no

absolute references.

• Modify your answer for (2.) to make all cells absolute.– No matter where you copy it, the answer should

remain the same (a value of 8).

Page 11: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 11

Formulas - References

• Modify the formula for your answer in (3.) so that only C16 is absolute.– It should look like this: =SUM($C$16,E17)– Now copy it down one row. It will then sum C16 and

E18, so you should get 13.

• Modify the formula for your answer in (4.) so that only the rows are absolute)– It should look like this: =AVERAGE(C$22:E$24)– Now copy it to the right one column. It should change

to 5.166. If you copy this answer down one row, it will stay at 5.166.

Page 12: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 12

Numeric Formulas

• Application: Cumulative Sum

=Sum(Absolute:Relative)– What would happen if we

used a comma instead of a colon?

– It would only add the first value and the last value, but not the values in between!

Page 13: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 13

Numeric Formulas

• Application: Cumulative Sum

=Sum(Absolute:Relative)

Use Exercise B tab.

Next to the value 1, type:

=SUM($B$4:B4)

Now copy this formula down using the Fill handle in the bottom right corner of the cell.

Page 14: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Microsoft Excel Excellence 14

Numeric Formulas

• Round =Round(Value, Decimal Places)

=RoundUp(Value, Decimal Places)

=RoundDown(Value, Decimal Places)

=mRound(Value, Multiple)

• Mod – returns the remainder after number is divided by divisor– Mod(n, d) = n – d*Int(n/d)– Mod(4829, 100) = 29

• Quotient – Returns the integer portion of a division– Quotient(28,5) = 5

mRound is useful when working with lot

sizes or required multiples

Page 15: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Microsoft Excel Excellence 15

Numeric Formulas

• Application: Average Monthly Demand

Use Exercise C tab.

Under Ave Monthly Demand type:

=Average(C3:H3)

Now copy this formula down using the Fill handle in the bottom right corner of the cell.

Page 16: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 16

Numeric Formulas

• Application: Rounded Average Monthly Demand

Under Rounded Ave Monthly Demand type:

=RoundUp(I3,0)

I3 is the value to be rounded, and 0 is the number of decimal places to show.

Now copy this formula down using the Fill handle in the bottom right corner of the cell.

Page 17: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 17

Nested Formulas

• When you want to use more than one formula in a cell, it is called “nesting”

• In the previous example, we had one column for the Average formula and one column for the RoundUp formula. But using nested formulas, we could do that all in one column.

• The first formula will be nested inside the second formula.

Page 18: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 18

Nested Formulas

• Application: Rounded Average Monthly Demand

Go back to the Ave Monthly Demand column and add to the formula:

=RoundUp(Average(C3:H3),0)

Now copy this formula down using the Fill handle in the bottom right corner of the cell.

Page 19: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Break Time

oWhat did you learn? oWhere will you use it?

oDo you have any questions?

Page 20: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Formulas – IF formula

• An IF statement reads “If this is true, then display this, otherwise display that”– Similar to other programming languages: “If, Then, Else”

format

• On Exercise D sheet, determine how much more needs to be spent (on purchase orders) to at least cover demand in the month. 1. In cell D2, enter this formula:

2.Copy the formula down using the cell handler in the bottom right corner of the cell

3. In the next column, multiply the quantity to place by the unit price.

4.Copy this formula down using the Fill handle

Excel Excellence 20

=IF(B2<0,-B2,0)

=D2*C2

Page 21: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 21

Formula tips

• Show all formulas in a spreadsheet– Press CTRL + ` (grave accent, above the Tab key).

• Conditional Terms– Use <> to say “is different from” or “does not equal”– Use >= for “greater than or equal to” and <= for “less

than or equal to”

• Nesting – Using formulas inside other formulas=If(A1 >= 5, If(A1 <= 10,"Just right", "Too much"), "Too little")

Page 22: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 22

Formulas

• Conditional Math=SumIf(range, criteria, [sum range])

=CountIf(range, criteria)

=SumIf(range, criteria, [sum range])/CountIf(range, criteria)

• What if there was no AverageIf, how would I find the average?

Page 23: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 23

• What are four other Microsoft Office applications other than Excel?– Word, PowerPoint, Outlook, Access,

FrontPage, Visio, Project, Publisher, OneNote

• What are the names of the six Brady Bunch kids?– Cindy, Jan, Marcia,

Bobby, Greg, Peter

Page 24: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 24

Lookup Formulas• Basic formula:

Lookup(LookupValue,LookupVector,ResultVector) • Variants:

Lookup(LookupValue,Array) VLookUp(LookupValue, TableArray, ColIndexNum,

[RangeLookup]) HLookup

• Generally, you want to use FALSE as RangeLookup to ensure you will get only exact matches

– WARNING: Values in LookupVector should be placed in Ascending Order

– WARNING: If Lookup doesn’t find the LookupValue, it matches the largest value in LookupVector that is less than LookupValue

Page 25: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Lookup Formulas

• On Exercise E sheet, determine the gender of the given kids listed in cells E3 to E6.1. In cell F3, enter this formula:

2.Copy the formula down using the fill handle in the bottom right corner of the cell

Excel Excellence 25

=VLookUp(E3, $B$3:$C$8, 2, False)

Notice the options that pop up when you enter the formula.

Page 26: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Lookup Formulas

• HLookUp is used the same way, but for when data is oriented in rows instead of in columns. 1. In cell G11, enter this formula (note the absolute

reference to column F):

2.Copy the formula to the right using the fill handle in the bottom right corner of the cell

3.Modify the formula in cell H11 to reference the 3rd row in the array:

4.Now copy both cells down using the cell handler.

Excel Excellence 26

= HLookUp($F11, $B$11:$D$13, 2, False)

= HLookUp($F11, $B$11:$D$13, 3, False)

Page 27: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Lookup Formulas

• Note that there was no “Favorite” in the original array, so the formula evaluates to #N/A in that row.

• You can use a nested formula to identify cells with this value.

Excel Excellence 27

=IF(IsNA(HLookUp(…)),"Unknown","Known")

Page 28: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Lookup Formulas

• More likely you’d want to repeat the look up formula if it is not N/A:

• Putting it all together:

Excel Excellence 28

=IF(IsNA(HLookUp($F13,$B$11:$D$13,2,False)), "Unknown",HLookUp($F13,$B$11:$D$13,2,False))

=IF(IsNA(HLookUp(…)), "Unknown", HLookUp(…))

Do you see the “nesting”? The second HLookUp is nested in the IF formula, as the “Else” portion. The first

HLookUp is nested in the IsNA formula, which is nested in the first part of the IF formula!

Page 29: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 29

Formulas

• Informational Logic – other “Is” formulas:• IsBlank• IsErr• IsError• IsEven

• IsOdd• IsLogical• IsText• IsNumber

Try experimenting with these to see how you might use them in your own data analysis.

Page 30: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Formulas – VLookUp Example

Excel Excellence 30

B14 will evaluate to #N/A, because there is no B21648 value in the array above.B14 will evaluate to #N/A, because there is no B21648 value in the array above.

Which cell will evaluate to #N/A?Which cell will evaluate to #N/A?

Page 31: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 31

Strings

• Strings– To use just a part of the text in another cell, use Left,

Right or Mid functions

=Left(A2, 5)Returns the first 5 characters in A2

=Mid(A2, 2, 3)Begins at the second character, and returns the next 3 characters

=Right(A2, 4)Returns the last 4 characters of A2

=Left(A2,5) Honey=Mid(A2, 2, 3) ney=Right(A2, 4) well

Note: The Mid function can also be used when you don’t know where the desired string ends. Consider using the Trim function with the Mid function.

Page 32: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 32

Strings

• Unformatted dates look like strings– Example: 081020 - in the form of yymmdd– Use the Left, Right and Mid functions nested in a

Date function

• What’s wrong with this formula?– This formula leads to 10/20/1908– You can just add “100” to bring it into this century!

=Date(Left(B37,2),Mid(B37,3,2),Right(B37,2))

=Date(100+Left(B37,2),Mid(B37,3,2),Right(B37,2))

Page 33: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 33

Strings

• Concatenation– Use & to add to strings– Mix numbers, strings and dates, but be careful of

formatting!– Use quotes to add spaces, punctuation and extra text

Page 34: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 34

Strings

• Lesser-known string functions– Trim function – used to eliminate spaces at the

beginning and end of strings– Len function – returns the length of a string– Find function – reads through the string until it finds

the text being searched for, and returns the numeric position of the first instance

Page 35: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 35

Strings

• Putting It All Together– Return the second word in a string of three or more

words of unknown length

=Trim(Mid(A1, Find(" ", A1), Find(" ", A1, Find(" ", A1)+1)-Find(" ", A1)))

Page 36: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Strings

• Putting It All Together– Change the format of a name from Last Name, First

Name to First Name Last Name

=Mid(A1, Find(", ",A1) + 2, 20) & " " & Left(A1, Find(", ", A1) - 1)

Excel Excellence 36

Page 37: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Strings

• Go to Exercise F and develop a formula that will give you just the cities from the four APICS Chapters listed.

1.Start by identifying the location of the first space:

2.Because all the chapters start with “APICS” and end with “Chapter”, we’ll use the length of the string:

37

= Len(B4)-Find (" ",B4)-8

=Find(“ ",B3)

Why -8? There are 7 characters in the word “Chapter” and a space character.

Page 38: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Strings

3. Put it together with the Mid formula:

4. Whoops! We need to start at the character AFTER the first space, so add one:

5. Now copy this formula down, and see if it works for the other chapters and cities.

Excel Excellence 38

=Mid(B3,Find(" ",B3),Len(B3)-Find (" ",B3)-8)

=Mid(B3,Find(" ",B3)+1,Len(B3)-Find (" ",B3)-8)

Page 39: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Strings

• Putting It All Together– Excel turns anything that looks like a date into a date.

If you have to change it back, here’s one way to do it.

=If(IsText(A2), A2, Month(A2) & “-” & Day(A2) & “-” & Year(A2))

Excel Excellence 39

Page 40: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Strings

Other string formulas you might find useful:•To turn a string into an integer use: Int()

•To turn a string into a date use: DateValue()

•To create a new date from separate month, day and year values use: Date()

Excel Excellence 40

Page 41: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Excel Excellence 41

Dates

• Dates and Serial Numbers– Weekday(date) returns serialized day of the

week, ie. 1 for Sunday, 2 for Monday etc.– Now() returns today’s date and time

• WARNING: This updates every time you update your spreadsheet. To record “Now” permanently, Copy and Paste Special… Values

– Today() returns today’s date, but not time• Same WARNING applies

Page 42: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Dates

• Still on Exercise F sheet, fill in the “First of the Month” in column I.

Excel Excellence 42

=DATE(YEAR(H3),MONTH(H3),1)

You might use this to sort or filter by monthly activities, or to report activity by month. We’ll learn another way to group by month later.

Page 43: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Dates

• Now fill in the rest of the table in columns J and K.

1.Start by identifying today’s date in cell H1:

2. In cell J3, subtract today’s date from the date listed next to the city. Remember to make today’s date an absolute reference!

3. In cell I3, we’ll try a new formula:

43

=H3-$H$1

=Today()

=NetWorkDays ($H$1,H3)

NetWorkDays gives you the number of working days (weekdays) between two dates, in this case between today and the given date.

Page 44: Excel Excellence (Microsoft Excel training that "sticks"): Formulas

Want more?

Contact Laura Winger about Excel training that actually sticks!