Spreadsheet Functions - All Functions
Spreadsheet Functions - All Functions
=COUNTIF(A3:A14,C3), =COUNTIF(A3:A14,"=Banana")
=COUNTIF(B20:B31,C23), =COUNTIF(B20:B31,">125")
COUNTIFS
Use of Function & Syntax
The COUNTIFS function applies criteria to cells across
multiple ranges and counts the number of times all criteria
are met.
=COUNTIFS(A39:A50,C39,B39:B50,C42)
Advance Spreadsheet Functions
Name of Use of Function
Function
IF Change the value of a cell if something is true, for
example: It can state pass or fail depending on if a
student pass of fail an exam:
=IF(A2>B2,“Pass",“Fail")
VLOOKUP Matches contents of a cell with an answer, eg how
much is a pepperoni pizza?
PMT The Excel PMT function is a financial function that
returns the payment for a loan.
COUNTIF FUNCTION
• The format (syntax) of the COUNTIF function is:
• =COUNTIF(RANGE,CRITERIA), In its simplest form, COUNTIF says:
• =COUNTIF(Where do you want to look?, What do you want to look for?)
• For example: =COUNTIF(A2:A5,“Orange") or =COUNTIF(A2:A7,C3)
COUNTIF FUNCTION
• Other ways the COUNTIF function can be used are:
• =COUNTIF(B2:B7,">40")
• Counts the number of cells with a value greater than 40 in cells B2
through B7. The result is 4.
COUNTIF FUNCTION
• Other ways the COUNTIF function can be used are:
• =COUNTIF(A2:A7,A2)+COUNTIF(A2:A7,A3)
• This would count the number of orange (the value in A2), and
banana (the value in A3) in cells A2 through A7. The result is 5.
• The COUNTIFS function could have been used to get this result.
COUNTIFS FUNCTION
• The format (syntax) of the COUNTIF function is:
• =COUNTIFS(criteria_range1, criteria1, [criteria_range2,
criteria2])
• The COUNTIFS function syntax has the following arguments:
Operators Function
= Equals to
<> Not Equals to
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
IF FUNCTION
• Example: Consider the following IF function:
• =IF(B2>=1000,100,50)
There are four arguments inside a VLOOKUP function, but only the
first three are required.
=VLOOKUP(lookup_value, table_array, col_index_num,[range_lookup])
=VLOOKUP(What you want to look up, where you want to look
for it, the column number in the range containing the value to
return, return an Approximate or Exact match – indicated as
1/TRUE, or 0/FALSE).
Syntax of The VLOOKUP FUNCTION
If you specify FALSE for the approximate_match parameter and no exact match
is found, then the VLOOKUP function will return #N/A.
If you specify TRUE for the approximate_match parameter and no exact match is
found, then the next smaller value is returned.
NB:
➢Students were required to write out the four parameters in the
space provided. The spreadsheet is on the next slide.
VLOOKUP Example 1
➢Suppose we want to find what score we need to get in order to
achieve a certain grade in the table below.
➢Cell E1 will be used to type the grade we are looking for (A, B, C, D,
E, or F) and The VLOOKUP function will be typed in cell E2
VLOOKUP Example 1
➢We will begin by typing A in cell E1 and the following formula in cell
E2: =VLOOKUP(E1,A1:B7,2,FALSE)
VLOOKUP Example 1
➢The result would be given as: 90-100
VLOOKUP Example 1
➢We can type any grade in cell E1 and it will return the correct
grade for us:
VLOOKUP Example 2
➢This is the spreadsheet for the question above:
VLOOKUP Example 2
➢= VLOOKUP(A10, $A$3:E7,4 , FALSE)
VLOOKUP Example 2
➢The output would be: 1600
VLOOKUP FUNCTION
VLOOKUP is a function that performs a vertical look-up of data
VLOOKUP should be used when the values you wish to compare
your data with are stored in a single column
The values to be looked up are stored in the columns to the right of
the comparison values.
The VLOOKUP function searches for a value in the leftmost
column of a table, and then returns a value in the same row from a
column you specify in a data table or a range by row.
The look-up values can be stored in the same spreadsheet file or in
a different spreadsheet file.
PMT FUNCTION
The PMT function in a is a financial function that
calculates the payment for a loan based on constant
payments and a constant interest rate.
This function is widely used for calculating
mortgages, car loans, personal loans, etc.
The format (syntax) of the PMT function is:
=PMT(rate, nper, pv, [fv], [type])
=PMT(rate, nper, pv, [fv], [type])
rate: The interest rate for the loan per period.
nper: The total number of payments for the loan.
pv: The present value, or the total amount that a series of
future payments is worth now; also known as the principal.
fv (optional): The future value, or a cash balance you want to
attain after the last payment is made. If omitted, it is assumed
to be 0, meaning the loan is fully paid off.
type (optional): When payments are due. 0 = end of the period
(default), 1 = beginning of the period.
PMT FUNCTION
Example: Consider the following PMT function:
Consider a loan of $200,000 at an annual (yearly) interest rate
of 10%, to be paid off over a period of 5 years (60 months).
rate: 10% yearly interest rate, but since payments are made
monthly, we divide by the percent by 12: 10%/12 or 0.1/12.
nper: 5 years by 12 months(5*12): = 60 months.
pv: the present value is: $200,000 (the loan amount).
The PMT formula will look like this: =PMT(0.1/12, 60, 200000)
Relative and Absolute Cell References
There are two types of cell references: relative and absolute.
When copied across multiple cells, they change based on the relative
position of rows and columns. For example, if you copy the formula
=A1+B1 from row 1 to row 2, the formula will become =A2+B2.
You can use an absolute reference to keep a row and/or column the
same.
Relative and Absolute Cell References
An absolute reference is created in a formula by the addition of a
dollar sign ($) before the column and row.
If it precedes the column or row (but not both), it's known as a
mixed reference. Mixed references are used less frequently.