Lecture 03 - Complex Formula
Lecture 03 - Complex Formula
Functions
Lecture 03
Homework:
› Create a report regarding the following topics:
1. Modifying Columns, Rows and Cells
– How to AutoFit column and row. (Width for column, Height for
row). How to modify all rows and columns.
– How to insert, delete, move and hide rows and columns.
– How to wrap text and merging cells.
Introduction
› A simple formula is a mathematical expression with one operator, such as 7+9.
› A complex formula has more than one mathematical operator, such as 5+2*8.
› When there is more than one operation in a formula, the order of operations tells Excel
which operation to calculate first.
› In order to use Excel to calculate complex formulas, you will need to understand the order of
operations
1+1*1–1/1=
The Order of Operations
Order of Operations
› Excel calculates formulas based on the following order of operations:
› Operations enclosed in parentheses
› Exponential calculations (3^2, for example)
› Multiplication and division, whichever comes first
› Addition and subtraction, whichever comes first.
STEP 3
STEP 4
STEP 5
STEP 6
STEP 7
Creating Complex Formulas
› In this example, we will demonstrate how Excel solves a complex formula using the
order of operations. Here, we want to calculate the cost of sales tax for a catering
invoice. To do this, we'll write our formula as =(D2+D3)*0.075 in cell D4. This
formula will add the prices of our items together and then multiply that value by the
7.5% tax rate (which is written as 0.075) to calculate the cost of sales tax.
Creating Complex Formulas
› Excel follows the order of operations and first adds the values inside the
parentheses: (44.85+39.90) = $84.75. It then multiplies that value by the tax
rate: $84.75*0.075. The result will show that the sales tax is $6.36.
Creating Complex Formulas
› Excel follows the order of operations and first adds the values inside the
parentheses: (44.85+39.90) = $84.75. It then multiplies that value by the tax
rate: $84.75*0.075. The result will show that the sales tax is $6.36.
Creating Complex Formulas
› It is especially important to enter complex formulas with the correct order of
operations. Otherwise, Excel will not calculate the results accurately. In our
example, if the parentheses are not included, the multiplication is calculated first
and the result is incorrect. Parentheses are the best way to define which
calculations will be performed first in Excel.
To create a complex formula using the order of
operations:
› In our example below, we will use cell references along with numerical values to
create a complex formula that will calculate the total cost for a catering invoice.
The formula will calculate the cost for each menu item and then add those values
together.
› Select the cell that will contain the formula. In our example, we'll select cell C4.
To create a complex formula using the order of
operations:
› Enter your formula. In our example, we'll type =B2*C2+B3*C3. This formula will
follow the order of operations, first performing the multiplication: 2.29*20 =
45.80 and 3.49*35 = 122.15. It then will add those values together to calculate the
total: 45.80+122.15.
To create a complex formula using the order of
operations:
› Double-check your formula for accuracy, then press Enter on your keyboard. The
formula will calculate and display the result. In our example, the result shows that
the total cost for the order is $167.95.
To create a complex formula using the order of
operations:
› We can add parentheses to any equation to make it easier to read. While it won't
change the result of the formula in this example, we could enclose the
multiplication operations within parentheses to clarify that they will be calculated
before the addition.
NOTE:
Excel will not always tell you if your formula
contains an error, so it's up to you to check all
of your formulas.
› Create a complex formula that will perform addition
before multiplication.
EXERCISE 03
› Use the example, create a formula in cell D6 that
first adds the values of cells D2, D3, and D4 and
then multiplies their total by 0.075. Hint: You'll
need to think about the order of operations for this
to work correctly.
Functions
Introduction
› A function is a predefined formula that performs calculations using specific
values in a particular order.
› Excel includes many common functions that can be useful for quickly finding
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.
Parts of a Function
› In order to work correctly, 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 below would add the values of the cell range A1:A20.
Working with Arguments
› 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:B9) would
calculate the average of the values in
the cell range B1:B9. This function
contains only one argument.
Working with Arguments
› Multiple arguments must be separated by a comma.
› For example, the function =SUM(A1:A3, C1:C2, E1) will add the values of all
the cells in the three arguments.
Creating a Function
› Excel has a variety of functions available. Here are some of the
most common functions you'll use:
– SUM: This function adds all of the values of the cells in the argument.
– 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.
– 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.
– MAX: This function determines the highest cell value included in the argument.
– MIN: This function determines the lowest cell value included in the argument.
Creating a Function
› In our example below, we'll create a basic function to calculate
the average price per unit for a list of recently ordered items
using the AVERAGE function.
Creating a Function
› Type the equals sign (=) and enter the desired function name. You can also
select the desired function from the list of suggested functions that will appear
below the cell as you type. In our example, we'll type =AVERAGE.
Creating a Function
› Enter the cell range for the argument inside parentheses. In our example,
we'll type (C3:C10). This formula will add the values of cells C3:C10 and then
divide that value by the total number of cells in the range to determine the
average.
Creating a Function
› Press Enter on your keyboard. The function will be calculated, and
the result will appear in the cell. In our example, the average price per unit of
items ordered was $15.93.
NOTE:
Excel will not always tell you if your formula
contains an error, so it's up to you to check all
of your formulas.
Creating a Function
› The AutoSum command allows you to automatically insert the most common
functions into your formula, including SUM, AVERAGE, COUNT, MIN, and MAX.
In our example below, we'll create a function to calculate the total cost for a list
of recently ordered items using the SUM function.
Creating a Function
› Select the cell that will contain the function. In our example, we'll select
cell D12.
› In the Editing group on the Home tab, locate and select the arrow next to
the AutoSum command and then choose the desired function from the drop-down
menu. In our example, we'll select Sum.
Creating a Function
› The selected function will appear in the cell. If logically placed, the AutoSum
command will automatically select a cell range for the argument. In our
example, cells D3:D11 were selected automatically and their values will
be added together to calculate the total cost. You can also manually enter the
desired cell range into the argument.
Creating a Function
› Press Enter on your keyboard. The function will be calculated, and
the result will appear in the cell. In our example, the sum of D3:D11 is $606.05.
Creating a Function
› The AutoSum command can also be accessed from the Formulas tab on
the Ribbon.
› You can also use the Alt+= keyboard shortcut instead of the AutoSum command. To use
this shortcut, hold down the Alt key and then press the equals sign.
EXERCISE 04
› Create a function that contains
one argument. Use
the SUM function in cell D17 to
calculate the Total Cost, and
cell B15 to calculate the total
quantity of items ordered.
› Create a function in C16 to
calculate the average price unit.
› Insert the COUNT function in
B21 to calculate the total items
ordered.
› Insert the MAX function in
cell B22 and use the cell
range D2:D14 for the argument
to find the most expensive item
that was ordered.
THANK YOU!