Lecture 12 Formulas
Lecture 12 Formulas
Formulas
Formulas
• One of the most powerful features in Excel is the ability
to calculate numerical information using formulas. Just like a
calculator, Excel can add, subtract, multiply, and divide. In this lesson,
we'll show you how to use cell references to create simple formulas
Mathematical operators
• Excel uses standard operators for
formulas, such as a plus sign for addition
(+), a minus sign for subtraction (-),
an asterisk for multiplication (*),
a forward slash for division (/), and
a caret (^) for exponents
The 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
Formulas
• All formulas in Excel must begin with an equals sign (=). This is
because the cell contains, or is equal to, the formula and the value it
calculates
Understanding cell references
• While you can create simple formulas in Excel using numbers (for
example, =2+2 or =5*5), most of the time you will use cell
addresses to create a formula. This is known as making a cell
reference. Using cell references will ensure that your formulas are
always accurate because you can change the value of referenced cells
without having to rewrite the formula
Understanding cell references
• By combining a mathematical
operator with cell references, you
can create a variety of simple
formulas in Excel. Formulas can also
include a combination of cell
references and numbers, as in the
examples below
Copying formulas with the fill handle
• Formulas can also be copied to adjacent cells with the fill handle,
which can save a lot of time and effort if you need to perform
the same calculation multiple times in a worksheet. The fill handle is
the small square at the bottom-right corner of the selected cell(s)
Copying formulas with the fill handle
• Select the cell containing the formula you want to copy. Click and drag
the fill handle over the cells you want to fill
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 constant no matter where they are copied
Relative 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
Absolute references
• There may be a time when you don't want a cell reference to change
when copied to other 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 constant.
• An absolute reference is designated in a formula by the addition of
a dollar sign ($). It can precede the column reference, the row
reference, or both
Using cell references with multiple
worksheets
• Excel allows you to refer to any cell on any worksheet, which can be
especially helpful if you want to reference a specific value from one
worksheet to another. To do this, you'll simply need to begin the cell
reference with the worksheet name followed by
an exclamation point (!). For example, if you wanted to reference
cell A1 on Sheet1, its cell reference would be Sheet1!A1
How to Define and Use Named Range
• In Excel, you can give a human readable name to a cell or a range of cells,
and refer to those cells by name rather than reference.
• Named range make formulas easier to understand and maintain.
• Rules for assigning name range :
• Valid characters: The first character must be a letter, underscore (_) or a
backslash (\). Remaining characters in the name can be letters, numbers,
periods, and underscore and up to 255 characters.
• Spaces are not valid : Spaces are not allowed as part of a name. Use the
Underscore and period as word separators.
• Cell references disallowed: Names can not be the same as a cell reference.
• Valid names include Rate, Tax_Rate, Rate_2012
Name Box
• This is the fastest way to a named range.
• Select a cell or range of cells you want to name
• Type a name into the Name Box.
• Press Enter and the named range is created
Functions
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 of the cells
in the three arguments
Function Terminology
• Syntax is the set of rules that govern correct formation of a function
• = functionName(Argument1, Argument2, Argument3,…. )
MOD (number, divisor) Returns the remainder after number is divided by divisor
SUMIF (range, criteria, sum-range) Adds the cells specified by a given criteria
SUMIFS (sum-range, criteria-range, criteria, …) Adds the cells in a range that meet multiple criteria
SUMPRODUCT (array1, array2,array3, …) Returns the sum of the products of corresponding array components
Practice
• Open the file called Function Example on lms
• Do all steps in the sheet Menu orders
• Insert todays date in cell E1
• Insert the line total in cell D4 by multiplying the Quantity and the unit price
• Copy the formula to the entire column
• Insert the E4 the total price after tax and copy the formula to the entire column (use the tax rate is in cell E2)
• Get the total amount paid after tax in cell E15
• Write a formula to get the answer in cell H7
• Write a formula to get the answer in cell H9
• Round the total in cell E16 to the nearest tenth, get the total from cell E15
• Round it up in cell E17
• Round it down in cell E18
• Get the Ceiling and floor with a 100 Significance in cells E19 E20
• Open Sheet Challenge and get the final average of all students in Cell G7 then drag it to the rest of the column, get the average
based on the values presented in cell C3:F3