Documente Academic
Documente Profesional
Documente Cultură
The insert function button on the formula bar opens the Insert Function dialog box. Type in
what you want to do and click Go or hit Enter and Excel will give you a list of possible
functions. In the sample dialog box to the right, I searched for a function to find data in a
table. Excel returned four possibilities. Click the function name to see the function syntax
and a brief description. If you're not sure what all that means, click the Help on this function
link to see more information and samples of the function at work.
When you click OK, Excel will open the Functions Argument dialog box for the selected
function to help you enter the function arguments correctly. As you move the insertion
point through the arguments, Excel will give a description of what is expected. You also have
the opportunity to click for more Help on this function.
Argument labels in bold text are required arguments. Once you have entered all required
arguments, click OK and the function is entered in your worksheet.
Argument descriptions
Boni Mays
Fayetteville Technical Community College
www.maysstuff.com
IF
The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that condition evaluates to FALSE.
Syntax: IF(logical test, value if true, value if false)
The logical test can use any combination of values, cell references, and comparison operators that can be evaluated as true or false.
IF Function Samples
Basic If Function
5/4/2016
Employee
Hire date
Garcia, Jorge
3/1/2008
Jones, Joe
11/1/2005
Singh, Lisa
6/1/2003
Smith, John
2/1/2007
Insurance
Yes
No
No
Yes
Deduction
235.00
0.00
0.00
235.00
If Function - Nested
5/4/2016
Employee
Hire date
Garcia, Jorge
3/1/2008
Jones, Joe
11/1/2005
Singh, Lisa
6/1/2003
Smith, John
2/1/2007
Insurance
Self
Family
Self
No
Deduction
235.00
505.00
235.00
0.00
Meeting Day
Tuesday
Thursday
Tuesday
Thursday
Boni Mays
Fayetteville Technical Community College
Team
A
B
C
D
www.maysstuff.com
Boni Mays
Fayetteville Technical Community College
www.maysstuff.com
PMT
The PMT function calculates the payment for a loan based on constant payments and a constant interest rate.
Syntax: PMT(rate, nper, pv, fv, type)
Rate is the interest rate per period for the loan. Nper is the total number of payments. Pv is the present value or principal.
omitted. Typeindicates when payments are due. Omitted or zero if payments are made at the end of the period, 1 if at the
$1,580.17
$250,000
6.50%
30
12
360
$1,162.94
$200,000
5.50%
30
12
360
$25,000
$357.80
$50,000
3.00%
10
12
120
$1,566.01
$250,000
6.50%
30
12
www.maysstuff.com
Total Payments
Boni Mays
Fayetteville Technical Community College
360
www.maysstuff.com
an. Nper is the total number of payments. Pv is the present value or principal. Fvis the future value and is assumed to be zero if
due. Omitted or zero if payments are made at the end of the period, 1 if at the beginning.
www.maysstuff.com
Boni Mays
Fayetteville Technical Community College
www.maysstuff.com
Date Functions
Dates in Excel are actually stored as values, making it easy to do calculations with dates when all you're doing is adding or subtracting number of days. For the other things you
might want to do with dates, there are a variety of functions available to help. Here are a few you might find useful.
Formula in Column C
90
3046
8/2/2016
=A8-B8
=A11+B11
Date Functions
Function in Column C
Function Syntax
EDATE
Function in Column C
=EDATE(A15,B15)
EOMONTH
5/4/2016
5/4/2016
5/4/2016
NETWORKDAYS
Returns the number of full workdays between two dates.
5/4/2016
5/31/2016
20
is the number of workdays between these dates
5/4/2016
WORKDAY
5/4/2016
6/30/2016
42
Returns a date that is the given number of working days before or after a date.
5
4/27/2016 is the date 5 work days before today.
5/4/2016
45
7/6/2016
MONTH
=NETWORKDAYS(A23,B23)
=NETWORKDAYS(A24,B24)
=WORKDAY(A27,-B27)
=WORKDAY(A28,B28)
=EOMONTH(A18,B18)
=EOMONTH(A19,B19)
=EOMONTH(A20,B20)
Function in Column B
Function Syntax
=DAY(A32)
DAY(valid date)
5/4/2016
=MONTH(A35)
MONTH(valid date)
5/4/2016
=YEAR(A38)
YEAR(valid date)
=TODAY()
TODAY()
=NOW()
NOW()
YEAR
TODAY
NOW
Boni Mays
Fayetteville Technical Community College
www.maysstuff.com
Lookup Functions
There are a number of functions in Excel that allow you to search for information in a table of data. Here are the two most used lookup functions.
Function
Description
HLOOKUP
Lookup value
Row num
Searches for a value in the top row of a table of values, and then returns a value in the same column from a row you specify.
Feb
Jan
Feb
Mar
HLOOKUP(lookup value, table, row num, range lookup)
2
2005
2,195
2,333
1,032
Exact Match
Lookup value is the value to find in the first row.
2006
1,854
2,939
2,040
Function in B9:
Table is the data table to use for the lookup.
2,333
2007
2,847
1,325
1,203
=HLOOKUP(B6,D6:G9,B7,0)
Row num is the row index number from which to return matching data.
Returned
15 Blue
51 Red
90 Yellow
VLOOKUP
Lookup value
Column num
Function
0
Blue
25
Green
50
Red
75
Yellow
Approximate Match
Functions in Col B:
=HLOOKUP(A11,D11:G12,2)
=HLOOKUP(A12,D11:G12,2)
=HLOOKUP(A13,D11:G12,2)
Function Syntax
Searches for a value in the first column of a table of values, and then returns a value in the same row from a column you specify.
2006
Jan
Feb
Mar
VLOOKUP(lookup value, table, col num, range lookup)
2
2005
2,195
2,333
1,032
Exact Match
Lookup value is the value to find in the first column.
2006
1,854
2,939
2,040
Function in B20:
Table is the data table to use for the lookup.
1,854
2007
2,847
1,325
1,203
=VLOOKUP(B17,D17:G20,B18,0)
Col num is the column index number from which to return data.
Returned
Average
Grade
83
72
99
55
90
B
C
A
E
A
Boni Mays
Fayetteville Technical Community College
Score
0
60
70
80
90
Grade
E
D
C
B
A
Approximate Match
Functions in Col B:
=VLOOKUP(A22,$D$22:$E$26,2)
=VLOOKUP(A23,$D$22:$E$26,2)
=VLOOKUP(A24,$D$22:$E$26,2)
=VLOOKUP(A25,$D$22:$E$26,2)
=VLOOKUP(A26,$D$22:$E$26,2)
www.maysstuff.com
VLOOKUP
The lookup table can be on a different worksheet or even a separate workbook. This example is returning information from the Lookup Table
practical use for lookup functions.
Syntax: VLOOKUP(lookup value, table, col num, range lookup)
Customer ID
Customer Name
Address 1
City
State
Zip
3333
Ella Arteaga
Shipping Address
58 Langley Avenue
Aurora
NC
28307
Customer Order
Item No.
333
111
888
Name
Thingamagig
Widget
Geehaw
Price
$32.00
$28.00
$27.00
Qty
2
1
1
Charge
$64.00
$28.00
$27.00
Cells B19 and C19 contain only the VLOOKUP formula, but cells B20 through C24 have the VLOOKUP nested in an IF function.
To see why the IF function was added around the VLOOKUP, delete the Item No. in cell A19.
If VLOOKUP does not have a lookup value, it returns the #N/A error message. It looks better to have a blank cell, so the IF function is checki
entered. If so, it looks up the item number in the table. If not, it makes the cell look blank by entering "" (zero length string).
Boni Mays
Fayetteville Technical Community College
10
www.maysstuff.com
separate workbook. This example is returning information from the Lookup Tables worksheet to offer an example of a
To see the Customer Name and Address information change, enter a Customer ID from the following in cell B8:
1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 1234
Function in Cell B9: =VLOOKUP(B8,'Lookup Tables'!A4:H14,3,0)&" "&VLOOKUP(B8,'Lookup Tables'!A4:H14,2,0)
The customer name in cell B9 is taken from the table on the Lookup Tables sheet. Because the first and last name are
listed in separate columns, we are looking them up separately and then using the concatenation operator (&) to put
them together with a space in between.
Function in cell B12: =VLOOKUP($B$8,'Lookup Tables'!$A$4:$H$14,4,0)
The lookup value ($B$8) and the table ('Lookup Tables'!$A$4:$H$14) were changed to absolute references so that we
could copy to create the following three address formulas. After copy, we only had to edit the col num.
To see order information change, enter an Item No. anywhere in the A19:A24 range.
Valid item numbers are: 111, 222, 333, 444, 555, 666, 777, 888, 999, 123. To remove an
item from the Customer Order, delete only the item number and quantity.
A error message. It looks better to have a blank cell, so the IF function is checking to see if an item number has been
ot, it makes the cell look blank by entering "" (zero length string).
Boni Mays
Fayetteville Technical Community College
11
www.maysstuff.com
Time Functions
Time in Excel is actually stored as a decimal number ranging from 0 (zero) to 0.99999999, representing the times from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M
As with dates, you can do standard math, adding and subtracting hours, easily with Excel. Functions are available for when you need to do more.
Here are a few you might find useful.
Formula in Column C
5:00 PM
7:30
12:00
25:00
=B8-A8
=A11+B11
Add Times
13:00
Time Functions
HOUR
Function in Column B
Returns the hour of a time. The hour is given as an integer, between 0 (12:00 A.M.) and 23 (11:00 P.M.).
2:35:27 PM
14
=HOUR(A15)
MINUTE
2:35:27 PM
Returns the minutes of a time. The minute is given as an integer, between 0 and 59.
35
=MINUTE(A18)
2:35:27 PM
Returns the seconds of a time. The second is given as an integer between 0 (zero) and 59.
27
=SECOND(A21)
Returns the decimal number for a specific hour, minute, and second combination.
2:35:27 PM 0.6079513889 Shown in time and general (decimal) format.
=TIME(A24,A25,A26)
=TIMEVALUE(A29)
SECOND
TIME
14
35
27
TIMEVALUE
2:35:27 PM
NOW
Boni Mays
Fayetteville Technical Community College
12
www.maysstuff.com
, representing the times from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M.).
[h]:mm;@
Function Syntax
HOUR(valid time)
MINUTE(valid time)
SECOND(valid time)
NOW()
No arguments.
Boni Mays
Fayetteville Technical Community College
13
www.maysstuff.com
Other Functions
Statistical Functions
Function
Syntax
AVERAGE
AVERAGE(number1, number2,...)
Returns the average (arithmetic mean) of the arguments.
MAX
MAX(number1,number2,...)
Returns the largest value in a set of values.
Sample Formula
=AVERAGE(I4:I43)
MIN
MIN(number1,number2,...)
Returns the smallest number in a set of values.
COUNT(value1, value2,...)
COUNT
Counts the number of cells that contain numbers
COUNTA(value1, value2,...)
COUNTA
=MIN(I4:I43)
Sample Result
32.60
19
=MAX(J4:J43)
0.84
=COUNT(J4:J43)
38
=COUNTA(G4:G43)
40
1,092.30
=SUMIF(H4:K43,"Dept 1",K4:K43)
COUNTIF
COUNTIF(range, criteria)
Count the values in a range that meet specified criteria.
=COUNTIF(G4:G43,"RT")
AVERAGEIF
AVERAGEIF(range, criteria, average range)
Average the values in a range that meet specified criteria.
=AVERAGEIF(G4:K43,"RT",I4:I43)
10
33.13
Text Functions
President George Washington, United States of America
Function
Syntax
Sample Formula
Sample Result
FIND(find text ,within text, start with num)
FIND
=FIND(",",A23)
28
Locate text within a text entry and returns the number of the starting position of the text within that entry.
LEFT(text, num chars)
=LEFT(A23,9)
President
LEFT
Returns the number of leftmost characters specified.
LEN(text)
=LEN(A23)
LEN
53
Returns the number of characters in a text entry.
MID(text, start num, num chars)
=MID(A23,18,10)
Washington
MID
Returns the specified number of characters from a text entry, beginning with the specified character number.
RIGHT(text, num chars)
=RIGHT(A23,7)
America
RIGHT
Returns the number of rightmost characters specified.
Use the text functions together to work with variable text lengths in a column. This formula will always return
the text following a comma/space in a text entry:
=RIGHT(A38,(LEN(A38)-FIND(",",A38)-1))
President George Washington, United States of America
United States of America
USS Enterprise, Starfleet Command
Starfleet Command
I think that I will never see, a poem as lovely as a tree.
a poem as lovely as a tree.
Using the first example above, it works by taking the length of the text (53) and subtracting the number of
characters up to the comma (28) and an extra 1 for the space, and then returning that number (24) of characters
from the right end of the text.
Boni Mays
Fayetteville Technical Community College
14
DE
DE
AC
RT
AB
AC
DE
DB
DE
AB
RT
AB
AC
DE
RT
AB
DE
DB
DB
RT
RT
AC
Department Cost
Quantity Total Value
Dept 2
55.30
15
829.50
Dept 5
69.58
7
487.06
Dept 4
47.87
1
47.87
Dept 2
16.22
5
81.10
Dept 5
54.36
Dept 5
74.45
13
967.85
Dept 2
52.03
11
572.33
Dept 4
25.74
8
205.92
Dept 5
39.12
14
547.68
Dept 4
10.97
3
32.91
Dept 1
18.56
12
222.72
Dept 2
45.80
17
778.60
Dept 4
88.39
2
176.78
Dept 2
79.08
12
948.96
Dept 1
15.28
7
106.96
Dept 1
2.77
15
41.55
Dept 5
40.96
Dept 3
25.07
12
300.84
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
Dept
2
1
5
2
3
1
3
3
5
4
1
5
4
4
4
1
2
4
3
3
1
3
0.84
9.42
16.02
77.83
1.54
9.81
1.77
7.99
23.54
71.10
64.64
50.87
27.60
46.85
1.18
35.00
12.13
51.16
27.88
2.31
1.96
0.92
12
3
7
4
15
1
8
13
10
4
5
19
3
9
16
10
13
5
2
16
5
4
10.08
28.26
112.14
311.32
23.10
9.81
14.16
103.87
235.40
284.40
323.20
966.53
82.80
421.65
18.88
350.00
157.69
255.80
55.76
36.96
9.80
3.68
www.maysstuff.com
Type
RT
AC
AB
RT
AC
DE
DE
DE
DB
DE
DB
RT
DE
AB
DE
AC
RT
RT
DE
DE
AC
RT
AB
AC
DE
DB
Department
Dept 2
Dept 5
Dept 4
Dept 2
Dept 5
Dept 5
Dept 2
Dept 4
Dept 5
Dept 4
Dept 1
Dept 2
Dept 4
Dept 2
Dept 1
Dept 1
Dept 5
Dept 3
Dept 2
Dept 1
Dept 5
Dept 2
Dept 3
Dept 1
Dept 3
Dept 3
Cost
55.30
69.58
47.87
16.22
54.36
74.45
52.03
25.74
39.12
10.97
18.56
45.80
88.39
79.08
15.28
2.77
40.96
25.07
0.84
9.42
16.02
77.83
1.54
9.81
1.77
7.99
15
Quantity
15
7
1
5
13
11
8
14
3
12
17
2
12
7
15
12
12
3
7
4
15
1
8
13
Total Value
829.50
487.06
47.87
81.10
967.85
572.33
205.92
547.68
32.91
222.72
778.60
176.78
948.96
106.96
41.55
300.84
10.08
28.26
112.14
311.32
23.10
9.81
14.16
103.87
www.maysstuff.com
11164571
Boni Mays
Fayetteville Technical Community College
DE
Dept 5
23.54
16
10
235.40
www.maysstuff.com
Sample Formula
=SUMIFS(F16:F55,B16:B55,"RT",C16:C55,"Dept 2")
Sample Result
2,000.52
4
=COUNTIFS(B16:B55,"RT",C16:C55,"Dept 2")
=AVERAGEIF(B16:F55,"RT",D16:D55)
43.53
=AVERAGEIFS(F16:F55,B16:B55,"RT",C16:C55,"Dept 2")
500.13
See below
11164539
Type:
Department:
Cost:
Quantity:
RT
Dept 2
$55.30
15
11160000
Type:
Department:
Cost:
Quantity:
#N/A
#N/A
#N/A
#N/A
If a lookup value is not found, vlookup returns the #N/A error. For cases when
this is not acceptable, IFERROR allows you to set an alternate value.
Vlookup nested in Iferror:
Formula in I39: =IFERROR(VLOOKUP(I37,A16:F42,2), "Invalid Part #")
Formula in I40: =IF(I39= "Invalid Part #","",VLOOKUP(I37,A16:F42,3))
Enter Part Number:
11160000
Type:
Department:
Cost:
Boni Mays
Fayetteville Technical Community College
17
Invalid Part #
www.maysstuff.com
Quantity:
Boni Mays
Fayetteville Technical Community College
18
www.maysstuff.com
Last Name
Arteaga
Barrington
Bruner
Caruso
Charlton
Getty
Givens
Haller
Keane
Mai
First Name
Ella
Cindy
Myra
Jill
Kara
William
Bryan
Geneva
Vickie
Tony
Address
58 Langley Avenue
271 Latrell Road
182 Birchwood Street
524 Ridge Road
52 Hiroko Street
81 Columbus Road
72 White Eagle Street
985 Lisa Street
47 Carolyn Avenue
732 Oregon Street
City
Aurora
Baltimore
Refugio
Spring Lake
Spring Lake
Buena Vista
Fayetteville
Spring Lake
Middleton
Madison
State
NC
NC
NC
NC
NC
NC
NC
NC
NC
NC
Zip Code
28307
28306
28305
28390
28390
28304
28301
28390
28309
28302
Phone
(910) 413-4728
(910) 428-4137
(910) 331-5052
(910) 420-9063
(910) 384-4911
(910) 475-4153
(910) 456-5660
(910) 357-3062
(910) 473-7752
(910) 350-9309
Products
Item No
111
222
333
444
555
666
777
888
999
123
Name
Widget
Gadget
Thingamagig
Whatsit
Thingy
Dohickey
Doodad
Geehaw
Wadget
Yaknow
Price
Boni Mays
Fayetteville Technical Community College
$28.00
$21.00
$32.00
$12.00
$21.00
$47.00
$31.00
$27.00
$55.00
$14.00
19
www.maysstuff.com