16- Working with formulas

(Open Exercise file)                Back To Excel Index Page                 Back To Edmond Home Page

 

161- What are formulas? Play Video

A formula is an equation that performs operations on worksheet data. You can use an Excel 2007 formula to perform mathematical operations, such as addition and multiplication, or they can compare worksheet values, join text, averaging a student’s test results, etc.

A basic formula format will start with an equals sign (=) followed by one or more operands, separated by one or more operators. Operands can be values, text, cell references, ranges, defined names, or function names. Operators are symbols used to represent the various arithmetic and comparison operations you can perform on the operands

In Microsoft Excel 2007, operators are executed in this order:

Excel 2007 operators precendence

 

To enter a formula:

1)  Place the cursor in the cell where the formula will appear, i.e.E5.

2)  Enter an = sign. All Excel formulas start with the ‘equal’ sign.

3)  Enter the expression that will produce the result you want. This can consist of operands, values, variables, and symbols which represent mathematical procedures such as + or – to add and subtract, e.g. A5+C5.

4)  When the formula is complete, press Enter. The result of the formula will be calculated and displayed in the cell E5.

5)  You can see the formula in the Formula bar at the top of the screen by placing the cell pointer on the cell E5.

Excel 2007 formula bar

 If there is an error in a formula, an error message is displayed which will begin with a # sign.

 

162- Order of operations Play Video

Overview of formulas:

Formulas are equations that perform calculations on values in your worksheet. A formula starts with an equal sign (=). For example, the following formula multiplies 2 by 3 and then adds 5 to the result.

=5+2*3

A formula can also contain any or all of the following: functions, references, operators, and constants.

Parts of a formula

Parts of a formula:

Callout 1 Functions: The PI() function returns the value of pi: 3.142...

Callout 2 References: A2 returns the value in cell A2.

Callout 3 Constants: Numbers or text values entered directly into a formula, such as 2.

Callout 4 Operators: The ^ (caret) operator raises a number to a power, and the * (asterisk) operator multiplies.

Using constants in formulas:

A constant is a value that is not calculated. For example, the date 10/9/2008, the number 210, and the text "Quarterly Earnings" are all constants. An expression, or a value resulting from an expression, is not a constant. If you use constant values in the formula instead of references to the cells (for example, =30+70+110), the result changes only if you modify the formula yourself.

Using calculation operators in formulas:

Operators specify the type of calculation that you want to perform on the elements of a formula. There is a default order in which calculations occur, but you can change this order by using parentheses.

Types of operators:

There are four different types of calculation operators: arithmetic, comparison, text concatenation, and reference.

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
Negation

3–1
–1

* (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 operations

 

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

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