17
Tommy B. Harrington 104 Azalea Drive Greenville, NC 27858 Email: [email protected] E E x x c c e e l l ' ' s s B B e e s s t t F F u u n n c c t t i i o o n n s s Computer Training YOU Can Under rstand!

Tommy Excelbestfunctions

Embed Size (px)

DESCRIPTION

excel shortcut

Citation preview

Page 1: Tommy Excelbestfunctions

Tommy B. Harrington 104 Azalea Drive

Greenville, NC 27858 Email: [email protected]

EE xx cc ee ll '' ss BB ee ss tt

FF uu nn cc tt ii oo nn ss

CCoommppuutteerr TTrraaiinniinngg YYOOUU CCaann UUnnddeerrssttaanndd!!

Page 2: Tommy Excelbestfunctions

Copyright 2010 2 Tommy Harrington

Excel’s BEST Functions By Tommy B. Harrington Table of Contents

SUM FUNCTION ............................................................................................................................................... 3 

IF FUNCTION .................................................................................................................................................... 4 

SUMIF AND COUNTIF ....................................................................................................................................... 5 

VLOOKUP FUNCTION ....................................................................................................................................... 7 

ADVANCED SHORTCUTS .................................................................................................................................. 9 

FUNCTIONS FOR DATES ................................................................................................................................. 12 

TEXT FUNCTIONS ........................................................................................................................................... 13 

Functions and formulas are the most important part of Excel worksheets. Discover the functions that are most useful when getting your daily work done. Learn to use VLOOKUP and other functions that might do the same job in better ways. Learn functions that can solve problems when importing data. You’ll discover functions that save hours of time when creating routine summaries. Become an expert on the most useful Excel functions. During the last 20 years working with many companies, organizations, and institutions; I realized there were some functions that all Excel users needed to be able to use. If you learn when and how to use these functions, you will get more work done in less time. You will learn to use Excel’s most useful functions—SUMIFS, COUNTIFS, IF, ISNA, ROUND, VLOOKUP, INDEX, MATCH & the TEXT functions. Learn to use functions and formulas when working with dates. You’ll be amazed at all Excel’s functions for summarizing accounting, production, and management information. Learn formulas and techniques needed to build dashboard programs.

Page 3: Tommy Excelbestfunctions

Copyright 2010 3 Tommy Harrington

Excel functions can be more powerful than macros. Every user needs to know the five essential functions of Excel and should be able to use them without hesitation. These functions are SUM, IF, VLOOKUP, SUMIF, and COUNTIF. If you add to these functions several other functions that enable you to manipulate dates and text entries, then you have mastered Excel’s most valuable functions.

SUM Function Everyone knows how to use the SUM function…Right? Maybe. Let’s look at using the AutoSum button and what it can do for us. You can use the AutoSum button to calculate grand totals from subtotals. Remember don’t have blank rows in the area of your worksheet where you want an automatic grand total.

1. Double click the AutoSum button at cells B7, B10, and B14 to produce subtotals 2. Highlight cell B15

3. Double click the AutoSum button for the grand total shown

Instead of clicking the AutoSum button , you can also press ALT+= (equal sign).

Page 4: Tommy Excelbestfunctions

Copyright 2010 4 Tommy Harrington

IF Function The IF function is possibility the most powerful function in Excel. Let’s look at one example. When you write a formula that divides by a cell that could contain zero, use the following method. Use the IF function to test the divisor for zero. If this cell is zero, you can have the IF function enter a 0 or blank as shown.

To eliminate #DIV/0! error from formulas in a worksheet:

1. Click on cell D5 2. Type =if( 3. Click on cell B5 4. Type =0,0, 5. Click on cell C5 6. Type / 7. Click on cell B5 8. Type ) or press Enter

9. Double click on the AutoFill handle to copy it from D5 through D8 If you want the cell to be blank rather than show 0, replace Step 4 as shown below:

4. Type =0,””,

Page 5: Tommy Excelbestfunctions

Copyright 2010 5 Tommy Harrington

SUMIF and COUNTIF The SUMIF function adds the cells specified by a given criteria. I like to remember the layout for the formula as: SUMIF(where column, what cell, which column) The “where column” is the range of cells you want evaluated; usually the entire column you wish to search. The “what cell” is the criteria in the form of a number, expression, or text that defines which cells will be added. For example, criteria can be expressed as 32, "32", ">32", "apples", but is normally a reference to another cell that contains the criteria. The “which column” is the column matching the “where column” that actually the numbers to be added. The cells in “which column” are summed only if their corresponding cells in the “where column” match the criteria. The “which column” is usually a column containing quantity or dollars. To count the number of occurrences of a string of text or a number within a range of cells, use the COUNTIF function. Syntax: COUNTIF(where column, what cell) The “where column” is the range of cells in which you want to count certain cells. The “what cell” contains the criteria in the form of a number, expression, or text that defines which cells will be counted. With the COUNTIF function no “which column” is needed since, if a match is found, it is counted. If the following items were typed in a spreadsheet,

The formula in cell F2 which summarizes units sold is written and copied as shown below;

1. Click on cell F2 2. Type =sumif( 3. Paint cells in column A which could contain the word “Acme” 4. Press the function key F4 making the range absolute (when copied it will not

change)

Page 6: Tommy Excelbestfunctions

Copyright 2010 6 Tommy Harrington

5. Type a comma 6. Click on cell E2 which contain the word to find 7. Type a comma 8. Paint the cells in column C containing the units to be added if a match is found 9. If formula is to be copied across, press the function key F4 making the range

absolute (when copied it will not change) 10. Press ENTER to close the parenthesis and enter the formula 11. Double-click on the AUTOFILL handle to copy the formula down beside the

other customer names Move to cell F6 and repeat the steps above to summarize for Products.

The only difference in the formula in cell F6 is that column B is painted instead of column A since this column contains the product names being summarized. You should always paint the entire column to allow for information that will be added later.

Control report order with SUMIF Like many functions in Excel, SUMIF has another use not normally thought of. You can use SUMIF to place dollar amounts or items associated with GL accounts or product names in a special order for reporting. SUMIF can be used in this very special way to control the order of a report.

In the worksheet shown above:

1. Click on cell F2 2. Type =sumif( 3. Paint cells in column A which could contain the GL Account numbers 4. Type a comma 5. Click on cell E2 which contain the GL Account balance to be placed here in the

report 6. Type a comma 7. Paint the cells in column B containing the Account Balance to be used when a

match is found (Since GL Accounts are listed only once, sumif adds only the one balance amount)

8. Press ENTER to close the parenthesis and enter the formula 9. Use copy and paste to place formula beside each account number 10. Add section totals and grand total

Page 7: Tommy Excelbestfunctions

Copyright 2010 7 Tommy Harrington

VLOOKUP Function The VLOOKUP function does a great deal of work for us in Excel. It’s the function that turns Excel into a relational database program. If you have information in two lists and the information in one is needed in the other, VLOOKUP is the “tool” to use. Product names from one table can be matched with sales data in another table which has only product numbers. Client names can be placed in a list that has only client number with VLOOKUP. If you highlight entire columns for your lookup table, in most cases you do not need to do anything special with these ranges. We normally copy VLOOKUP formulas down columns and in that case the formula will always work correctly without making the ranges absolute (adding dollar signs). If possible, always place your lookup table on another sheet, not on the same sheet where the VLOOKUP formulas will be written. As an example, look at the worksheet below:

We need to add Dept Names to this list with VLOOKUP. On another sheet in this same workbook we have our lookup table.

Page 8: Tommy Excelbestfunctions

Copyright 2010 8 Tommy Harrington

We do not have to worry with absolute and mixed references if we paint entire columns in out lookup table and our formula is only to be copied down a column.

1. On the Data sheet in cell I2, begin typing your formula with =VLOOKUP( to start your formula

2. Next click on or move to cell C2 in order to show Excel the value to be “looked up”

for this row 3. IMPORTANT now type a comma (,)

(This locks in your lookup cell)

4. Now click on the sheet tab for your table – DeptList 5. Place cursor on letter A for column A, hold down the regular mouse button, and

drag across to column letter B (This will highlight both columns in your lookup table)

Page 9: Tommy Excelbestfunctions

Copyright 2010 9 Tommy Harrington

6. IMPORTANT now type another comma (,)

(This locks in your table) 7. Type ,2,false) and press Enter

The 2 in the VLOOKUP function indicates the second column (Full Department Name column) in the lookup table. The word false tells Excel to always return an exact match ONLY or to indicate that no match was found by displaying #N/A

We almost always add the word FALSE to the end of every VLOOKUP function.

Since this leaves the formula range painted, simply drag or double-click the AutoFill handle to copy the formula down column I as needed.

Advanced Shortcuts There are a couple of advanced shortcuts that any users should know and use automatically. They are double-click the AutoFill handle and the Repeat key.

Page 10: Tommy Excelbestfunctions

Copyright 2010 10 Tommy Harrington

Double click to AutoFill a range When a cell or group of cells is highlighted, the bottom or right-most cell has a small black square on the bottom right corner. You use AutoFill normally by dragging this handle to other cells. AutoFill repeats patterns, fills from custom lists, or copies.

By double clicking the AutoFill handle you can copy a formula or other information into all adjacent cells in a range. If you have numbers in cells A1 through B10, then you write the formula, =A1+B1, in C1, this formula can be copied from C1 through C10 by simply double clicking the AutoFill handle on cell C1. After double clicking the AutoFill handle, the formula is copied through cell C10.

Repeat Key Function key F4, the repeat key, can sometimes be used to help you do jobs that must be done over and over in Excel. First you must perform the action that you wish to repeat, then, after moving to a new location in your worksheet, you can press F4 to repeat the same action.

Replace formulas with their values With a command you can change the results of a group of formulas into their look-alike value. Sometimes it is necessary to replace a group of cells containing formulas with the equivalent values; this can be done by first painting the range then click Copy or do Ctrl+C. Next leave the same area painted and click Paste Special from the Edit menu. Mark Values and click OK.

Page 11: Tommy Excelbestfunctions

Copyright 2010 11 Tommy Harrington

This could be performed on simple or complicated formulas. However there is another very unique use for this technique. If you have names in a worksheet which were entered in upper case, replace values and the PROPER function can change this in a hurry,. Consider the following information:

1. Click on cell B1 2. Type =PROPER( 3. Press the Left arrow on your keyboard one time 4. Type ) 5. Press Enter 6. Make sure you are still on cell B1

7. Double click the AutoFill handle on cell B1 to copy the formula down through cell B9

8. Notice that after AutoFill the range is still painted 9. Do Copy (Select Copy from the Edit menu, click the Copy button on the toolbar or

press Ctrl+C) 10. Click on cell A1 11. Select Paste Special from the Edit menu 12. In the Paste section click Values

13. Click OK

Page 12: Tommy Excelbestfunctions

Copyright 2010 12 Tommy Harrington

14. Now paint B1 through B9 and press the Delete key

When values are pasted, the supporting formulas in the copy range are no longer needed in the case.

Functions for Dates Dates can be entered in an Excel cell in many different ways:

10/1/2010 Oct 1, 2010 October 1, 2010 01 OCT 2010

These are all acceptable ways to enter the same date in Excel. You need to master the date functions in order to make your work flexible when working with dates.

Page 13: Tommy Excelbestfunctions

Copyright 2010 13 Tommy Harrington

In cells A1, A2, and A3 above each of these entries is the same to Excel; all are valid entries for 10/1/2010. Using the DATE function with YEAR, MONTH & DAY functions, we can write formulas to have Excel create dates that are the same as “real” dates.

TEXT Functions This group of functions is needed by almost every Excel users.

LEFT, RIGHT, MID, CONCATENATE, &

The LEFT function returns characters from the left side of a text string, based on the

number of characters you specify.

Syntax : LEFT(text,num_chars)

Text is usually a cell reference that contains the characters you want to extract.

Num_chars specifies the number of characters you want extracted from the LEFT side of

the word or number. Num_chars must be greater than or equal to zero. If num_chars is

greater than the length of text, LEFT returns all of text. If num_chars is omitted, it is

assumed to be 1.

The characters or numbers returned by this function are considered by Excel as text.

The RIGHT function returns characters from the right side of a text string, based on the

number of characters you specify.

Syntax : RIGHT(text,num_chars)

Page 14: Tommy Excelbestfunctions

Copyright 2010 14 Tommy Harrington

Text is usually a cell reference that contains the characters you want to extract.

Num_chars specifies the number of characters you want extracted from the RIGHT side of

the word or number. Num_chars must be greater than or equal to zero. If num_chars is

greater than the length of text, RIGHT returns all of text. If num_chars is omitted, it is

assumed to be 1.

The characters or numbers returned by this function are considered by Excel as text.

The MID function returns a specific number of characters from a text string, starting at the

position you specify, based on the number of characters you specify.

Syntax: MID(text,start_num,num_chars)

Text is the text string containing the characters you want to extract.

Start_num is the position of the first character you want to extract in text. The first

character in text has start_num 1, and so on. If start_num is greater than the length of text,

MID returns "" (empty text). If start_num is less than the length of text, but start_num plus

num_chars exceeds the length of text, MID returns the characters up to the end of text. If

start_num is less than 1, MID returns the #VALUE! error value.

Num_chars specifies the number of characters you want MID to return from text. If

num_chars is negative, MID returns the #VALUE! error value.

Some accounting programs display negative values with the negative sign (–) to the right

of the value. If you import a file created in a program that stores negative values in this

way, Microsoft Excel might import the values as text. To convert the text strings to values,

you must return all of the characters of the text string except the rightmost character (the

negation sign), and then multiply the result by –1. For the num_chars argument, use the

LEN worksheet function to count the number of characters in the text string, and then

subtract 1. For example, if the value in cell A2 is "156–" the following formula converts the

text to the value –156:

LEFT(A2,LEN(A2)–1)*–1 equals – 156

The CONCATENATE function “adds” words or numbers together to from new words or

phrases.

Page 15: Tommy Excelbestfunctions

Copyright 2010 15 Tommy Harrington

Important: We never use CONCATENATE since the "&" operator can be used instead of

CONCATENATE to join text items or numbers.

=CONCATENATE("Total", " ", "Value") equals "Total Value".

Since CONCATENATE only allows a limited number of items, you would do better to use

the & to do concatenation.

It would be better to type ="Total"&" "&"Value"

FIND and LEN

The FIND function finds one text string (find_text) within another text string (within_text),

and returns the number of the starting position of find_text, from the first character of

within_text. You can also use SEARCH to find one text string within another, but unlike

SEARCH, FIND is case sensitive and doesn't allow wildcard characters.

Syntax: FIND(find_text,within_text,start_num)

Find_text is the text you want to find. Find_text cannot contain any wildcard characters.

Within_text is the text containing the text you want to find.

Start_num specifies the character at which to start the search. The first character in

within_text is character number 1.

If find_text does not appear in within_text, FIND return the #VALUE! error value.

If start_num is not greater than zero, FIND return the #VALUE! error value.

If start_num is greater than the length of within_text, FIND and FINDB return the #VALUE!

error value.

The LEN function returns the number of characters in a text string.

Syntax: LEN(text)

Page 16: Tommy Excelbestfunctions

Copyright 2010 16 Tommy Harrington

Text is the text whose length you want to find. Spaces count as characters.

Text to Columns can sometimes do the same job as string math when it comes to placing

separate parts of a string in individual columns

TEXT

The TEXT function converts a value to text in a specific number format and is usually used

with the & operator to add text to dates in a specific format.

Syntax: TEXT(value,format_text)

Value is a numeric value, a formula that evaluates to a numeric value, or a reference to a

cell containing a numeric value.

Format_text is a number format in text form from in the Category box on the Number tab in

the Format Cells dialog box. Format_text cannot contain an asterisk (*) and cannot be the

General number format.

To display the column heading “Quantity on Hand as of June 30, 2010” with the date

based on a date typed in cell A1, you could write this formula in the column heading cell.

=“Quantity on Hand as of “&TEXT(A1,”mmmm d, yyyy”)

Even if the date in cell A1 were typed and shown as 6/30/02 the column heading would

still display “Quantity on Hand as of June 30, 2002”

The TEXT function can be used to show leading zeros on part numbers or customer

numbers. Example: a number in a cell is 543; this number should be displayed as

0000543. If the number is in cell A2 then enter the following function in cell b2…

=TEXT(A2, “000000”)

Cell B2 now displays 000543 and can be convert to the actual entry by using Paste

Special Values.

Page 17: Tommy Excelbestfunctions

Copyright 2010 17 Tommy Harrington

If your organization needs training, application development, or consulting on Microsoft Office software—Excel, Access, Word, and PowerPoint; for free estimate on any project please contact: Tommy Harrington Email: [email protected] Notes: