Beruflich Dokumente
Kultur Dokumente
Functions
Tommy B. Harrington
104 Azalea Drive
Greenville, NC 27858
Email: tommy@tommyharrington.com
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.
Youll 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 Excels most useful functionsSUMIFS, COUNTIFS, IF, ISNA,
ROUND, VLOOKUP, INDEX, MATCH & the TEXT functions. Learn to use functions and
formulas when working with dates. Youll be amazed at all Excels functions for
summarizing accounting, production, and management information. Learn formulas and
techniques needed to build dashboard programs.
Copyright 2010
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 Excels most valuable functions.
SUM Function
Everyone knows how to use the SUM functionRight? Maybe. Lets 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 dont have blank rows in the area of your worksheet where you want an
automatic grand total.
Copyright 2010
Tommy Harrington
IF Function
The IF function is possibility the most powerful function in Excel. Lets 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.
1.
2.
3.
4.
5.
6.
7.
8.
Click on cell D5
Type =if(
Click on cell B5
Type =0,0,
Click on cell C5
Type /
Click on cell B5
Type ) or press Enter
If you want the cell to be blank rather than show 0, replace Step 4 as shown below:
4. Type =0,,
Copyright 2010
Tommy Harrington
The formula in cell F2 which summarizes units sold is written and copied as shown below;
1.
2.
3.
4.
Click on cell F2
Type =sumif(
Paint cells in column A which could contain the word Acme
Press the function key F4 making the range absolute (when copied it will not
change)
Copyright 2010
Tommy Harrington
5.
6.
7.
8.
9.
Type a comma
Click on cell E2 which contain the word to find
Type a comma
Paint the cells in column C containing the units to be added if a match is found
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.
Tommy Harrington
VLOOKUP Function
The VLOOKUP function does a great deal of work for us in Excel. Its 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:
Copyright 2010
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)
Copyright 2010
Tommy Harrington
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.
Copyright 2010
Tommy Harrington
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.
Copyright 2010
10
Tommy Harrington
1.
2.
3.
4.
5.
6.
Click on cell B1
Type =PROPER(
Press the Left arrow on your keyboard one time
Type )
Press Enter
Make sure you are still on cell B1
13. Click OK
Copyright 2010
11
Tommy Harrington
When values are pasted, the supporting formulas in the copy range are no longer needed
in the case.
Copyright 2010
12
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)
Copyright 2010
13
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.
Copyright 2010
14
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"
Copyright 2010
15
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.
Copyright 2010
16
Tommy Harrington
Copyright 2010
17
Tommy Harrington