Excel basics for everyday use part three

42
Excel Basics for Everyday Use Part Three By Kevin McLogan [email protected] [email protected] facebook.com/ kmclogan linkedin.com/in/ kevinmclogan

description

 

Transcript of Excel basics for everyday use part three

Page 2: Excel basics for everyday use part three

2

Course Objectives:After you complete this course to will be able to:

• Understand references, absolute and relative

• Know how to identify and name ranges of cells, and understand the significance of this.

• Have a good grasp on an =IF function

• Perform VLOOKUPS and HLOOKUPS

• Calculate times

• Manage AutoFilters and find information quickly

• Avoid errors by using Tracing and Validation

Create spreadsheets that amaze your friends and strike fear into the hearts of your enemies

Page 3: Excel basics for everyday use part three

3

For this class, I am making the following assumptions

• That you building on the skills that you learned in the first two classes, or have some experience with Excel

• That you are eager to learn about Excel• That there are things in your life that can be improved

through spreadsheets• That you will walk out of here with a better understanding of

Excel and be able to use it in meaningful ways when you leave the class, no matter what your current skill level is

• That you will practice the skills you have learned here

Page 4: Excel basics for everyday use part three

References

• A reference identifies a cell or a range of cells on a worksheet and tells Microsoft Excel where to look for the values or data you want to use in a formula. With references, you can use data contained in different parts of a worksheet in one formula or use the value from one cell in several formulas.

• You can also refer to cells on other sheets in the same workbook, and to other workbooks. References to cells in other workbooks are called links.

Page 5: Excel basics for everyday use part three

Relative references • Relative references A relative cell reference in a formula,

such as A1, is based on the relative position of the cell that contains the formula and the cell the reference refers to. If the position of the cell that contains the formula changes, the reference is changed. If you copy the formula across rows or down columns, the reference automatically adjusts. By default, new formulas use relative references. For example, if you copy a relative reference in cell B2 to cell B3, it automatically adjusts from =A1 to =A2.

Page 6: Excel basics for everyday use part three

Absolute references• Absolute references An absolute cell reference in a formula,

such as $A$1, always refers to a cell in a specific location. If the position of the cell that contains the formula changes, the absolute reference remains the same. If you copy the formula across rows or down columns, the absolute reference does not adjust. By default, new formulas use relative references, and you need to switch them to absolute references. For example, if you copy a absolute reference in cell B2 to cell B3, it stays the same in both cells =$A$1.

Page 7: Excel basics for everyday use part three

Naming ranges

Why is this important:• Names make your formulas more understandable

and easier to use, especially for others.• A descriptive name is easier to remember than a

range of cells• Makes it easier to move around in the spreadsheet.• Easy to verify-the names appear in the name box.• Edit Names in the Formula tab

Page 8: Excel basics for everyday use part three

Define Name Box

Page 9: Excel basics for everyday use part three

9

Name Manager

Page 10: Excel basics for everyday use part three

Formula/FunctionThis is where the heavy lifting is done.

• Formulas contain five elements:• Operators (Symbols like +, -, /, *)• References: named cells or ranges, in the current

worksheet or another worksheet, or even another workbook.

• Values: numbers or lists of numbers (sometimes named)• Functions and their arguments: include SUM, AVERAGE,

VLOOKUP and their arguments• Parentheses: Control the order in which the work gets

done.

Page 11: Excel basics for everyday use part three

=IF• This can be the most complicated of all

functions!• It is definitely the most abused!• Think about it as “IF condition A occurs, this is

the result, IF not, then this is the result.”• There can be multiple conditions, but that’s

where we can run into trouble.

Page 12: Excel basics for everyday use part three

Excel IF Statement Explained

• http://www.youtube.com/watch?feature=player_embedded&v=fR4agj1Ddoo

• With the IF formula you can tell Excel to perform different calculations depending on whether the answer to your question is true of false.

Page 13: Excel basics for everyday use part three

Excel IF Statement Explained

• The function wizard in Excel describes the IF Formula as:

= IF(logical_test,value_if_true,value_if_false)• But let’s translate it into English and apply it to an

example:

Page 14: Excel basics for everyday use part three

Excel IF Statement Explained

• In the table below we want to calculate a commission in column G for each Builder based on the number of units in column D.

Page 15: Excel basics for everyday use part three

Excel IF Statement Explained• We’ll say that for units over 5 we’ll pay 10% commission

based on the Total $k figure in column F, and for units of 5 and under we’ll pay 5% commission.

• Our IF formula for row 2 would read like this:• =IF(The number of units in cell D2 is >5,Then take the Total $k

in cell F2 x 10%, but if it’s not > 5 then take the Total $k in cell F2 x 5%)

• The actual formula we would enter into Cell G2 would be: • =IF(D2>5,F2*10%,F2*5%)• Remember; as the number of units in row 5 is not greater

than 5 the formula would calculate a 5% commission.

Page 16: Excel basics for everyday use part three

Other applications of the Excel IF statement

• We don’t have to use the IF statement to perform a calculation. We could use it to return a comment. If we take the previous example again, we could have asked Excel to put a note in the cell like ‘Pay 5%’ or ‘Pay 10%’. To do this our formula would look like this:

• =IF(D2>5,”Pay 10%”,”Pay 5%”)

Page 17: Excel basics for everyday use part three

• Notice the difference between the two formulas is the inverted commas (“) surrounding the results we want Excel to produce. These inverted commas tell Excel that the information between them is to be entered as text.

• Below is a screen shot of how the formula looks in the Formula Bar and the result returned in column G.

Page 18: Excel basics for everyday use part three

Try other operators in your IF statements

• Because the IF formula is based on logic, you can employ tests other than the greater than (>) operator used in the example above.

• Other operators you could use are:= Equal to< Less Than<= Less than or equal to>= Greater than or equal to (if we’d used this operator in our above example row 5 which had 5 units would have returned Pay 10%)<> Less than or greater than (not equal to)

Page 19: Excel basics for everyday use part three

19

VLOOKUP is my favorite Excel Formula!

• It helps me get analysis and calculations done in minutes that would take hours manually.

• I have use it all the time.

Page 20: Excel basics for everyday use part three

20

Microsoft Excel describes the VLOOKUP formula as:• VLOOKUP(lookup_value, table_array, col_inde

x_num ,range_lookup)And to translate it into English it would read:• VLOOKUP(find this value, in that table, return

the value in column x of the table,but only return a result if you can match the value exactly)

Page 21: Excel basics for everyday use part three

21

VLOOKUP

• Let’s make it even clearer by applying it to our example:

• VLOOKUP(find the name Doug from cell B2, in the Commission Rates table H2:I9,return the value in column 2 of the table, but only return a value if you find the exact name Doug in the Commission Rates table, otherwise give me an error)

Page 22: Excel basics for everyday use part three

22

Page 23: Excel basics for everyday use part three

23

VLOOKUP(find the name Doug from cell B2, in the Commission Rates table H2:I9,return the value in column 2 of the table, but only return a value if you find the exact name Doug in the Commission Rates table, otherwise give me an error)

Page 24: Excel basics for everyday use part three

24

Here’s what it would look like

Page 25: Excel basics for everyday use part three

25

DATE FUNCTIONS• =NOW and =TODAY return the current time

and date (the difference is that NOW includes the time)

• REMEMBER: all dates are stored as a number. Today is 40,206 (standard date system) and 38745 in 1904 date system.

• The standard system is based on days from 1900, but counted it as a leap year.

• Always use the 1904 system if adding or subtracting dates!

Page 26: Excel basics for everyday use part three

Calculating Time in Excel

• It’s frustrating when all you want to do is sum a column of times to get the total, but for some reason you end up with a random number like in the example below.

Since time is a concept rather than a mathematical equation, Excel has come up with systems for handling dates and times whereby they are given a numerical value.

Page 27: Excel basics for everyday use part three

Dates in Excel

• Excel gives each date a numeric value starting at 1st January 1900.

• 1st January 1900 has a numeric value of 1, 2nd January 1900 has a numeric value of 2 and so on… These values are called ‘serial values’ in Excel, and they enable the use of dates in calculations.

• NOTE: Excel calculates the year 1900 as if it was a leap year.

Page 28: Excel basics for everyday use part three

Times in Excel• Times are seen as decimal fractions. 1 being the time for 24:00 or

0:00. 12:00 has a value of 0.50 because it is half of 24 hours, or the whole number 1, and so on.

• To see Excel’s value for a date or time, simply format the cell as general.

• For example the date and time of 1st March 2008 9:30:30 AM has a true value of 39508.39618.

• 39508 being the serial value representing the date 1st March 2008, and .39618 being the decimal value for the time 9.30AM and 30 seconds.

• Although the above is important to know, thankfully Excel has built in formatting so that we don’t have to enter our dates and times in serial or decimal values.

• However it’s the lack of understanding of these serial and decimal values for time that cause common errors when performing calculations on time in Excel.

Page 29: Excel basics for everyday use part three

How to SUM time in Excel

• If you want to sum time (as in the example above) you need a custom format that uses [ square brackets ] around the hours. Like this:

Page 30: Excel basics for everyday use part three

How to SUM time in Excel• You can see in the Sample box the correct total appear. This

way I know I’ve formatted my time correctly.• These square brackets instruct Excel to and add the hours.

Without them Excel will reset the sum to zero every time it gets to 24 hours.

• There’s no need to modify the formatting of the minutes with square brackets as they automatically add up.

• Note: in some versions of Excel when you insert a formula it will automatically apply the correct formatting to give you the total. Just be sure to check the total is reasonable or check the formatting is as stated above.

• This square bracket time formatting requirement also applies when using other operators like +/-.

Page 31: Excel basics for everyday use part three

What if you want to sum seconds to find out the total seconds?

• While this isn’t the wrong answer, I want to know the total number of seconds, not how many minutes and seconds there are. To do this you’d need a custom number format like this:

You can see from the sample box I now get 237 seconds, instead of 3 minutes 57 seconds.This can also be applied to minutes or hours. Just change the formatting to [mm] or [h] respectively.

Page 32: Excel basics for everyday use part three

Time x rate to calculate wages or charge out fees

• I quite often want to calculate wages or a charge out fee in Excel. But if you don’t know this trick you’ll be tearing your hair out…and probably revert to using fractions like 7.50 for 7 hours 30 minutes, just so you can get the answer you expect.

• While entering halves or quarters of an hour as fractions is fine as, it becomes a hassle when your billing increments come down to 10 minutes or any other fraction you can’t calculate in your head….unless you’re superhuman!

Page 33: Excel basics for everyday use part three

• Thankfully the solution is simple. Just multiply by 24 like I have in the example below.

Page 34: Excel basics for everyday use part three

Use Excel in Timesheets to Calculate Time Worked

• Below is a fairly basic timesheet layout. You can see in the formula bar that the time calculation is performed as a simple equation =I4-I2-I3.

Page 35: Excel basics for everyday use part three

I’ve done some funky formatting to the cells to assist the person keying in the time:

• Rows 2 and 4 are formatted with h:mm AM/PM. The employee has to type in their time as you see it in the cell for the formatting to work correctly. The advantage to this is they don’t need to convert their finish time to a 24 hour clock style.

• The disadvantage is a bit more typing with the need for the AM or PM distinction.

Page 36: Excel basics for everyday use part three

• Row 3 is formatted with h:mm “h:mm”. This adds the text h:mm to the end of the value for presentation purposes. The employee only needs to type in 0:30 for a half hour lunch break, and Excel will add the h:mm to the end.

• Row 5 is formatted with [h]:mm “h:mm” to ensure Excel adds the hours correctly.

• You can then calculate wages using the total figure in cell N5 with the Time x Rate formula above. Of course this doesn’t take into account overtime and penalty rates. That lesson is for another day.

Page 37: Excel basics for everyday use part three

37

Checking your work

• Tracing errors: when you get a message like:• ####, #DIV/0!, #REF!, #NULL!1, #VALUE!,

#NAME?, #NUM!, #N/ASomething went wrong!

Open the Fix and trace errors file

Page 38: Excel basics for everyday use part three

38

• ##### column is too narrow to display the value, or you might have used a negative number for a date or time.

• #DIV/0! You attempted to divide by zero. What were you thinking?

• #NAME? Excel does not recognize the text in the cell. A name or function have been misspelled or used a name that does not exist. Text in not marked properly.

• #NUM! The formula contains an invalid numeric value or a number that is too large or too small for Excel to handle.

• #REF! The formula uses an invalid cell reference.

• #VALUE! The wrong type of argument is used in the formula.

Page 39: Excel basics for everyday use part three

39

Tracing Precedents and dependants

Page 40: Excel basics for everyday use part three

40

Drop-down menus in cells• You can limit the options

for data entry with a drop-down menu in each cell.

• This keeps the entries consistent and limits errors due to spelling, or other inconsistencies.

• Let’s try it!

Page 41: Excel basics for everyday use part three

41

Inserting fancy stuff into your spreadsheet

• Hyperlinks

Open the more resources file to see how this is inserted.

Page 42: Excel basics for everyday use part three

42

I leave you with this:

SAVE YOUR WORK!

Thank you for participating, happy spread sheeting!