Professional Documents
Culture Documents
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
IF Function Samples
Basic If Function Explained - Select D11 and click [fx]
8/16/2019
Employee Hire date Insurance Deduction In this sample, the IF function is checking Formula in cell D11: =IF(C11="Yes",235,0)
Garcia, Jorge 3/1/2008 Yes 235.00 to see if they have signed up for insurance. C11="Yes" - testing to see if C11 contains the word Yes
If they have, the deduction amount is
Jones, Joe 11/1/2005 No 0.00 entered. 235 - the value entered if C11 contains Yes
Singh, Lisa 6/1/2003 No 0.00 0 - the value entered if it does not
Smith, John 2/1/2007 Yes 235.00
Boni Mays
Fayetteville Technical Community College 2 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. Fv is the future value and is assumed to be zero if
omitted. Type indicates when payments are due. Omitted or zero if payments are made at the end of the period, 1 if at the beginning.
Payment for Loan w/Balloon Payment Explained - Select B18 and click [fx]
Payment: $1,162.94 Formula in B18: =-PMT(B20/B22,B23,B19,B24)
Loan Amount $200,000 Rate, nper, and pv are as above, but because this loan has a lump sum payment due at the end of the loan, we have
Interest Rate 5.50% added the fv argument to contain that value.
Number of years 30
Payments per year 12
Total Payments 360
Balloon Payment $25,000
Monthly Deposit to Reach Savings Goal Explained - Select B27 and click [fx]
Payment: $357.80 Formula in B27: =-PMT(B29/B31,B32,0,B28)
Savings Goal $50,000 This time we are depositing money to reach a savings goal, so the pv is 0 and the fv is the amount we want to have in
Interest Rate 3.00% savings at the end of the given number of years.
Number of years 10
Payments per year 12
Total Payments 120
Payment for Home Loan in Canada Explained - Select B35 and click [fx]
Payment: $1,566.01 Formula in B35: =-PMT(((1+(B37/2))^2)^(1/12)-1,B40,B36)
Loan Amount $250,000 Canadians have this complicated compounded semi-annually thing so we can't just divide by the number of periods but
Interest Rate 6.50% have to use this fancier calculation for the rate argument:
Number of years 30 ((1+(B37/2))^2)^(1/12)-1
Payments per year 12 Compared to our first loan calculation, you can see that it actually saves them a bit, so is worth the extra work.
Boni Mays
Fayetteville Technical Community College 3 www.maysstuff.com
Total Payments 360
Boni Mays
Fayetteville Technical Community College 4 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.
EOMONTH Gives the end of month date for a date plus a given number of months.
8/16/2019 0 8/31/2019 is the last day in this month. =EOMONTH(A18,B18) EOMONTH(start date, months)
8/16/2019 1 9/30/2019 is next months end of month date. =EOMONTH(A19,B19)
8/16/2019 3 11/30/2019 is the end of month date for three months from now. =EOMONTH(A20,B20)
WORKDAY Returns a date that is the given number of working days before or after a date.
8/16/2019 5 8/9/2019 is the date 5 work days before today. =WORKDAY(A27,-B27) WORKDAY(start date, days, holidays)
8/16/2019 45 10/18/2019 is the date 45 work days from today. =WORKDAY(A28,B28) Holidays is an optional range containing dates to
exclude.
Boni Mays
Fayetteville Technical Community College 5 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.
VLOOKUP 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.
Lookup value 2006 Jan Feb Mar VLOOKUP(lookup value, table, col num, range lookup)
Column num 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.
Returned 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.
Customer ID 3333 To see the Customer Name and Address information change, enter a Customer ID from the following in cell B8:
Customer Name Ella Arteaga 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)
Shipping Address The customer name in cell B9 is taken from the table on the Lookup Tables sheet. Because the first and last name are
Address 1 58 Langley Avenue listed in separate columns, we are looking them up separately and then using the concatenation operator (&) to put
City Aurora them together with a space in between.
State NC Function in cell B12: =VLOOKUP($B$8,'Lookup Tables'!$A$4:$H$14,4,0)
Zip 28307 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.
Customer Order
Item No. Name Price Qty Charge To see order information change, enter an Item No. anywhere in the A19:A24 range.
333 Thingamagig $32.00 2 $64.00 Valid item numbers are: 111, 222, 333, 444, 555, 666, 777, 888, 999, 123. To remove an
111 Widget $28.00 1 $28.00 item from the Customer Order, delete only the item number and quantity.
888 Geehaw $27.00 1 $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 checking to see if an item number has been
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 7 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.
Add Times
13:00 12:00 25:00 is the total of the hours. =A11+B11 [h]:mm;@
MINUTE Returns the minutes of a time. The minute is given as an integer, between 0 and 59.
2:35:27 PM 35 =MINUTE(A18) MINUTE(valid time)
SECOND Returns the seconds of a time. The second is given as an integer between 0 (zero) and 59.
2:35:27 PM 27 =SECOND(A21) SECOND(valid time)
TIME Returns the decimal number for a specific hour, minute, and second combination.
14 2:35:27 PM 0.6079513889 Shown in time and general (decimal) format. =TIME(A24,A25,A26) TIME(hour, minute, second)
35
27
TIMEVALUE Returns the decimal number of the time represented by a text string.
2:35:27 PM 2:35:27 PM =TIMEVALUE(A29) TIMEVALUE(time in text format)
Boni Mays
Fayetteville Technical Community College 8 www.maysstuff.com
Other Functions
Statistical Functions Part Number Type Department Cost Quantity Total Value
Function Syntax Sample Formula Sample Result 11164539 RT Dept 2 55.30 15 829.50
AVERAGE AVERAGE(number1, number2,...) =AVERAGE(I4:I43) 32.60 11164540 AC Dept 5 69.58 7 487.06
Returns the average (arithmetic mean) of the arguments. 11164541 AB Dept 4 47.87 1 47.87
MAX MAX(number1,number2,...) =MAX(J4:J43) 19 11164542 RT Dept 2 16.22 5 81.10
Returns the largest value in a set of values. 11164544 AC Dept 5 54.36 -
MIN MIN(number1,number2,...) =MIN(I4:I43) 0.84 11164545 DE Dept 5 74.45 13 967.85
Returns the smallest number in a set of values. 11164546 DE Dept 2 52.03 11 572.33
COUNT COUNT(value1, value2,...) =COUNT(J4:J43) 38 11164547 DE Dept 4 25.74 8 205.92
Counts the number of cells that contain numbers 11164548 DB Dept 5 39.12 14 547.68
COUNTA COUNTA(value1, value2,...) =COUNTA(G4:G43) 40 11164549 DE Dept 4 10.97 3 32.91
Counts the number of cells that are not empty. 11164550 DB Dept 1 18.56 12 222.72
SUMIF SUMIF(range, criteria, sum range) =SUMIF(H4:K43,"Dept 1",K4:K43) 1,092.30 11164551 RT Dept 2 45.80 17 778.60
Sum the values in a range that meet specified criteria. 11164556 DE Dept 4 88.39 2 176.78
COUNTIF COUNTIF(range, criteria) =COUNTIF(G4:G43,"RT") 10 11164557 AB Dept 2 79.08 12 948.96
Count the values in a range that meet specified criteria. 11164558 DE Dept 1 15.28 7 106.96
AVERAGEIF AVERAGEIF(range, criteria, average range) =AVERAGEIF(G4:K43,"RT",I4:I43) 33.13 11164559 AC Dept 1 2.77 15 41.55
Average the values in a range that meet specified criteria. 11164560 RT Dept 5 40.96 -
11164561 RT Dept 3 25.07 12 300.84
Text Functions 11164562 DE Dept 2 0.84 12 10.08
President George Washington, United States of America (A23 contains sample text for text functions) 11164563 DE Dept 1 9.42 3 28.26
Function Syntax Sample Formula Sample Result 11164564 AC Dept 5 16.02 7 112.14
FIND FIND(find text ,within text, start with num) =FIND(",",A23) 28 11164565 RT Dept 2 77.83 4 311.32
Locate text within a text entry and returns the number of the starting position of the text within that entry. 11164567 AB Dept 3 1.54 15 23.10
LEFT LEFT(text, num chars) =LEFT(A23,9) President 11164568 AC Dept 1 9.81 1 9.81
Returns the number of leftmost characters specified. 11164569 DE Dept 3 1.77 8 14.16
LEN LEN(text) =LEN(A23) 53 11164570 DB Dept 3 7.99 13 103.87
Returns the number of characters in a text entry. 11164571 DE Dept 5 23.54 10 235.40
MID MID(text, start num, num chars) =MID(A23,18,10) Washington 11164572 AB Dept 4 71.10 4 284.40 53
Returns the specified number of characters from a text entry, beginning with the specified character number. 11164574 RT Dept 1 64.64 5 323.20 24
RIGHT RIGHT(text, num chars) =RIGHT(A23,7) America 11164575 AB Dept 5 50.87 19 966.53 29
Returns the number of rightmost characters specified. 11164579 AC Dept 4 27.60 3 82.80 United States of America
11164580 DE Dept 4 46.85 9 421.65 President George Washington
Use the text functions together to work with variable text lengths in a column. This formula will always return 11164581 RT Dept 4 1.18 16 18.88
the text following a comma/space in a text entry: =RIGHT(A38,(LEN(A38)-FIND(",",A38)-1)) 11164582 AB Dept 1 35.00 10 350.00 11
President George Washington, United States of America United States of America 11164583 DE Dept 2 12.13 13 157.69
USS Enterprise, Starfleet Command Starfleet Command 11164584 DB Dept 4 51.16 5 255.80 Starfleet Command
I think that I will never see, a poem as lovely as a tree. a poem as lovely as a tree. 11164585 DB Dept 3 27.88 2 55.76 USS Enterprise
Using the first example above, it works by taking the length of the text (53) and subtracting the number of 11164586 RT Dept 3 2.31 16 36.96
characters up to the comma (28) and an extra 1 for the space, and then returning that number (24) of characters 11164587 RT Dept 1 1.96 5 9.80
from the right end of the text. 11164591 AC Dept 3 0.92 4 3.68
Part Number Type Department Cost Quantity Total Value Vlookup function with valid data:
11164539 RT Dept 2 55.30 15 829.50 Enter Part Number: 11164539
11164540 AC Dept 5 69.58 7 487.06
11164541 AB Dept 4 47.87 1 47.87 Type: RT
11164542 RT Dept 2 16.22 5 81.10 Department: Dept 2
11164544 AC Dept 5 54.36 - Cost: $55.30
11164545 DE Dept 5 74.45 13 967.85 Quantity: 15
11164546 DE Dept 2 52.03 11 572.33
11164547 DE Dept 4 25.74 8 205.92 Vlookup function with invalid data:
11164548 DB Dept 5 39.12 14 547.68 Enter Part Number: 11160000
11164549 DE Dept 4 10.97 3 32.91
11164550 DB Dept 1 18.56 12 222.72 Type: #N/A
11164551 RT Dept 2 45.80 17 778.60 Department: #N/A
11164556 DE Dept 4 88.39 2 176.78 Cost: #N/A
11164557 AB Dept 2 79.08 12 948.96 Quantity: #N/A
11164558 DE Dept 1 15.28 7 106.96
11164559 AC Dept 1 2.77 15 41.55 If a lookup value is not found, vlookup returns the #N/A error. For cases when
11164560 RT Dept 5 40.96 - this is not acceptable, IFERROR allows you to set an alternate value.
11164561 RT Dept 3 25.07 12 300.84
11164562 DE Dept 2 0.84 12 10.08 Vlookup nested in Iferror:
11164563 DE Dept 1 9.42 3 28.26 Formula in I39: =IFERROR(VLOOKUP(I37,A16:F42,2), "Invalid Part #")
11164564 AC Dept 5 16.02 7 112.14 Formula in I40: =IF(I39= "Invalid Part #","",VLOOKUP(I37,A16:F42,3))
11164565 RT Dept 2 77.83 4 311.32 Enter Part Number: 11160000
11164567 AB Dept 3 1.54 15 23.10
11164568 AC Dept 1 9.81 1 9.81 Type: Invalid Part #
11164569 DE Dept 3 1.77 8 14.16 Department:
11164570 DB Dept 3 7.99 13 103.87 Cost:
Boni Mays
Fayetteville Technical Community College 10 www.maysstuff.com
11164571 DE Dept 5 23.54 10 235.40 Quantity:
Boni Mays
Fayetteville Technical Community College 11 www.maysstuff.com
Tables for VLOOKUP Sample
Customers
ID Last Name First Name Address City State Zip Code Phone
3333 Arteaga Ella 58 Langley Avenue Aurora NC 28307 (910) 413-4728
2222 Barrington Cindy 271 Latrell Road Baltimore NC 28306 (910) 428-4137
7777 Bruner Myra 182 Birchwood Street Refugio NC 28305 (910) 331-5052
5555 Caruso Jill 524 Ridge Road Spring Lake NC 28390 (910) 420-9063
6666 Charlton Kara 52 Hiroko Street Spring Lake NC 28390 (910) 384-4911
1234 Getty William 81 Columbus Road Buena Vista NC 28304 (910) 475-4153
1111 Givens Bryan 72 White Eagle Street Fayetteville NC 28301 (910) 456-5660
4444 Haller Geneva 985 Lisa Street Spring Lake NC 28390 (910) 357-3062
9999 Keane Vickie 47 Carolyn Avenue Middleton NC 28309 (910) 473-7752
8888 Mai Tony 732 Oregon Street Madison NC 28302 (910) 350-9309
Products
Item No Name Price
111 Widget $28.00
222 Gadget $21.00
333 Thingamagig $32.00
444 Whatsit $12.00
555 Thingy $21.00
666 Dohickey $47.00
777 Doodad $31.00
888 Geehaw $27.00
999 Wadget $55.00
123 Yaknow $14.00
Boni Mays
Fayetteville Technical Community College 12 www.maysstuff.com