Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
32 views

Spreadsheet Functions - All Functions

The document discusses various spreadsheet functions in Microsoft Excel including commonly used functions like SUM, AVERAGE, COUNT, MAX, and MIN. It explains how to write functions and defines their syntax and arguments. It also covers more advanced functions like COUNTIF, COUNTIFS, IF, and VLOOKUP providing examples of their use and syntax.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Spreadsheet Functions - All Functions

The document discusses various spreadsheet functions in Microsoft Excel including commonly used functions like SUM, AVERAGE, COUNT, MAX, and MIN. It explains how to write functions and defines their syntax and arguments. It also covers more advanced functions like COUNTIF, COUNTIFS, IF, and VLOOKUP providing examples of their use and syntax.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Spreadsheet Functions

Using Microsoft Excel


What is a Function?
• A function is a predefined formula that performs calculations using
specific values in a particular order.
• Common functions used in spreadsheet are the sum, average, count,
maximum value, and minimum value for a range of cells.
• In order to use functions correctly, you'll need to understand the
different parts of a function and how to create arguments to calculate
values and cell references.
How to write a Function?
• A function must be written a specific way, which is called the syntax.
The basic syntax for a function is the equals sign (=), the function
name (SUM, for example), and one or more arguments.
Arguments contain the
information you want to
calculate. The function
in the example shown
would add the values of
the cell range A1:A20.
How to write a Function?
• Arguments can refer to both individual cells and cell ranges and must
be enclosed within parentheses. You can include one argument or
multiple arguments, depending on the syntax required for the function.
• For example, the function =AVERAGE(B1:B4) contains only one
argument. Multiple arguments must be separated by a comma. For
example, the function =SUM(A1:A3, C1:C2, E1) has three arguments.
Commonly used Functions
• There are a variety of functions available in Excel. Here are some of
the most common functions you'll use:
Name of Use of Function
Function
SUM This function adds all of the values of the cells in the
argument. For example, =SUM(A2:A5)
AVERAGE This function determines the average of the values
included in the argument. It calculates the sum of the
cells and then divides that value by the number of cells
in the argument. For example, =AVERAGE(A2:A5)
Commonly used Functions
Name of Use of Function
Function
COUNT This function counts the number of cells with numerical
data in the argument. This function is useful for quickly
counting items in a cell range. For example,
=COUNT(B2:B4)
COUNTA This function works in a similar way to the COUNT function
with a slight difference. Rather than just being able to count
the number of numeric values (like the COUNT function),
COUNTA can count the number of numeric or text vales in
a cell. For example, =COUNTA(A2:A4)
Commonly used Functions
Name of Use of Function
Function
MAX This function determines the highest cell
value included in the argument. For example,
=MAX(A2:A5)
MIN This function determines the lowest cell
value included in the argument. For example,
=MIN(A2:A5)
Advance Spreadsheet
Functions
COUNTIF
Use of Function & Syntax

It counts the number of cells that meet a certain criteria, for


example: count the number of times that a number appears.
The syntax for the COUNTIF function is:
=COUNTIF(RANGE,CRITERIA)
In its simplest form, COUNTIF says:
=COUNTIF(Where to look?, What to look for?)
COUNTIF
Use of Function & Syntax
Examples of the COUNTIF function:

=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:

Criteria_range1 – Required. The first range in which to evaluate the


associated criteria.
Criteria1 – Required. The criteria in the form of a number, expression,
cell reference, or text that define which cells will be counted. For
example, criteria can be expressed as 32, ">32", B4, "apples", or "32".
• criteria_range2, criteria2 – Contains additional ranges and their
associated criteria. Up to 127 range/criteria pairs are allowed.
COUNTIF FUNCTION
• Example of the COUNTIFS function is:
• =COUNTIFS(A2:A12,A5,B2:B12,B5)

• This would count the number of times, that


both ‘2003’ (the value in A5), and banana (the
value in B5) occurs together in cells A2
through A12. The result is 2.

• Important: Each additional range must have


the same number of rows and columns as
the criteria_range1 argument. The ranges do
not have to be adjacent to each other.
IF FUNCTION
• The IF function is one of the most popular functions in Excel
• It allows you to make logical comparisons between a value
and what you expect.

• A logical function can return only one of two values: TRUE or


FALSE
• IF statement can have two results. The first result is if your
comparison is True, the second if your comparison is False.
IF FUNCTION
• The syntax of an IF function have three arguments:
=IF(logical_test,value_if_true, value_if_false)

1. logical_test: TEST something, such as the value in a cell


2. value_if_true: Specify what should happen if the test result is TRUE.
3. value_if_false: Specify what should happen if the test result is FALSE.
IF FUNCTION
The operators in the logical_test of the IF function may be:

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)

• If the logical_test is TRUE, or in other words if the value of B2 is greater


than or equal to 1000, than the function returns a value of 100

• If the logical_test is FALSE, or in other words if the value of B2 is not


greater than or equal to 1000, than the function returns a value of 50
IF FUNCTION
Example: Consider the following IF function:

• Consider the following IF function: =IF(B2>=1000,B2*0.1,B2*0.05)

• If the Logical_test is TRUE, or in other words if the value of B2 is


greater than or equal to 1000, then the function returns 10% of B2

• If the Logical_test is FALSE, or in other words if the value of B2 is not


greater than or equal to 1000, than the function returns 5% of the
value of B2
VLOOKUP FUNCTION
 VLOOKUP (Vertical Lookup) function is a tool used to search for
specific information in your spreadsheet. VLOOKUP searches for a
value in the first column of a range and returns a value in the same
row from a specified column.

 Use VLOOKUP when you need to find things in a table or a range by


row. For example, look up a price of an automotive part by the part
number, or find an employee name based on their employee ID.
Syntax of The VLOOKUP FUNCTION

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

 In its simplest form, the VLOOKUP function says:


 lookup_value – What you want to look up?
 table_array – where you want to look for it?
 col_index_num – the column number in the range containing
the value to return
 range_lookup – return an Approximate or Exact match –
indicated as 1/TRUE, or 0/FALSE).
VLOOKUP FUNCTION RETURNS
 The VLOOKUP function returns any datatype such as a string, numeric, date, etc

 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.

 If index_number is less than 1, the VLOOKUP function will return #VALUE!

 If index_number is greater than the number of columns in table, the VLOOKUP


function will return #REF!
VLOOKUP Arguments
➢lookup_value - this is the value we are going to look for in our
lookup table. For our examples we might want to look up our
exam score in order to find out our grade.
➢table_array - this is the set of cells which contains all of the
possible grades and scores, along with any other information we
might want to return.
➢col_index_num - this is the number of the column in our table
which contains the answer we want to get.
➢[range_lookup] - this argument lets us tell Excel whether we are
looking for an exact match or not.
VLOOKUP Example 2
➢This example is taken form 2021 January CSEC IT paper 2:

➢Complete the missing parameter in the VLOOKUP formula for


Cell B10 of Worksheet 2 to find the amount of sales made during
the month of March by the salesperson in Cell A10
= VLOOKUP(_ _, _, , ).

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.

Relative and absolute references behave differently when copied and


filled to other cells.
Relative references change when a formula is copied to another cell.
Absolute references, on the other hand, remain the same, no matter
where they are copied.
Relative and Absolute Cell References
By default, all cell references are relative references.

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.

Relative references are especially convenient whenever you need


to repeat the same calculation across multiple rows or columns.
Relative and Absolute Cell References
There may be times when you do not want a cell reference to change
when filling cells.

Unlike relative references, absolute references do not change when


copied or filled.

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.

$A$2 The column and row do not change when copied


A$2 The row does not change when copied
$A2 The column does not change when copied

You might also like