0% found this document useful (0 votes)
134 views

Ormulas and Functions

1) The document discusses formulas and functions in Excel including entering formulas, editing formulas, operator precedence, copying and pasting formulas, and inserting functions. 2) Formulas calculate values in cells and can include arithmetic operators, comparison operators, reference operators, and functions. Functions are predefined formulas that perform calculations. 3) The order that Excel calculates parts of a formula can affect the result, and parentheses can be used to specify the order of operations.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views

Ormulas and Functions

1) The document discusses formulas and functions in Excel including entering formulas, editing formulas, operator precedence, copying and pasting formulas, and inserting functions. 2) Formulas calculate values in cells and can include arithmetic operators, comparison operators, reference operators, and functions. Functions are predefined formulas that perform calculations. 3) The order that Excel calculates parts of a formula can affect the result, and parentheses can be used to specify the order of operations.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 38

ormulas and Functions

Enter a Formula | Edit a Formula | Operator Precedence | Copy/Paste a Formula | Insert a Function
A formula is an expression which calculates the value of a cell. Functions are predefined formulas and are already
available in Excel.
For example, cell A3 below contains a formula which adds the value of cell A2 to the value of cell A1.

For example, cell A3 below contains the SUM function which calculates the sum of the range A1:A2.

Enter a Formula
To enter a formula, execute the following steps.
1. Select a cell.
2. To let Excel know that you want to enter a formula, type an equal sign (=).
3. For example, type the formula A1+A2.

Tip: instead of typing A1 and A2, simply select cell A1 and cell A2.
4. Change the value of cell A1 to 3.

Excel automatically recalculates the value of cell A3. This is one of Excel's most powerful features!

Edit a Formula
When you select a cell, Excel shows the value or formula of the cell in the formula bar.

1. To edit a formula, click in the formula bar and change the formula.

2. Press Enter.

Operator Precedence
Excel uses a default order in which calculations occur. If a part of the formula is in parentheses, that part will be
calculated first. It then performs multiplication or division calculations. Once this is complete, Excel will add and
subtract the remainder of your formula. See the example below.

First, Excel performs multiplication (A1 * A2). Next, Excel adds the value of cell A3 to this result.
Another example,

First, Excel calculates the part in parentheses (A2+A3). Next, it multiplies this result by the value of cell A1.

Copy/Paste a Formula
When you copy a formula, Excel automatically adjusts the cell references for each new cell the formula is copied to.
To understand this, execute the following steps.
1. Enter the formula shown below into cell A4.

2a. Select cell A4, right click, and then click Copy (or press CTRL + c)...

...next, select cell B4, right click, and then click Paste under 'Paste Options:' (or press CTRL + v).

2b. You can also drag the formula to cell B4. Select cell A4, click on the lower right corner of cell A4 and drag it across
to cell B4. This is much easier and gives the exact same result!

Result. The formula in cell B4 references the values in column B.

Insert a Function
Every function has the same structure. For example, SUM(A1:A4). The name of this function is SUM. The part
between the brackets (arguments) means we give Excel the range A1:A4 as input. This function adds the values in
cells A1, A2, A3 and A4. It's not easy to remember which function and which arguments to use for each task.
Fortunately, the Insert Function feature in Excel helps you with this.
To insert a function, execute the following steps.
1. Select a cell.

2. Click the Insert Function button.

The 'Insert Function' dialog box appears.


3. Search for a function or select a function from a category. For example, choose COUNTIF from the Statistical
category.

4. Click OK.
The 'Function Arguments' dialog box appears.
5. Click in the Range box and select the range A1:C2.
6. Click in the Criteria box and type >5.
7. Click OK.

Result. Excel counts the number of cells that are higher than 5.

Note: instead of using the Insert Function feature, simply type =COUNTIF(A1:C2,">5"). When you arrive at:
=COUNTIF( instead of typing A1:C2, simply select the range A1:C2.

https://exceljet.net/formulas
https://exceljet.net/formula/count-unique-numeric-values-in-a-range

Arithmetic operators
To perform basic mathematical operations such as addition,
subtraction, or multiplication; combine numbers; and produce
numeric results, use the following arithmetic operators.
Arithmetic operator

Meaning

Example

+ (plus sign)

Addition

3+3

(minus sign)

Subtraction

31

Arithmetic operator

Meaning

Example

Negation

* (asterisk)

Multiplication

3*3

/ (forward slash)

Division

3/3

% (percent sign)

Percent

20%

^ (caret)

Exponentiation)

3^2

Comparison operators
You can compare two values with the following operators. When
two values are compared by using these oper
Comparison operator

Meaning

Example

= (equal sign)

Equal to

A1=B1

> (greater than sign)

Greater than

A1>B1

< (less than sign)

Less than

A1<B1

>= (greater than or equal to sign)

Greater than or equal to

A1>=B1

<= (less than or equal to sign)

Less than or equal to

A1<=B1

<> (not equal to sign)

Not equal to

A1<>B1

ators, the result is a logical value either TRUE or FALSE.

Text concatenation operator


Use the ampersand (&) to join, or concatenate, one or more text
strings to produce a single piece of text.
Text
operator

Meaning

Example

&
(ampersand)

Connects, or concatenates, two values to


produce one continuous text value

"North"&"wind"

Reference operators
Combine ranges of cells for calculations with the following
operators.
Reference
operator

Meaning

Example

: (colon)

Range operator, which produces one B5:B15


reference to all the cells between two
references, including the two
references

, (comma)

Union operator, which combines


multiple references into one
reference

(space)

Intersection operator, which produces B7:D7 C6:C8


on reference to cells common to the
two references

SUM(B5:B15,D5:D15)

The order in which Excel performs operations in


formulas
In some cases, the order in which calculation is performed can affect
the return value of the formula, so it's important to understand how
the order is determined and how you can change the order to obtain
desired results.
Calculation order
Formulas calculate values in a specific order. A formula in Excel
always begins with an equal sign (=). The equal sign tells Excel that
the succeeding characters constitute a formula. Following the equal
sign are the elements to be calculated (the operands), which are
separated by calculation operators. Excel calculates the formula
from left to right, according to a specific order for each operator in
the formula.
Operator precedence
If you combine several operators in a single formula, Excel
performs the operations in the order shown in the following table. If
a formula contains operators with the same precedence for
example, if a formula contains both a multiplication and division
operator Excel evaluates the operators from left to right.
Operator

Description

: (colon)

Reference operators

(single space)
, (comma)

Operator

Description

Negation (as in 1)

Percent

Exponentiation

* and /

Multiplication and division

+ and

Addition and subtraction

&

Connects two strings of text (concatenation)

=
<>
<=
>=
<>

Comparison

Use of parentheses
To change the order of evaluation, enclose in parentheses the part of
the formula to be calculated first. For example, the following
formula produces 11 because Excel calculates multiplication before
addition. The formula multiplies 2 by 3 and then adds 5 to the result.
=5+2*3
In contrast, if you use parentheses to change the syntax, Excel adds
5 and 2 together and then multiplies the result by 3 to produce 21.
=(5+2)*3

In the example below, the parentheses around the first part of the
formula force Excel to calculate B4+25 first and then divide the
result by the sum of the values in cells D5, E5, and F5.
=(B4+25)/SUM(D5:F5)
Top of Page

Using functions and nested


functions in formulas
Functions are predefined formulas that perform calculations by
using specific values, called arguments, in a particular order, or
structure. Functions can be used to perform simple or complex
calculations.

The syntax of functions


The following example of the ROUND function rounding off a
number in cell A10 illustrates the syntax of a function.

Structure of a function
1. Structure. The structure of a function begins with an equal sign
(=), followed by the function name, an opening parenthesis, the
arguments for the function separated by commas, and a closing
parenthesis.

2. Function name. For a list of available functions, click a cell and


press SHIFT+F3.
3. Arguments. Arguments can be numbers, text, logical values such
as TRUE or FALSE, arrays, error values such as #N/A, or cell
references. The argument you designate must produce a valid value
for that argument. Arguments can also be constants, formulas, or
other functions.
4. Argument tooltip. A tooltip with the syntax and arguments
appears as you type the function. For example, type =ROUND( and
the tooltip appears. Tooltips only appear for built-in functions.

Entering functions
When you create a formula that contains a function, the Insert
Function dialog box helps you enter worksheet functions. As you
enter a function into the formula, the Insert Function dialog box
displays the name of the function, each of its arguments, a
description of the function and each argument, the current result of
the function, and the current result of the entire formula.
To make it easier to create and edit formulas and minimize typing
and syntax errors, use formula autocomplete. After you type an =
(equal sign) and beginning letters or a display trigger, Microsoft
Office Excel displays below the cell a dynamic drop down list of
valid functions, arguments, and names that match the letters or
trigger. You can then insert an item in the drop-down list into the
formula.

Nesting functions
In certain cases, you may need to use a function as one of the
arguments of another function. For example, the following formula

uses a nested AVERAGE function and compares the result with the
value 50.

1. The AVERAGE and SUM functions are nested within the IF


function.
Valid returns When a nested function is used as an argument, it
must return the same type of value that the argument uses. For
example, if the argument returns a TRUE or FALSE value, then the
nested function must return a TRUE or FALSE. If it doesn't,
Microsoft Excel displays a #VALUE! error value.
Nesting level limits A formula can contain up to seven levels of
nested functions. When Function B is used as an argument in
Function A, Function B is a second-level function. For instance, the
AVERAGE function and the SUM function are both second-level
functions because they are arguments of the IF function. A function
nested within the AVERAGE function would be a third-level
function, and so on.
Top of Page

Using references in formulas


A reference identifies a cell or a range of cells on a worksheet and
tells Microsoft Excel where to look for the values or data you want
to use in a formula. With references, you can use data contained in
different parts of a worksheet in one formula or use the value from
one cell in several formulas. You can also refer to cells on other

sheets in the same workbook, and to other workbooks. References to


cells in other workbooks are called links or external references.

The A1 reference style


The default reference style By default, Excel uses the A1
reference style, which refers to columns with letters (A through
XFD, for a total of 16,384 columns) and refers to rows with
numbers (1 through 1,048,576). These letters and numbers are called
row and column headings. To refer to a cell, enter the column letter
followed by the row number. For example, B2 refers to the cell at
the intersection of column B and row 2.
To refer to

Use

The cell in column A and row 10

A10

The range of cells in column A and rows 10 through 20

A10:A20

The range of cells in row 15 and columns B through E

B15:E15

All cells in row 5

5:5

All cells in rows 5 through 10

5:10

All cells in column H

H:H

All cells in columns H through J

H:J

The range of cells in columns A through E and rows 10 through 20 A10:E20


Making a reference to another worksheet In the following
example, the AVERAGE worksheet function calculates the average

value for the range B1:B10 on the worksheet named Marketing in


the same workbook.

Reference to a range of cells on another worksheet in the same


workbook
1. Refers to the worksheet named Marketing
2. Refers to the range of cells between B1 and B10, inclusively
3. Separates the worksheet reference from the cell range reference

The difference between absolute, relative and


mixed references
Relative references A relative cell reference in a formula, such as
A1, is based on the relative position of the cell that contains the
formula and the cell the reference refers to. If the position of the cell
that contains the formula changes, the reference is changed. If you
copy or fill the formula across rows or down columns, the reference
automatically adjusts. By default, new formulas use relative
references. For example, if you copy or fill a relative reference in
cell B2 to cell B3, it automatically adjusts from =A1 to =A2.

Copied formula with relative reference

Absolute references An absolute cell reference in a formula, such


as $A$1, always refer to a cell in a specific location. If the position
of the cell that contains the formula changes, the absolute reference
remains the same. If you copy or fill the formula across rows or
down columns, the absolute reference does not adjust. By default,
new formulas use relative references, and you may need to switch
them to absolute references. For example, if you copy or fill an
absolute reference in cell B2 to cell B3, it stays the same in both
cells =$A$1.

Copied formula with absolute reference


Mixed references A mixed reference has either an absolute
column and relative row, or absolute row and relative column. An
absolute column reference takes the form $A1, $B1, and so on. An
absolute row reference takes the form A$1, B$1, and so on. If the
position of the cell that contains the formula changes, the relative
reference is changed, and the absolute reference does not change. If
you copy or fill the formula across rows or down columns, the
relative reference automatically adjusts, and the absolute reference
does not adjust. For example, if you copy or fill a mixed reference
from cell A2 to B3, it adjusts from =A$1 to =B$1.

Copied formula with mixed reference

The 3-D reference style

Conveniently referencing multiple worksheets If you want to


analyze data in the same cell or range of cells on multiple
worksheets within the workbook, use a 3-D reference. A 3-D
reference includes the cell or range reference, preceded by a range
of worksheet names. Excel uses any worksheets stored between the
starting and ending names of the reference. For example,
=SUM(Sheet2:Sheet13!B5) adds all the values contained in cell B5
on all the worksheets between and including Sheet 2 and Sheet 13.

You can use 3-D references to refer to cells on other sheets, to


define names, and to create formulas by using the following
functions: SUM, AVERAGE, AVERAGEA, COUNT, COUNTA,
MAX, MAXA, MIN, MINA, PRODUCT, STDEV, STDEVA,
STDEVP, STDEVPA, VAR, VARA, VARP, and VARPA.
3-D references cannot be used in array formulas.
3-D references cannot be used with the intersection operator (a
single space) or in formulas that use implicit intersection.
What happens when you move, copy, insert, or delete
worksheets The following examples explain what happens when
you move, copy, insert, or delete worksheets that are included in a 3D reference. The examples use the formula =SUM(Sheet2:Sheet6!
A2:A5) to add cells A2 through A5 on worksheets 2 through 6.

Insert or copy If you insert or copy sheets between Sheet2


and Sheet6 (the endpoints in this example), Microsoft Excel includes
all values in cells A2 through A5 from the added sheets in the
calculations.

Delete If you delete sheets between Sheet2 and Sheet6,


Excel removes their values from the calculation.

Move If you move sheets from between Sheet2 and Sheet6


to a location outside the referenced sheet range, Excel removes their
values from the calculation.

Move an endpoint If you move Sheet2 or Sheet6 to another


location in the same workbook, Excel adjusts the calculation to
accommodate the new range of sheets between them.

Delete an endpoint If you delete Sheet2 or Sheet6, Excel


adjusts the calculation to accommodate the range of sheets between
them.

The R1C1 reference style


You can also use a reference style where both the rows and the
columns on the worksheet are numbered. The R1C1 reference style
is useful for computing row and column positions in macros. In the
R1C1 style, Excel indicates the location of a cell with an "R"
followed by a row number and a "C" followed by a column number.
Reference Meaning
R[-2]C

A relative reference to the cell two rows up and in the same


column

R[2]C[2]

A relative reference to the cell two rows down and two columns
to the right

R2C2

An absolute reference to the cell in the second row and in the


second column

R[-1]

A relative reference to the entire row above the active cell

Reference Meaning
R

An absolute reference to the current row

When you record a macro, Excel records some commands by using


the R1C1 reference style. For example, if you record a command
such as clicking the AutoSum button to insert a formula that adds a
range of cells, Excel records the formula by using R1C1 style, not
A1 style, references.
You can turn the R1C1 reference style on or off by setting or
clearing the R1C1 reference style check box under theWorking
with formulas section in the Formulas category of the Excel
Settings dialog box that you display from theMicrosoft Office
Button .
Top of Page

Using names in formulas


You can create defined names to represent cells, ranges of cells,
formulas, constant values, or Excel tables. A name is a meaningful
shorthand that makes it easier to understand the purpose of a cell
reference, constant, formula, or table, each of which may be difficult
to comprehend at first glance. The following information shows
common examples of names and how they can improve clarity and
understanding.

Exampl Example with no name


e Type

Example with a name

Referen =SUM(C20:C30)
ce

=SUM(FirstQuarterSales)

Constan =PRODUCT(A5,8.3)
t

=PRODUCT(Price,WASales
Tax)

Formula =SUM(VLOOKUP(A1,B1:F20,5,F
ALSE), G5)

=SUM(Inventory_Level,
Order_Amt)

Table

=TopSales06

C4:G36

Types of names
There are several types of names you can create and use.
Defined name A name that represents a cell, range of cells,
formula, or constant value. You can create your own defined name,
and Excel sometimes creates a defined name for you, such as when
you set a print area.
Table name A name for an Excel table, which is a collection of
data about a particular subject that is stored in records (rows) and
fields (columns). Excel creates a default Excel table name of
"Table1", "Table2", and so on, each time you insert an Excel table,
but you can change the name to make it more meaningful. For more
information on Excel tables, see Using structured references with
Excel tables.

Creating and entering names

You create a name by using the:

Name box on the formula bar This is best used for creating
a workbook level name for a selected range.

Create a name from selection You can conveniently create


names from existing row and column labels by using a selection of
cells in the worksheet.

New Name dialog box This is best used for when you want
more flexibility in creating names, such as specifying a local
worksheet level scope or creating a name comment.
NOTE: By default, names use absolute cell references.

You can enter a name by:

Typing
formula.

Using Formula AutoComplete Use the Formula


AutoComplete drop-down list, where valid names are automatically
listed for you.

Selecting from the Use in Formula command


defined name from a list available from the Use in
Formula command in the Defined Names group on
the Formula tab.

Typing the name, for example, as an argument to a

Select a

For more information, see Use names to clarify formulas.


Top of Page

Using array formulas and array


constants
An array formula can perform multiple calculations and then return
either a single result or multiple results. Array formulas act on two
or more sets of values known as array arguments. Each array
argument must have the same number of rows and columns. You
create array formulas in the same way that you create other
formulas, except you press CTRL+SHIFT+ENTER to enter the
formula. Some of the built-in functions are array formulas, and must
be entered as arrays to get the correct results.
Array constants can be used in place of references when you don't
want to enter each constant value in a separate cell on the
worksheet.

Using an array formula to calculate single and


multiple results
When you enter an array formula, Microsoft Excel automatically
inserts the formula between { } (braces).
To calculate a single result This type of array formula can
simplify a worksheet model by replacing several different formulas
with a single array formula.
For example, the following calculates the total value of an array of
stock prices and shares, without using a row of cells to calculate and
display the individual values for each stock.

Array formula that produces a single result


When you enter the formula ={SUM(B2:D2*B3:D3)} as an array
formula, it multiples the Shares and Price for each stock, and then
adds the results of those calculations together.
To calculate multiple results Some worksheet functions return
arrays of values, or require an array of values as an argument. To
calculate multiple results with an array formula, you must enter the
array into a range of cells that has the same number of rows and
columns as the array arguments.
For example, given a series of three sales figures (in column B) for a
series of three months (in column A), the TREND function
determines the straight-line values for the sales figures. To display
all of the results of the formula, it is entered into three cells in
column C (C1:C3).

Array formula that produces multiple results


When you enter the formula =TREND(B1:B3,A1:A3) as an array
formula, it produces three separate results (22196, 17079, and
11962), based on the three sales figures and the three months.

Using array constants

In an ordinary formula, you can enter a reference to a cell containing


a value, or the value itself, also called a constant. Similarly, in an
array formula you can enter a reference to an array, or enter the
array of values contained within the cells, also called an array
constant. Array formulas accept constants in the same way that
nonarray formulas do, but you must enter the array constants in a
certain format.
Array constants can contain numbers, text, logical values such as
TRUE or FALSE, or error values such as #N/A. Different types of
values can be in the same array constant for example,
{1,3,4;TRUE,FALSE,TRUE}. Numbers in array constants can be in
integer, decimal, or scientific format. Text must be enclosed in
double quotation marks for example, "Tuesday".
Array constants cannot contain cell references, columns or rows of
unequal length, formulas, or the special characters $ (dollar sign),
parentheses, or % (percent sign).
When you format array constants, make sure you:

Enclose them in braces ( { } ).

Separate values in different columns with commas (,). For


example, to represent the values 10, 20, 30, and 40, enter
{10,20,30,40}. This array constant is known as a 1-by-4 array and is
equivalent to a 1-row-by-4-column reference.

Separate values in different rows with semicolons (;). For


example, to represent the values 10, 20, 30, and 40 in one row and
50, 60, 70, and 80 in the row immediately below, you would enter a
2-by-4 array constant: {10,20,30,40;50,60,70,80}.
Rows and Columns

To understand how to write formulas and functions, you need to know about rows and columns.
Rows run horizontally and columns run vertically. To remember which is which, think of a column
holding up a roof columns go up-down and thus rows go left-right.

Columns are labeled by letters; rows by numbers. The first cell in the spreadsheet is A1
meaning column A, row 1. The columns are labeled A-Z. When the alphabet runs outs, Excel
places another letter in front: AA, AB, AC AZ, BA, BC, BC, etc.
Example: Function Sum()
Now lets demonstrate how to use a function.
You use functions by typing them directly in or using the function wizard. The function wizard
opens when you either pick a function from the Formulas menu from the Function Library.
Otherwise, you can type = in a cell and a handy drop-down menu will allow you to pick a
function.

The wizard tells you what arguments you need to provide for each function. It also provides a
link to online instructions if you need help understanding what the function does and how to use
it. For example, if you type =sum into a cell, the in-line wizard shows you what arguments are
required for the SUM function.

When you type a function, the wizard is inline or right at your fingers. When you select a
function from the Formulas menu, the wizard is a pop-up box. Here is the pop-up wizard for
the SUM() function.

For our first function, lets use SUM(), which adds a list of numbers.
Suppose we have this spreadsheet to contain plans for budgeting your familys vacation:

To calculate the total costs you could write =b2+b3+b4+b5 but its easier to use the SUM()
function.
In Excel, look for the symbol at the top left-hand corner of the Excel screen to find the
AutoSum button (mathematicians use the Greek letter for adding a series of numbers).

If the cursor is below the family budget numbers, Excel is smart enough to know that you want
to sum the list of numbers above where you placed the cursor, so it highlights the numbers.

Press enter to accept the range selected by Excel or use the cursor to change which cells are
selected.

If you look at what Excel put into the spreadsheet you can see that it wrote this function:

In this formula, Excel sums the numbers from B2 to B9. Note, we left some room below row 5 so
that you could add to the family vacation budget the cost will certainly go up as the kids list of
what they want to do and where they want to go grows longer!
Math functions do not work with letters, so if you put letters into the column the result is shown
as #NAME? as shown below.

#NAME? indicates that there is some kind of error. It could be any number of things including:

bad cell reference

using letters in math functions

omitting required arguments

spelling function name wrong

illegal math operations like division by 0

The easiest way to select the arguments in a calculation is to use the mouse. You can add to or
remove from the list of arguments to the function by enlarging or making smaller the box that
Excel draws when you move the mouse or click in another cell.
We have clicked on the top of the square drawn by Excel to take airline tickets out of the
budget. You can see the cross-hair symbol that you can draw to make the selected range larger
or smaller.

Press enter to confirm the results.


Calculation Operators
There are two types of operators: math and comparison.
Math
Operator

Definition

addition

subtraction, or negation, e.g., 6 * -1 = -6

multiplication

division

percent

exponent, e.g. 24 = 2 ^ 4 = 2 * 2 * 2 * 2 =16

There are other operators not related to mathematics like & which means concatenate (join
end-to-end) two strings. For example, =Excel & is Fun equals Excel is Fun.
Now we look at comparison operators.

Compariso
n Operator

Definition

equals, e.g., 2=4 or b = b

>

greater than, e.g., 4 > 2 or b > a

<

less than, e.g., 2 < 4 or a < b

>=

greater than or equal to another way to think of this is >=


meanseither > or =.

<=

less than or equal to.

<>

not equal to, e.g., 4<>6

As you can see above, comparison operators work with numbers and text.
Note, if you enter =a>b into a cell it will say FALSE since a is not greater than b. b
comes after a in the alphabet, so a > b or b > a.
Operator Order Precedence
Order precedence is an idea from mathematics. Excel has to follow the same rules as
mathematics. This topic is more complicated, so take a breath and lets dive in.
Order precedence means the order in which the computer calculates the answer. As we
explained in Lesson 1, the area of a circle is r2, which is the same as * r * r. It is not (r)2.
So you have to understand the order precedence when you write a formula.
Generally, you can say this:
1.

Excel first evaluates items in parentheses working inside out.

2.

It then uses the order precedence rules of mathematics.

3.

When two items have the same precedence, Excel works left to right.

The precedence of math operators is shown below, in descending order.

( and )

When parentheses are used, they override the normal rules of


precedence. This means that Excel will do this calculation first. We
explain this further below.

Negation, e.g., -1. This is the same as multiplying a number by -1. -4


= 4 * (-1)

Percent, means multiply by 100. E.g., 0.003 = 0.3%.

Exponent, e.g., 10 ^ 2 = 100

* and /

Multiply and divide. How can two operators have the same
precedence? It just means that if a formula has two more operators
with the same precedence, then the calculation is done left to right.

+ and

Addition and subtraction.

There are other precedence rules related to strings and reference operators. For the moment,
we will just stick with what we just covered. Now, lets look at some examples.
Example: Calculating the area of a circle
The area of a circle is =PI() * radius ^ 2.
Looking at the table above we see that exponents comes before multiplication. So the computer
first calculates radius ^ 2 and then it multiples that result by Pi.
Example: Calculating a raise in salary
Lets say your boss decides youre doing a great job and he or she is going to give you a 10%
raise! How would you calculate your new salary?
First, remember that multiplication comes before addition.
Is it =salary + salary * 10% or is it =salary + (salary * 10%)?
Suppose your salary is $100. With a 10% raise, your new salary will be:
= 100 + 100 * 10% = 100 + 10 = 110
You can also write it like this:

=100 + (100 * 10%) = 100 + 10 = 110


In the second case, we have make the order of precedence explicit by using parentheses.
Remember that parentheses are evaluated before any other operation.
By the way, the easier way to write this is = salary * 110%
Parentheses can be nested inside one another. So, when we write (3 + (4 * 2)), working from
inside to outside, first calculates 4 * 2 = 8, then add 3 + 8 to get 11.
A few more examples
Here is another example: = 4 * 3 / 2. What is the answer?
We see from the rules in the table above that * and / have equal precedence. So Excel works
from left to right, 4 * 3 = 12 first, then divides that by 2 to get 6.
Again you could make that explicit by writing = (4 * 3) / 2
What about = 4 + 3 * 2?
The computer sees both * and + operators. So following the rules of precedence (multiplication
comes before addition) it calculates 3 * 2 = 6 first, then adds 4 to get 10.
If you wanted to change the order of precedence you would write = (4 + 3) * 2 = 14.
What about this one = -1 ^ 3?
Then answer is -3 because the computer calculated = (-1) ^ 3 = -1 * -1 * -1 = -1.
Remember that negative times negative is positive and a negative times a positive is negative.
You can see this like this (-1 * -1) * -1 = 1 * -1 = -1.
So theres a few examples of mathematical order and precedence, we hope that helps clear a
few things about how Excel performs calculations (and thats probably enough math to last a
lifetime for some of you).
Example: Function Loan Payment (PMT)
Lets look at an example to calculate a loan payment.
Start by creating a new worksheet.

Format the numbers with dollar signs and use zero decimal places since we are not interested
in cents right now because they do not matter much when you are talking about dollars (in the
next chapter we explore how to format numbers in detail). For example, to format the interest
rate, right-click on the cell and click format cells. Pick percentage and use 2 decimal places.
Similarly, format the other cells for currency instead of percentage and pick number for the
loan term.

Now we have:

Add the SUM() function to total monthly expenses.

Note, the mortgage cell is not included in the total. Excel does not know that you want to include
that number, since there is no value there. So be careful to extend the SUM() function to the top
either by using the cursor or typing E2 where it says E3 to include the mortgage in the sum.
Put the cursor in the payment cell (B4).

On the Formulas menu select the drop-down Financial and then select the PMT function. The
wizard pops up:

Use the cursor to select the rate.,nper (loan term), Pv (present value or loan amount).
Notice that you have to divide the interest rate by 12 since interest is calculated monthly. Also
you need to multiply the loan term in years by 12 to get the loan term in months. Press OK to
save the result in the spreadsheet.
Notice that the payment is shown as a negative number: -1013.37062. To make it positive and
add it to the monthly expenses, point to the mortgage cell (E2). Type =- then use the cursor to
point to the payment field. The resulting formula is =-B4.

Now the spreadsheet looks like this:

Your monthly expenses are $1,863 Ouch!


Example: Text Function
Here we demonstrate how to use functions inside a formula and text functions.
Suppose you have a list of students as shown below. The first and last name is in one field
separated by a comma. We need to put the last and firm names into separate cells. How do we
do this?

To tackle this problem you need to use an algorithm i.e., a step-by-step procedure for doing
this.
For example, look at Washington, George. The procedure to split that into two words would be:
1.

Calculate the length of the string.

2.

Find the position of the comma (this shows where one word ends and the other begins).

3.

Copy the left-hand side of the string up until the comma.

4.

Copy the right-hand side of the string from the comma to the end.

Lets discuss how to do this with George Washington step-by-step in Excel.


1.

Calculate the length of the string with the function =LEN(A3) the result is 18.

2.

Now find the position of the comma by entering this function =FIND(,,A3) the result
is 11.

3.

Now take the left-hand side of the string up until the comma and create this nested
formula using the result from Step 1: =LEFT(A3,FIND(,,A3)-1). Note, we have to subtract
1 from the length because FIND gives the position of the comma.

Here is what that all looks like when all the functions are placed together in a formula. In cell B3,
you can see this formula takes all the information from cell A3 and inputs Washington into it.

So we have Washington, now we need to get George. How do we do this?


Note, that we could have saved the result from Step 1 in a cell by itself, say, B6, then write a
simpler formula =LEFT(A3,B6-1). But that uses up one cell for the intermittent step.
1.

Remember the position of the comma or calculate it again.

2.

Calculate the length of the string.

3.

Count the characters from the end of the string to the comma.

Take the number of characters from Step 3 and subtract one to omit the comma and space.
Lets do this step-by-step.
1.

From above, this is =FIND(,,A3)

2.

The length of the string is =LEN(A3)

3.
4.

You will need to use some math to find the number of characters to take: =LEN(A3)
FIND(,,A3) 1
The right-hand side of the string we want is =RIGHT(A3,LEN(A3) FIND(,,A3) 1)

Your spreadsheet should now look similar to the screenshot below. We copied the formulas as
text into the bottom of the spreadsheet to make it easier to read and see.

That one was a little difficult but you only need to write these formulas once.

You might also like