Formula and Functions in MS Excel

download Formula and Functions in MS Excel

of 8

description

How to use different formulas and Functions in MS. Excel

Transcript of Formula and Functions in MS Excel

PAGE 8Written By:IMRAN AHMED MUGHAL

Formula

A sequence of values, cell references, names, functions, or operators in a cell that together produce a new value. A formula always begins with an equal sign (=).

Formulas Formulas are equations that perform calculations on values in your worksheet. You can create a formula that performs arithmetic operations, such as adding numbers together. Or you can create a formula that analyzes a complex model of numbers.

Enter a formula

For information about how formulas calculate values, click

.

1. Click the cell in which you want to enter the formula.

2. Type = (an equal sign).

If you click Edit Formula or Paste Function

, Microsoft Excel inserts an equal sign for you.

3. Enter the formula.

4. Press ENTER.

Tips

You can enter the same formula into a range of cells by selecting the range first, typing the formula, and then pressing CTRL+ENTER.

Enter a formula that contains a function

1. Click the cell in which you want to enter the formula.

2. To start the formula with the function, click Edit Formula in the formula bar.

3. Click the down arrow next to the Functions box.

4. Click the function you want to add to the formula. If the function does not appear in the list, click More Functions for a list of additional functions.

5. Enter the arguments.

6. When you complete the formula, press ENTER.

formula bar

A bar at the top of the Microsoft Excel window that you use to enter or edit values or formulas in cells or charts. Displays the constant value or formula stored in the active cell. To display or hide the formula bar, click Formula Bar on the View menu.

About constructing formulas

The structure or order of the elements in a formula determine the final result of the calculation. Formulas in Microsoft Excel follow a specific syntax, or order, that includes an equal sign (=) followed by the elements to be calculated (the operands), which are separated by calculation operators. Each operand can be a value that does not change (a constant value), a cell or range reference, a label, a name, or a worksheet function.

Excel performs the operations from left to right according to the order of operator precedence starting with the equal sign (=). You can control the order of calculation by using parentheses to group operations that should be performed 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

Calculation operators in formulas

Operators specify the type of calculation that you want to perform on the elements of a formula. Microsoft Excel includes four different types of calculation operators: arithmetic, comparison, text, 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.

ArithmeticoperatorMeaningExample

+ (plus sign)Addition3+3

(minus sign)SubtractionNegation311

* (asterisk)Multiplication3*3

/ (forward slash)Division3/3

% (percent sign)Percent20%

^ (caret)Exponentiation3^2 (the same as 3*3)

Comparison operators You can compare two values with the following operators. When two values are compared by using these operators, the result is a logical value, either TRUE or FALSE.

ComparisonoperatorMeaningExample

= (equal sign)Equal toA1=B1

> (greater than sign)Greater thanA1>B1

< (less than sign)Less thanA1= (greater than or equal to sign)Greater than or equal toA1>=B1

C3,"Over Budget","OK") equals "OK"

Suppose you want to assign letter grades to numbers referenced by the name AverageScore. See the following table.

If AverageScore isThen return

Greater than 89A

From 80 to 89B

From 70 to 79C

From 60 to 69D

Less than 60F

You can use the following nested IF function:

IF(AverageScore>89,"A",IF(AverageScore>79,"B",

IF(AverageScore>69,"C",IF(AverageScore>59,"D","F"))))In the preceding example, the second IF statement is also the value_if_false argument to the first IF statement. Similarly, the third IF statement is the value_if_false argument to the second IF statement. For example, if the first logical_test (Average>89) is TRUE, "A" is returned. If the first logical_test is FALSE, the second IF statement is evaluated, and so on.

=IF(S13>=87,"A",IF(S13>=80,"B+",IF(S13>=70,"B",IF(S13>=60,"C",IF(S13>=50,"D",IF(S13