Sie sind auf Seite 1von 113

Move or copy a formula

Show All
It's important to be aware of what can happen to cell references, whether they are absolute or relative, when you move a formula by cutting and pasting it, or copy a formula by copying and pasting it.

When you move a formula, the cell references within the formula do not change no matter what type of cell reference that you use. When you copy a formula, the cell references may change based on the type of cell reference that you use.

What do you want to do?


Move a formula Copy a formula

Move a formula
1. 2. Select the cell that contains the formula that you want to move. On the Home tab, in the Clipboard group, click Cut.
You can also move formulas by dragging the border of the selected cell to the upper-left cell of the paste area. Any existing data is replaced.

3.

Do one of the following: To paste the formula and any formatting, on the Home tab, in the Clipboard

group, click Paste.

To paste the formula only, on the Home tab, in the Clipboard group, click Paste, click Paste Special, and then click Formulas.
TOP OF PAGE

Copy a formula
1. 2. 3.

Select the cell that contains the formula that you want to copy. On the Home tab, in the Clipboard group, click Copy. Do one of the following: To paste the formula and any formatting, on the Home tab, in the Clipboard

group, click Paste.

To paste the formula only, on the Home tab, in the Clipboard group, click Paste, click Paste Special, and then click Formulas.

NOTE

You can paste only the formula results. On the Home tab, in the Clipboard group, click Paste, click Paste Special,

and then click Values.

4.

Verify that the cell references in the formula produce the result that you want. If necessary, switch the type of reference by doing the following: 1. Select the cell that contains the formula. In the formula bar , select the reference that you want to change.

2.
3.

Press F4 to switch between the combinations.


The following table summarizes how a reference type updates if a formula that contains the reference is copied two cells down and two cells to the right.

FOR A FORMULA BEING COPIED:

IF THE REFERENCE IS:

IT CHANGES TO:

$A$1 (absolute column and absolute row) $A$1

A$1 (relative column and absolute row) $A1 (absolute column and relative row) A1 (relative column and relative row)

C$1 $A3 C3

NOTE

You can also copy formulas into adjacent cells by using the fill handle

. After verifying that the cell references in the

formula produce the result that you want in step 4, select the cell that contains the copied formula, and then drag the fill handle over the range that you want to fill.

Display or hide formulas


Show All
You can control the display of formulas in the following ways:

Switch between displaying formulas and formula results on a worksheet This method is a toggle between two different display modes. It does not change the state of the cells. Prevent formulas from displaying in the formula bar by protecting the cells that contain them This method changes the state of the cells protected cells cannot be edited. Show hidden formulas by removing the protection from cells This method changes the state of the cells unprotected cells can be edited. Make sure this is an acceptable risk, and make a backup copy of the workbook before you proceed.

Switch between displaying formulas and their values on a worksheet

Press CTRL + ` (grave accent).

Prevent a formula from displaying in the formula bar


NOTE

This procedure also prevents the cells that contain the formula from being edited.

1.

Select the range of cells whose formulas you want to hide. You can also select nonadjacent ranges or the entire sheet.

2. 3. 4. 5. 6.

On the Home tab, in the Cells group, click Format, and then click Format Cells. In the Format Cells dialog box, on the Protection tab, select the Hidden check box. Click OK. On the Review tab, in the Changes group, click Protect Sheet. Make sure the Protect worksheet and contents of locked cells check box is selected, and then click OK.

Show formulas that were previously hidden by removing protection


If the workbook is shared, unshare it before you remove protection. If the workbook is not shared, you can skip ahead to the procedure to remove protection.

NOTE

Unsharing a workbook deletes the workbooks change history. If you want to keep a copy of this information, print out the

History worksheet or copy it to another workbook.

Print or copy the change history of a shared workbook

1. 2.

On the Review tab, click Track Changes, and then click Highlight Changes. On the Highlight Changes dialog box, select the When checkbox, then select All from the list box.

3. 4. 5.

Clear the Who and Where check boxes. Select the List changes on a new sheet check box, and then click OK. Do one or more of the following: To print the History worksheet, click Print .

To copy the history to another workbook, select the cells you want to copy, click Copy , switch to another workbook, click where you want the copy to go, and click Paste
NOTE

You may also want to save or print the current version of the workbook, because this history might not apply to later

versions. For example, cell locations, including row numbers, in the copied history may no longer be current.

Unshare a workbook

1.

On the Review tab, in the Changes group, click Share Workbook, and then click the Editing tab.

2.

Make sure that you are the only person listed in the Who has this workbook open now box. If necessary, select another listed user and click Remove User.

3. 4.

Clear the Allow changes by more than one user at the same time check box. When prompted about the effects on other users, click Yes.

Remove protection and unhide formulas


1.

On the Review tab, in the Changes group, do one of the following: Click Unprotect Sheet If you do not see Unprotect Sheet, do one of the following: In Excel 2007: Click Protect Workbook, and then under Restrict Editing, click Protect Structure and Windows (to clear the check box). In Excel 2010: Click Protect Workbook. Select the range of cells whose formulas you want to unhide. Right-click the range of cells, and then click Format Cells. On the Protection tab of the Format Cells dialog box, clear the Hidden check box.

2. 3. 4.

Logical AND function


Show All
This article describes the formula syntax and usage of the AND function in Microsoft Office Excel.

Description
Returns TRUE if all its arguments evaluate to TRUE; returns FALSE if one or more arguments evaluate to FALSE.

One common use for the AND function is to expand the usefulness of other functions that perform logical tests. For example, the IF function performs a logical test and then returns one value if the test evaluates to TRUE and another value if the test evaluates to FALSE. By using the AND function as the logical_test argument of the IF function, you can test many different conditions instead of just one.

Syntax
AND(logical1, [logical2], ...)
The AND function syntax has the following arguments:

logical1 Required. The first condition that you want to test that can evaluate to either TRUE or FALSE. logical2, ... Optional. Additional conditions that you want to test that can evaluate to either TRUE or FALSE, up to a maximum of 255 conditions.

Remarks

The arguments must evaluate to logical values, such as TRUE or FALSE, or the arguments must be arrays or references that contain logical values. If an array or reference argument contains text or empty cells, those values are ignored. If the specified range contains no logical values, the AND function returns the #VALUE! error value.

Example 1
The example may be easier to understand if you copy it to a blank worksheet.

How do I copy an example?

1.

Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers.

1. 2. 3.

Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example.

1.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 4 Formula =AND(TRUE, TRUE) =AND(TRUE, FALSE) =AND(2+2=4, 2+3=5) B Description All arguments are TRUE One argument is FALSE All arguments evaluate to TRUE C Result TRUE FALSE TRUE

Example 2
5

The example may be easier to understand if you copy it to a blank worksheet.

How do I copy an example?

1.

Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers.

1. 2. 3.

Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example.

1.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 4 Data 50 104 Formula =AND(1<A2, A2<100) 5 =IF(AND(1<A3, A3<100), A3, "The value is out of range.") 6 =IF(AND(1<A2, A2<100), A2, "The value is out of range.") Description Displays TRUE if the number in cell A2 is between 1 and 100. Otherwise, it displays FALSE. Result TRUE B C

Displays the number in cell A3, if it is between 1 and 100. Otherwise, The value is out it displays the message "The value is out of range." of range. Displays the number in cell A2, if it is between 1 and 100. Otherwise, 50 it displays a message.

FALSE function
Returns the logical value FALSE.

Syntax

FALSE( )

Remark

You can also type the word FALSE directly onto the worksheet or into the formula, and Microsoft Excel interprets it as the logical value FALSE.

IF function
Show All
This article describes the formula syntax and usage of the IF function in Microsoft Office Excel.

Description
The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that condition evaluates to FALSE. For example, the formula =IF(A1>10,"Over 10","10 or less") returns "Over 10" if A1 is greater than 10, and "10 or less" if A1 is less than or equal to 10.

Syntax
IF(logical_test, value_if_true, [value_if_false])
The IF function syntax has the following arguments:

logical_test Required. Any value or expression that can be evaluated to TRUE or FALSE. For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100, the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE. This argument can use any comparison calculation operator. value_if_true Required. The value that you want to be returned if the logical_test argument evaluates to TRUE. For example, if the value of this argument is the text string "Within budget" and the logical_test argument evaluates to TRUE, the IF function returns the text "Within budget." If logical_test evaluates to TRUE and the value_if_true argument is omitted (that is, there is only a comma following the logical_test argument), the IF function returns 0 (zero). To display the word TRUE, use the logical value TRUE for the value_if_true argument. value_if_false Optional. The value that you want to be returned if the logical_test argument evaluates to FALSE. For example, if the value of this argument is the text string "Over budget" and the logical_test argument evaluates to FALSE, the IF function returns the text "Over budget." If logical_test evaluates to FALSE and the value_if_false argument is omitted, (that is, there is no comma following the value_if_true argument), the IF function returns the logical value FALSE. If logical_test evaluates to FALSE and the value of the value_if_false argument is blank (that is, there is only a comma following the value_if_true argument), the IF function returns the value 0 (zero).

Remarks

Up to 64 IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests. (See Example 3 for a sample of nested IF functions.) Alternatively, to test many conditions, consider using the LOOKUP, VLOOKUP, HLOOKUP, or CHOOSE functions. (See Example 4 for a sample of the LOOKUP function.) If any of the arguments to IF are arrays, every element of the array is evaluated when the IF statement is carried out. Excel provides additional functions that can be used to analyze your data based on a condition. For example, to count the number of occurrences of a string of text or a number within a range of cells, use the COUNTIF or the COUNTIFS worksheet functions. To calculate a sum based on a string of text or a number within a range, use the SUMIF or the SUMIFS worksheet functions. 7

Example 1
The example may be easier to understand if you copy it to a blank worksheet.

How do I copy an example?

1.

Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers.

2. 3. 4.

Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 Data 50 Formula =IF(A2<=100,"Within budget","Over budget") 4 =IF(A2=100,A2+B2,"") 23 Description If the number in cell A2 is less than or equal to 100, the formula returns "Within budget." Otherwise, the function displays "Over budget." If the number in cell A2 is equal to 100, A2 + B2 is calculated and returned. Otherwise, empty text ("") is returned. Result Within budget Empty text ("") B C

Example 2
The example may be easier to understand if you copy it to a blank worksheet.

How do I copy an example?

6.

Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers.

7. 8. 9.

Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example.

10.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 4 5 Actual Expenses 1500 500 500 Formula =IF(A2>B2,"Over Budget","OK") =IF(A3>B3,"Over Budget","OK") B Predicted Expenses 900 900 925 Description Checks whether the expenses in row 2 are over budget Checks whether the expenses in row 3 are over budget Result Over Budget OK C

6 7

Example 3
The example may be easier to understand if you copy it to a blank worksheet.

How do I copy an example?

11.

Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers.

12. 13. 14.

Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example.

15.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 4 5 Score 45 90 78 Formula =IF(A2>89,"A",IF(A2>79,"B", IF(A2>69,"C",IF(A2>59,"D","F")))) =IF(A3>89,"A",IF(A3>79,"B", IF(A3>69,"C",IF(A3>59,"D","F")))) Description Result B C

6 7 8

Assigns a letter grade to the score in cell F A2 Assigns a letter grade to the score in cell A A3

=IF(A4>89,"A",IF(A4>79,"B", IF(A4>69,"C",IF(A4>59,"D","F"))))

Assigns a letter grade to the score in cell C A4

The preceding example demonstrates how you can nest IF statements. In each formula, the fourth IF statement is also the value_if_false argument to the third IF statement. Similarly, the third IF statement is the value_if_false argument to the second IF statement, and the second IF statement is the value_if_false argument to the first IF statement. For example, if the first logical_test argument (Average>89) evaluates to TRUE, "A" is returned. If the first logical_test argument evaluates to FALSE, the second IF statement is evaluated, and so on. You can also use other functions as arguments.

The letter grades are assigned to numbers, using the following key.

IF SCORE IS Greater than 89 From 80 to 89 From 70 to 79 From 60 to 69 Less than 60

THEN RETURN A B C D F

Example 4
In this example, the LOOKUP function is used instead of the IF function because there are thirteen conditions to test. You may find the LOOKUP function easier to read and maintain than the IF function.

The example may be easier to understand if you copy it to a blank worksheet.

How do I copy an example?

16.

Select the example in this article. If you are copying the example in Excel Web App, copy and paste one cell at a time.Important Do not select the row or column headers.

17. 18. 19.

Press CTRL+C. Create a blank workbook or worksheet. In the worksheet, select cell A1, and press CTRL+V. If you are working in Excel Web App, repeat copying and pasting for each cell in the example.

20.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

10

A 1 2 3 4 5 Score 45 90 78 Formula =LOOKUP(A2,{0,60,63,67,70,73,77,80,83,87,90,93,97}, {"F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"}) 6 =LOOKUP(A3,{0,60,63,67,70,73,77,80,83,87,90,93,97}, {"F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"}) =LOOKUP(A4,{0,60,63,67,70,73,77,80,83,87,90,93,97}, {"F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"})

Description Assigns a letter grade to the score in cell A2 Assigns a letter grade to the score in cell A3

Result F

A-

IFERROR function
Show All
Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula. Use the IFERROR function to trap and handle errors in a formula.

Syntax

IFERROR(value,value_if_error)

Value

is the argument that is checked for an error.

Value_if_error

is the value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!,

#REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.

Remarks

If value or value_if_error is an empty cell, IFERROR treats it as an empty string value (""). If value is an array formula, IFERROR returns an array of results for each cell in the range specified in value. See the second example below.
Example: Trapping division errors by using a regular formula

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1. 2.

Create a blank workbook or worksheet. Select the example in the Help topic.

11

3. 4. 5.

Press CTRL+C. In the worksheet, select cell A1, and press CTRL+V. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 4 5 6 Formula =IFERROR(A2/B2, "Error in calculation") =IFERROR(A3/B3, "Error in calculation") =IFERROR(A4/B4, "Error in calculation") Quota 210 55 B Units Sold 35 0 23 Description (result) Checks for an error in the formula in the first argument (divide 210 by 35), finds no error, and then returns the results of the formula (6) Checks for an error in the formula in the first argument (divide 55 by 0), finds a division by 0 error, and then returns value_if_error (Error in calculation) Checks for an error in the formula in the first argument (divide "" by 23), finds no error, and then returns the results of the formula (0).

9 1 0

Example: Trapping division errors by using an array formula

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1. 2. 3. 4. 5.

Create a blank workbook or worksheet. Select the example in the Help topic. Press CTRL+C. In the worksheet, select cell A1, and press CTRL+V. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 4 5 6 7 8 Quota 210 55 B Units Sold 35 0 23 Formu Description (result) C Ratio =IFERROR(A2:A4/B2:B4, "Error in calculation")

12

la =C2 Checks for an error in the formula in the first argument in the first element of the array (A2/B2 or divide 210 by 35), finds no error, and then returns the result of the formula (6) Checks for an error in the formula in the first argument in the second element of the array (A3/B3 or divide 55 by 0), finds a division by 0 error, and then returns value_if_error (Error in calculation) Checks for an error in the formula in the first argument in the third element of the array (A4/B4 or divide "" by 23), finds no error, and then returns the result of the formula (0)

=C3

=C4

NOTE

The formula in the example must be entered as an array formula. After copying the example to a blank worksheet, select

the range C2:C4, press F2, and then press CTRL+SHIFT+ENTER.

Logical functions (reference)


Click one of the links in the following list to see detailed help about the function.

FUNCTIO DESCRIPTION N AND FALSE IF IFERROR NOT OR TRUE Returns TRUE if all of its arguments are TRUE Returns the logical value FALSE Specifies a logical test to perform Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula Reverses the logic of its argument Returns TRUE if any argument is TRUE Returns the logical value TRUE

NOT function
Show All
Reverses the value of its argument. Use NOT when you want to make sure a value is not equal to one particular value.

Syntax

NOT(logical)

Logical

is a value or expression that can be evaluated to TRUE or FALSE.

Remark

If logical is FALSE, NOT returns TRUE; if logical is TRUE, NOT returns FALSE.

Example

13

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1. 2. 3. 4. 5.

Create a blank workbook or worksheet. Select the example in the Help topic. Press CTRL+C. In the worksheet, select cell A1, and press CTRL+V. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 Formula =NOT(FALS E) =NOT(1+1 =2) B Description (Result) Reverses FALSE (TRUE) Reverses an equation that evaluates to TRUE (FALSE)

OR
Show All

Returns TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.

Syntax

OR(logical1,logical2,...)

Logical1,logical2,... are 1 to 255 conditions you want to test that can be either TRUE or FALSE.

Remarks

The arguments must evaluate to logical values such as TRUE or FALSE, or in arrays or references that contain logical values.

If an array or reference argument contains text or empty cells, those values are ignored.

If the specified range contains no logical values, OR returns the #VALUE! error value.

You can use an OR array formula to see if a value occurs in an array. To enter an array formula, press CTRL+SHIFT+ENTER.

Example

14

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Formula =OR(TRUE) =OR(1+1=1,2+2=5)

B Description (Result) One argument is TRUE (TRUE) All arguments evaluate to FALSE (FALSE) At least one argument is TRUE (TRUE)

=OR(TRUE,FALSE,TR UE)

TRUE
Returns the logical value TRUE.

Syntax

TRUE( )

15

Remark

You can enter the value TRUE directly into cells and formulas without using this function. The TRUE function is provided primarily for compatibility with other spreadsheet programs.

Math and trigonometry

ABS
Show All

Returns the absolute value of a number. The absolute value of a number is the number without its sign.

Syntax

ABS(number)

Number is the real number of which you want the absolute value.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

16

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Data -4

Formul a =ABS(2) =ABS(2) =ABS(A 2)

Description (Result) Absolute value of 2 (2) Absolute value of -2 (2)

Absolute value of -4 (4)

INT
Show All

Rounds a number down to the nearest integer.

Syntax

INT(number)

Number is the real number you want to round down to an integer.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

17

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Data 19.5

Formula =INT(8.9) =INT(-8.9) =A2INT(A2)

Description (Result) Rounds 8.9 down (8) Rounds -8.9 down (-9) Returns the decimal part of a positive real number in cell A2 (0.5)

PRODUCT
Show All

Multiplies all the numbers given as arguments and returns the product.

Syntax

PRODUCT(number1,number2,...)

Number1, number2, ... are 1 to 255 numbers that you want to multiply.

Remarks

Arguments that are numbers, logical values, or text representations of numbers are counted; arguments that are error values or text that cannot be translated into numbers cause errors.

18

If an argument is an array or reference, only numbers in the array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are ignored.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Data 5

15

30

Formula =PRODUCT(A2:A4) =PRODUCT(A2:A4, 2)

Description (Result) Multiplies the numbers above (2250) Multiplies the numbers above and 2 (4500)

19

ROUND
Show All

Rounds a number to a specified number of digits.

Syntax

ROUND(number,num_digits)

Number is the number you want to round.

Num_digits specifies the number of digits to which you want to round number.

Remarks

If num_digits is greater than 0 (zero), then number is rounded to the specified number of decimal places.

If num_digits is 0, then number is rounded to the nearest integer.

If num_digits is less than 0, then number is rounded to the left of the decimal point.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

20

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 =ROUND(2.149, 1) =ROUND(-1.475, 2) =ROUND(21.5, -1) Formula =ROUND(2.15, 1)

B Description (Result) Rounds 2.15 to one decimal place (2.2)

Rounds 2.149 to one decimal place (2.1)

Rounds -1.475 to two decimal places (-1.48)

Rounds 21.5 to one decimal place to the left of the decimal point (20)

SUBTOTAL
Show All

Returns a subtotal in a list or database. It is generally easier to create a list with subtotals by using the Subtotal command in the Outline group on the Data tab. Once the subtotal list is created, you can modify it by editing the SUBTOTAL function.

Syntax

SUBTOTAL(function_num, ref1, ref2, ...)

Function_num is the number 1 to 11 (includes hidden values) or 101 to 111 (ignores hidden values) that specifies which function to use in calculating subtotals within a list.
Function_num (includes hidden values) 1 2 3 4 5 6 Function_num (ignores hidden values) 101 102 103 104 105 106

Function AVERAGE COUNT COUNTA MAX MIN PRODUCT

21

7 8 9 10 11

107 108 109 110 111

STDEV STDEVP SUM VAR VARP

Ref1, ref2 are 1 to 254 ranges or references for which you want the subtotal.

Remarks

If there are other subtotals within ref1, ref2, (or nested subtotals), these nested subtotals are ignored to avoid double counting.

For the function_num constants from 1 to 11, the SUBTOTAL function includes the values of rows hidden by the Hide Rows command under the Hide & Unhide submenu of the Format command in the Cells group on the Sheet tab. Use these constants when you want to subtotal hidden and nonhidden numbers in a list. For the function_Num constants from 101 to 111, the SUBTOTAL function ignores values of rows hidden by the Hide Rows command. Use these constants when you want to subtotal only nonhidden numbers in a list.

The SUBTOTAL function ignores any rows that are not included in the result of a filter, no matter which function_num value you use.

The SUBTOTAL function is designed for columns of data, or vertical ranges. It is not designed for rows of data, or horizontal ranges. For example, when you subtotal a horizontal range using a function_num of 101 or greater, such as SUBTOTAL(109,B2:G2), hiding a column does not affect the subtotal. But, hiding a row in a subtotal of a vertical range does affect the subtotal.

If any of the references are 3-D references, SUBTOTAL returns the #VALUE! error value.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

22

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 Data 120

10

150

23

Formula =SUBTOTAL(9,A2: A5) =SUBTOTAL(1,A2: A5)

Description (Result) Subtotal of the column above using the SUM function (303)

Subtotal of the column above using the AVERAGE function (75.75)

SUM
Show All

Adds all the numbers in a range of cells.

Syntax

SUM(number1,number2, ...)

Number1, number2, ... are 1 to 255 arguments for which you want the total value or sum.

23

Remarks

Numbers, logical values, and text representations of numbers that you type directly into the list of arguments are counted. See the first and second examples following.

If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, or text in the array or reference are ignored. See the third example following.

Arguments that are error values or text that cannot be translated into numbers cause errors.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 Data -5

24

4 5 6

15

30

'5

TRUE

Formula =SUM(3, 2) =SUM("5", 15, TRUE) =SUM(A2:A4) =SUM(A2:A4, 15) =SUM(A5,A6, 2)

Description (Result) Adds 3 and 2 (5) Adds 5, 15 and 1, because the text values are translated into numbers, and the logical value TRUE is translated into the number 1 (21) Adds the first three numbers in the column above (40) Adds the first three numbers in the column above, and 15 (55)

Adds the values in the last two rows above, and 2. Because nonnumeric values in references are not translated, the values in the column above are ignored (2)

SUMIF
Show All

Adds the cells specified by a given criteria.

Syntax

SUMIF(range,criteria,sum_range)

Range is the range of cells that you want evaluated by criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.

Criteria is the criteria in the form of a number, expression, or text that defines which cells will be added. For example, criteria can be expressed as 32, "32", ">32", or "apples".

Sum_range are the actual cells to add if their corresponding cells in range match criteria. If sum_range is omitted, the cells in range are both evaluated by criteria and added if they match criteria.

Remarks

Sum_range does not have to be the same size and shape as range. The actual cells that are added are determined by using the top, left cell in sum_range as the beginning cell, and then including cells that correspond in size and shape to range. For example:

25

If range is A1:A5 A1:A5 A1:B4 A1:B4

And sum_range is B1:B5 B1:B3 C1:D4 C1:C2

Then the actual cells are B1:B5 B1:B5 C1:D4 C1:D4

You can use the wildcard characters, question mark (?) and asterisk (*), in criteria. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the character.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Property Value 100,000

B Commission 7,000

26

3 4 5

200,000 300,000 400,000 Formula =SUMIF(A2:A5,">160000",B2 :B5) =SUMIF(A2:A5,">160000") =SUMIF(A2:A5,"=300000",B2 :B3)

14,000 21,000 28,000 Description (Result) Sum of the commissions for property values over 160,000 (63,000) Sum of the property values over 160,000 (900,000) Sum of the commissions for property values equal to 300,000 (21,000)

SUMIFS
Adds the cells in a range that meet multiple criteria.

IMPORTANT

The order of arguments is different between SUMIFS and SUMIF. In particular, the sum_range argument is the

first argument in SUMIFS, but it is the third argument in SUMIF. If you are copying and editing these similar functions, make sure you put the arguments in the correct order.

Syntax

SUMIFS(sum_range,criteria_range1,criteria1,criteria_range2,criteria2)

Sum_range is one or more cells to sum, including numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.

Criteria_range1, criteria_range2, are 1 to 127 ranges in which to evaluate the associated criteria.

Criteria1, criteria2, are 1 to 127 criteria in the form of a number, expression, cell reference, or text that define which cells will be added. For example, criteria can be expressed as 32, "32", ">32", "apples", or B4.

Remarks

Each cell in sum_range is summed only if all of the corresponding criteria specified are true for that cell.

Cells in sum_range that contain TRUE evaluate as 1; cells in sum_range that contain FALSE evaluate as 0 (zero).

Unlike the range and criteria arguments in the SUMIF function, in SUMIFS each criteria_range must be the same size and shape as sum_range.

27

You can use the wildcard characters, question mark (?) and asterisk (*), in criteria. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.

Example: Adding amounts from bank accounts based on interest paid

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 Totals 2 3 Interest paid (2000) 4 Interest paid (2001) Interest paid (2002) Formula =SUMIFS(B2:E2,B3:E3,">3%",B4:E4,">=2%") Amount in dollars

B Account 1 100 1% 1% 0.5%

Account 2 390 0.5% 1.3% 3%

Account 3 8321 3% 2.1% 1%

Account 4 500 4% 2% 4%

Description (result) Total amounts from each bank account where the interest was greater than 3% for the year 2000 and greater than or equal to 2% for the year 2001 (500)

28

=SUMIFS(B2:E2,B5:E5,">=1%",B5:E5,"<=3%",B4:E4," >1%")

Total amounts from each bank account where the interest was between 1% and 3% for the year 2002 and greater than 1% for the year 2001 (8711)

Example: Adding rainfall for specific days

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 PM: rain (total inches) 4 5 PM: average temperature (degrees) 6 7 AM: average wind speed (miles per hour) PM: average wind speed (miles per hour) AM: average temperature (degrees) Morning and Evening Measurements AM: rain (total inches)

B First Day 1.3 2 56 54 13

D Third Day 1.5 4 40 38 8

Second Day 0 0.8 44 34 6

Fourth Day 3 2.5 38 77 1

33

12

29

Formula =SUMIFS(B2:E3,B4:E5,">=40",B6:E7," <10")

Description (result) Add the total amount of rainfall for days when the average temperature was at least 40 degrees Fahrenheit and the average wind speed was less that 10 miles per hour (3.5)

SUMPRODUCT
Show All

Multiplies corresponding components in the given arrays, and returns the sum of those products.

Syntax

SUMPRODUCT(array1,array2,array3, ...)

Array1, array2, array3, ... are 2 to 255 arrays whose components you want to multiply and then add.

Remarks

The array arguments must have the same dimensions. If they do not, SUMPRODUCT returns the #VALUE! error value.

SUMPRODUCT treats array entries that are not numeric as if they were zeros.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

30

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Array 1 3 8 1 Formula =SUMPRODUCT(A2:B4, C2:D4)

B Array 1 4 6 9 Description (Result) Multiplies all the components of the two arrays and then adds the products that is, 3*2 + 4*7 + 8*6 + 6*7 + 1*5 + 9*3. (156)

C Array 2 2 6 5

D Array 2 7 7 3

Remark

The preceding example returns the same result as the formula SUM(A2:B4*C2:D4) entered as an array. Using arrays provides a more general solution for doing operations similar to SUMPRODUCT. For example, you can calculate the sum of the squares of the elements in A2:B4 by using the formula =SUM(A2:B4^2) and pressing CTRL+SHIFT+ENTER.

Text and data

CHAR
Show All

Returns the character specified by a number. Use CHAR to translate code page numbers you might get from files on other types of computers into characters.
Operating environment Macintosh

Character set Macintosh character set ANSI

Windows

Syntax

CHAR(number)

31

Number is a number between 1 and 255 specifying which character you want. The character is from the character set used by your computer.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 =CHAR(3 3) Formula =CHAR(6 5)

B Description (Result) Displays the 65 character in the set (A) Displays the 33 character in the set (!)

LEN, LENB
Show All

LEN returns the number of characters in a text string.

32

LENB returns the number of bytes used to represent the characters in a text string.

IMPORTANT

LEN is intended for use with languages that use the single-byte character set (SBCS), whereas LENB is intended

for use with languages that use the double-byte character set (DBCS). The default language setting on your computer affects the return value in the following way:

LEN always counts each character, whether single-byte or double-byte, as 1, no matter what the default language setting is.

LENB counts each double-byte character as 2 when you have enabled the editing of a language that supports DBCS and then set it as the default language. Otherwise, LENB counts each character as 1.

The languages that support DBCS include Japanese, Chinese (Simplified), Chinese (Traditional), and Korean.

For more information, see the following Help topics:

Enable Windows XP support for certain languages (East Asian, Southeast Asian, Indic, and right-to-left languages)

Syntax

Enable entering text in another language in Microsoft Office

LEN(text)

LENB(text)

Text is the text whose length you want to find. Spaces count as characters.

Example 1: LEN

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

33

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Data Phoenix, AZ

One

Formula =LEN(A2) =LEN(A3) =LEN(A4)

Description (Result) Length of the first string (11) Length of the second string (0) Length of the third string, which includes 5 spaces (8)

Example 2: LENB (with your computer set to a default language that supports DBCS)

In the following example:

LENB returns 6, because each character is counted as 2.

LEN returns 3, because each character is counted as 1. LEN returns 3 no matter what the default language setting is on your computer.
") equals 6

=LENB("

=LEN("

") equals 3

34

TEXT
Show All

Converts a value to text in a specific number format.

Syntax

TEXT(value,format_text)

Value is a numeric value, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value.

Format_text is a numeric format as a text string enclosed in quotation marks. You can see various numeric formats by clicking the Number, Date, Time, Currency, or Custom in the Category box of the Number tab in the Format Cells dialog box, and then viewing the formats displayed.

Remarks

Format_text cannot contain an asterisk (*).

Formatting a cell by using a command (On the Home tab, in the Number group, click the arrow next to Number, and then click Number.) changes only the format, not the value. Using the TEXT function converts a value to formatted text, and the result is no longer calculated as a number.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

35

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 Salesperson Buchanan Dodsworth Formula =A2&" sold "&TEXT(B2, "$0.00")&" worth of units." =A3&" sold "&TEXT(B3,"0%")&" of the total sales."

B Sales 2800 40% Description (Result) Combines contents above into a phrase (Buchanan sold $2800.00 worth of units.) Combines contents above into a phrase (Dodsworth sold 40% of the total sales.)

Creating formulas

Overview of formulas
Show All

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

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

36

References: A2 returns the value in cell A2.

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

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

In this article

Using constants in formulas Using calculation operators in formulas Using functions and nested functions in formulas Using references in formulas Using names in formulas Using array formulas and array constants

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.

Top of Page

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

37

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

Meaning Addition Subtraction Negation Multiplication Division Percent Exponentiation)

Example 3+3 31 1 3*3 3/3 20% 3^2

* (asterisk) / (forward slash) % (percent sign) ^ (caret)

Comparison operators
You can compare two values with the following operators. When two values are compared by using these oper
Comparison operator = (equal sign) > (greater than sign) < (less than sign) >= (greater than or equal to sign) <= (less than or equal to sign) <> (not equal to sign) Meaning Equal to Greater than Less than Greater than or equal to Less than or equal to Example A1=B1 A1>B1 A1<B1 A1>=B1

A1<=B1

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 & (ampersand)

Meaning Connects, or concatenates, two values to produce one continuous text value

Example "North"&"wind"

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

38

Reference operator : (colon)

Meaning Range operator, which produces one reference to all the cells between two references, including the two references Union operator, which combines multiple references into one reference Intersection operator, which produces on reference to cells common to the two references

Example B5:B15

, (comma) (space)

SUM(B5:B15,D5:D15) B7:D7 C6:C8

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 : (colon) (single space) , (comma) Description Reference operators

% ^ * and / + and & = <> <=

Negation (as in 1) Percent Exponentiation Multiplication and division Addition and subtraction Connects two strings of text (concatenation) Comparison

39

>= <>

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

40

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.

Function name. For a list of available functions, click a cell and press SHIFT+F3.

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.

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.

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.

41

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 The cell in column A and row 10 The range of cells in column A and rows 10 through 20 The range of cells in row 15 and columns B through E All cells in row 5 All cells in rows 5 through 10 All cells in column H All cells in columns H through J The range of cells in columns A through E and rows 10 through 20 Use A10 A10:A20 B15:E15 5:5 5:10 H:H H:J 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.

42

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

Refers to the worksheet named Marketing

Refers to the range of cells between B1 and B10, inclusively

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.

43

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 3-D reference. The examples use the formula =SUM(Sheet2:Sheet6!A2:A5) to add cells A2 through A5 on worksheets 2 through 6.

44

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.
Referenc e R[-2]C R[2]C[2]

Meaning A relative reference to the cell two rows up and in the same column A relative reference to the cell two rows down and two columns to the right An absolute reference to the cell in the second row and in the second column A relative reference to the entire row above the active cell An absolute reference to the current row

R2C2

R[-1] R

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 Working with formulas in the Formulas category of the Excel Settings under the File menu.

Top of Page

Using names in formulas


45

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.
Example Type Reference Constant Formula

Example with no name =SUM(C20:C30) =PRODUCT(A5,8.3) =SUM(VLOOKUP(A1,B1:F20,5,FALSE), G5) C4:G36

Example with a name =SUM(FirstQuarterSales) =PRODUCT(Price,WASalesTax) =SUM(Inventory_Level, Order_Amt) =TopSales06

Table

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:

46

Typing Typing the name, for example, as an argument to a 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 Select a defined name from a list available from the Use in Formula command in the Defined Names group on the Formula tab.

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

47

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 ( { } ).

48

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}.

Calculation operators and precedence


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.

In this article

Types of operators The order in which Excel performs operations in formulas

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 + (plus sign) (minus sign)

Meaning Addition Subtraction Negation Multiplication Division Percent

Example 3+3 31 1 3*3 3/3 20%

* (asterisk) / (forward slash) % (percent sign)

49

^ (caret)

Exponentiation

3^2

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.

Comparison operator = (equal sign) > (greater than sign) < (less than sign) >= (greater than or equal to sign) <= (less than or equal to sign) <> (not equal to sign)

Meaning Equal to Greater than Less than Greater than or equal to Less than or equal to

Example A1=B1 A1>B1 A1<B1 A1>=B1

A1<=B1

Not equal to

A1<>B1

Text concatenation operator


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

Text operator & (ampersand)

Meaning Connects, or concatenates, two values to produce one continuous text value

Example ("North"&"wind")

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

Reference operator : (colon)

Meaning Range operator, which produces one reference to all the cells between two references, including the two references Union operator, which combines multiple references into one reference Intersection operator, which produces on reference to cells common to the two references

Example B5:B15

, (comma) (space)

SUM(B5:B15,D5:D15) B7:D7 C6:C8

Top of Page

The order in which Excel performs operations in formulas


50

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 : (colon) (single space) , (comma)

Description Reference operators

% ^ * and / + and & = <> <= >= <>

Negation (as in 1) Percent Exponentiation Multiplication and division 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

51

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)

Create or delete a formula


Show All

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

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

References: A2 returns the value in cell A2.

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

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

What do you want to do?

Create a simple formula with constants and calculation operators Create a formula with functions

52

Create a formula with nested functions Create a formula with references and names Create an array formula that calculates a single result Create an array formula that calculates multiple results Delete a formula Learn tips and tricks about creating formulas Avoid common errors when creating formulas

Create a simple formula with constants and calculation operators


The following formulas contain operators and constants.
Example formula =128+345 =5^2

What it does Adds 128 and 345 Squares 5

1.

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

2.

Type = (an equal sign).

3.

Enter the formula.

4.

Press ENTER.

Top of Page

Create a formula with functions


The following formulas contain functions.
Example formula =SUM(A:A) =AVERAGE(A1:B 4)

What it does Adds all numbers in column A Averages all numbers in the range

53

1.

Click the cell in which you want to enter the formula. To start the formula with the function, click Insert Function on the formula bar .

2.
3.

Select the function you want to use. You can enter a question that describes what you want to do in the Search for a function box (for example, "add numbers" returns the SUM function), or browse from the categories in the Or Select a category box.

4.

Enter the arguments. To enter cell references as an argument, click Collapse Dialog hides the dialog box), select the cells on the worksheet, and then press Expand Dialog .

(which temporarily

5.

When you complete the formula, press ENTER.

Top of Page

Create a formula with nested functions


Nested functions use a function as one of the arguments of another function. You can nest up to 64 levels of functions. The following formula sums a set of numbers (G2:G5) only if the average of another set of numbers (F2:F5) is greater than 50. Otherwise it returns 0.

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

1.

Click the cell in which you want to enter the formula. To start the formula with the function, click Function Wizard on the formula bar .

2.
3.

Select the function you want to use. You can enter a question that describes what you want to do in the Search for a function box (for example, "add numbers" returns the SUM function), or browse from the categories in the Or Select a category box.

4.

Enter the arguments.

54

To enter cell references as an argument, click Collapse Dialog

next to the argument you want

(which temporarily hides the dialog box), select the cells on the worksheet, and then press Expand Dialog .

To enter another function as an argument, enter the function in the argument box that you want. For example, you can add SUM(G2:G5) in the Value_if_true edit box of the IF function.

The parts of the formula displayed in the Function Arguments dialog box reflect the function that you selected in the previous step. For example, if you clicked IF, Function arguments displays the arguments for the IF function.

1.

Top of Page

Create a formula with references and names


The following formulas contain relative references to and names of other cells. The cell that contains the formula is known as a dependent cell when its value depends on the values in other cells. For example, cell B2 is a dependent cell if it contains the formula =C2.
Example formula =C2 =Sheet2!B2 =Asset-Liability

What it does Uses the value in the cell C2 Uses the value in cell B2 on Sheet2 Subtracts a cell named Liability from a cell named Asset

1.

Click the cell in which you want to enter the formula. In the formula bar , type = (equal sign).

2.
3.

Do one of the following:

To create a reference, select a cell, a range of cells, a location in another worksheet, or a location in another workbook. This behavior is called semi-selection. You can drag the border of the cell selection to move the selection, or drag the corner of the border to expand the selection.

55

The first cell reference is B3, the color is blue, and the cell range has a blue border with square corners.

The second cell reference is C3, the color is green, and the cell range has a green border with square corners.

NOTE

If there is no square corner on a color-coded border, then the reference is to a named range.

OK.

To enter a reference to a named range, press F3, select the name in the Paste name box, and click

4.

Press ENTER.

For more information, see Create or change a cell reference.

Top of Page

Create an array formula that calculates a single result


You can use an array formula to perform several calculations to generate a single result. This type of array formula can simplify a worksheet model by replacing several different formulas with a single array formula.

1.

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

2.

Type the 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.

56

Array formula that produces a single result

When you enter the formula {=SUM(B2:C2*B3:C3)} as an array formula, it multiples the Shares and Price for each stock, and then adds the results of those calculations together to get a total value of 9500.

3.

Press CTRL+SHIFT+ENTER.

Microsoft Office Excel automatically inserts the formula between { } (braces).

IMPORTANT

When you edit the array formula, the braces ({ }) do not appear in the array formula, and you must press

CTRL+SHIFT+ENTER again.

Top of Page

Create an array formula that calculates 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 have.

1.

Select the range of cells in which you want to enter the array formula.

2.

Type the array formula.

For example, given a series of three sales figures (column B) for a series of three months (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.

3.

Press CTRL+SHIFT+ENTER.

Excel automatically inserts the formula between { } (braces).

57

IMPORTANT

When you edit the array formula, the braces ({ }) do not appear in the array formula, and you must press

CTRL+SHIFT+ENTER again.

Top of Page

Delete a formula
1. Click the cell that contains the formula.

2.

Press DELETE.

Top of Page

Learn tips and tricks about creating formulas


Quickly copy formulas You can quickly enter the same formula into a range of cells. Select the range you want to calculate, type the formula, and then press CTRL+ENTER. For example, if you type =SUM(A1:B1) in range C1:C5, and then press CTRL+ENTER, Excel enters the formula in each cell of the range, using A1 as a relative reference.

Use Formula Autocomplete 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, 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.

Use Function tooltips If you are familiar with the arguments of a function, you can use the function tooltip that appears after you type the function name and an opening parenthesis. Click the function name to view the Help topic on the function, or click an argument name to select the corresponding argument in your formula.

Top of Page

Avoid common errors when creating formulas


The following table summarizes some of the the most common errors that you can make when entering a formula and how to correct those errors:
Make sure that you Match all open and close parentheses More information Make sure that all parentheses are part of a matching pair. When you create a formula, Microsoft Office Excel displays parentheses in color as they are entered.

58

Use a colon to indicate a range Enter all required arguments Nest no more than seven functions Enclose other sheet names in single quotation marks

When you refer to a range of cells, use a colon (:) to separate the reference to the first cell in the range and the reference to the last cell in the range. Some functions have required arguments. Also, make sure that you have not entered too many arguments. You can enter, or nest, no more than seven levels of functions within a function.

If the formula refers to values or cells on other worksheets or workbooks and the name of the other workbook or worksheet contains a nonalphabetical character, you must enclose its name within single quotation marks ( ' ). Make sure that each external reference contains a workbook name and the path to the workbook.

Include the path to external workbooks Enter numbers without formatting

Do not format numbers as you enter them in formulas. For example, even if the value that you want to enter is $1,000, enter 1000 in the formula.

Use Formula AutoComplete


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 dropdown list of valid functions, names, and text strings that match the letters or trigger. You can then insert an item in the dropdown list into the formula by using an insert trigger.

Type the = (equal sign) and beginning letters or a display trigger to start Formula AutoComplete.

As you type, a scrollable list of valid items is displayed with the closest match highlighted.

Icons represent the type of entry, such as a function or table reference.

Detailed ScreenTips help you make the best choice.

59

What do you want to do?

Control the drop-down list by using display triggers Navigate the Formula AutoComplete drop-down list by using keys Enter an item from the drop-down list by using an insert trigger Turn Formula AutoComplete on or off

Control the drop-down list by using display triggers


The following table summarizes how to dynamically control the display of items in the Formula AutoComplete drop-down list.
To display Excel and user-defined function names Type this A letter or beginning letters anywhere a function can be entered. Example: Su

Function arguments

(No display trigger). Type the argument, such as a number or cell reference, or use a display trigger, such as beginning letters or an [ (opening bracket). Example: SUM(5, A2, [ For each subsequent argument, type a comma and then the argument or another display trigger. NOTE The following functions have arguments with enumerated constants that automatically display in the drop-down list: CELL, FV, HLOOKUP, MATCH, PMT, PV, RANK, SUBTOTAL, and VLOOKUP.

Defined names and table names

A letter or beginning letters where that name can be entered. Example: Ann

Table column specifiers and special item specifiers ([#All], [#Data], [#Headers], [#Totals], [#ThisRow])

One or more of the following:

[ (opening bracket) immediately after the table name. Example: AnnualSummary[

, (comma) immediately after a special item. Example: =AnnualSummary[#All],

60

: (colon) immediately after a column name. Example: AnnualSummary[Sales: NOTE If the cell is in a table, the table name is optional. For example, the following formulas would be the same: =[Sales]/[Costs] =AnnualSummary[Sales]/AnnualSummary[Costs]

Connection names in Cube functions

" (opening quotation mark) immediately after the opening parenthesis of a Cube function name. Example: CUBEMEMBER(" NOTE listed. Only OLAP connections stored in the current workbook are

Multidimensional expressions (MDX) text strings in Cube functions

One or more of the following:

" (opening quotation mark) immediately after the comma for an argument. Example: CUBEMEMBER("SalesCubeData","

. (period) immediately after a closing bracket. Example: CUBEMEMBER("SalesCubeData","[Customers] . Example: CUBEMEMBER("SalesCubeData","[Customers]. [Mexico].

( (opening parenthesis) immediately after an opening quotation mark for an MDX text string to indicate the beginning of a tuple. Example: CUBEVALUE("SalesCubeData","(

, (comma) immediately after a closing bracket in an MDX text string to indicate the second part of a tuple. Example: CUBEVALUE("SalesCubeData","([Customers].[Mexico] ,

{ (opening brace) immediately after an opening quotation mark for an MDX text string to indicate the beginning of a set expression. Example: CUBEVALUE("SalesCubeData","{ NOTES

You must be connected to an OLAP data source to enter an MDX text string using Formula AutoComplete. If a caption is defined, it is displayed in a ScreenTip to help confirm the choice. If an MDX text string is ambiguous, then a unique member

61

name is still entered but you must decide if the correct one was entered. For example, if there are two values for the following MDX text string: CUBEMEMBER("SalesCubeData","[Customers].[Mexico].[Hidalgo]. [Dora N. Boots] One of the following values would be entered: [Customers].[Name].&[54342] [Customers].[Name].&[34297] If the one entered is not what you want, you would delete it, and then select the other one.

Microsoft SQL Server Analysis Services function names, such as "Children", "Parent", or "Crossjoin" are not displayed in the drop-down list, but you can still type them.

NOTES

At any time that you are using Formula AutoComplete, you can type what you want to finish the formula.

You can use Formula AutoComplete in the middle of an existing nested function or formula. The text immediately before the insertion point is used to display values in the drop-down list, and all of the text after the insertion point remains unchanged.

Defined names that you create for enumerated constants, such as the ones used in the SUBTOTAL function, and Cube function connections do not display in the AutoComplete drop-down list, but you can still type them.

Top of Page

Navigate the Formula AutoComplete drop-down list by using keys


The following table summarizes the keys that you can use to navigate the Formula AutoComplete drop-down list.
To Move the insertion point one character to the left. Move the insertion point one character to the right. Move the selection up one item. Move the selection down one item. Select the last item. Press LEFT ARROW

RIGHT ARROW

UP ARROW DOWN ARROW END

62

Select the first item. Move down one page and select a new item. Move up one page and select a new item. Close the drop-down list. Turn on or off Formula AutoComplete.

HOME PAGE DOWN PAGE UP ESCAPE (or click another cell) ALT+DOWN ARROW

Top of Page

Enter an item from the drop-down list by using an insert trigger


IMPORTANT

As you are typing a formula, even after using an insert trigger, don't forget to type the closing parenthesis for a

function, closing bracket for a table reference, or closing quotation mark for an MDX text string.

To insert the selected item into the formula and put the insertion point directly after it, press TAB, or double-click the item.

Top of Page

Turn Formula AutoComplete on or off


1. Click the Microsoft Office Button , click Excel Options, and then click the Formulas category.

2.

Under Working with formulas, select or clear Formula AutoComplete.

Nest a function within a function


Show All

Nested functions use a function as one of the arguments of another function. You can nest up to 64 levels of functions. The following formula sums a set of numbers (G2:G5) only if the average of another set of numbers (F2:F5) is greater than 50. Otherwise it returns 0.

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

63

1.

Click the cell in which you want to enter the formula. To start the formula with the function, click Function Wizard on the formula bar .

2.
3.

Select the function you want to use. You can enter a question that describes what you want to do in the Search for a function box (for example, "add numbers" returns the SUM function), or browse from the categories in the Or Select a category box.

4.

Enter the arguments.

To enter cell references as an argument, click Collapse Dialog

next to the argument that you

want (which temporarily hides the dialog box), select the cells on the worksheet, and then click Expand Dialog .

To enter another function as an argument, enter the function in the argument box that you want. For example, you can add SUM(G2:G5) in the Value_if_true edit box of the IF function.

The parts of the formula displayed in the Function Arguments dialog box reflect the function that you selected in the previous step. For example, if you clicked IF, Function arguments displays the arguments for the IF function.

Move or copy a formula


Show All

It's important to be aware of what can happen to cell references, whether they are absolute or relative, when you move a formula by cutting and pasting it, or copy a formula by copying and pasting it.

When you move a formula, the cell references within the formula do not change no matter what type of cell reference that you use.

When you copy a formula, the cell references may change based on the type of cell reference that you use.

What do you want to do?


Move a formula Copy a formula

64

Move a formula
1. Select the cell that contains the formula that you want to move.

2.

On the Home tab, in the Clipboard group, click Cut.

You can also move formulas by dragging the border of the selected cell to the upper-left cell of the paste area. Any existing data is replaced.

3.

Do one of the following:

To paste the formula and any formatting, on the Home tab, in the Clipboard group, click Paste.

To paste the formula only, on the Home tab, in the Clipboard group, click Paste, click Paste Special, and then click Formulas.

Top of Page

Copy a formula
1. Select the cell that contains the formula that you want to copy.

2.

On the Home tab, in the Clipboard group, click Copy.

3.

Do one of the following:

To paste the formula and any formatting, on the Home tab, in the Clipboard group, click Paste.

To paste the formula only, on the Home tab, in the Clipboard group, click Paste, click Paste Special, and then click Formulas.

NOTE

You can paste only the formula results. On the Home tab, in the Clipboard group, click Paste, click Paste

Special, and then click Values.

4.

Verify that the cell references in the formula produce the result that you want. If necessary, switch the type of reference by doing the following:

5.

65

1 1 Select the cell that contains the formula. 1 1 In the formula bar
, select the reference that you want to change.

1 1 Press F4 to switch between the combinations.


The following table summarizes how a reference type updates if a formula that contains the reference is copied two cells down and two cells to the right.

For a formula being copied:

If the reference is: $A$1 (absolute column and absolute row) A$1 (relative column and absolute row) $A1 (absolute column and relative row) A1 (relative column and relative row)

It changes to: $A$1

C$1 $A3 C3

NOTE

You can also copy formulas into adjacent cells by using the fill handle

. After verifying that the cell references

in the formula produce the result that you want in step 4, select the cell that contains the copied formula, and then drag the fill handle over the range that you want to fill.

Resize the formula or name box in the formula bar


Show All

To make it easier to view and edit a long formula or large amount of text in a cell, you can adjust the size of the formula box in the formula bar. To accommodate long names, you can also resize the name box in the formula bar. The worksheet and formula bar work in tandem so that contents of both do not overlap.

Adjust the width of the name box left or right.

66

Adjust the height of the formula box up or down.

Text

Change the case of text


Show All

Let's say you want to convert text from uppercase to lowercase or from lowercase to proper case to make it more readable. To change the case of text, use the UPPER, LOWER, or PROPER functions.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Name nancy Davolio

67

Formula =UPPER(A2)

Description (Result) Changes text to all UPPERCASE (NANCY DAVOLIO) Changes text to all lowercase (nancy davolio)

=LOWER(A2 ) =PROPER(A 2)

Changes text to Title Case (Nancy Davolio)

UPPER
Show All

Converts text to uppercase.

Syntax

UPPER(text)

Text is the text you want converted to uppercase. Text can be a reference or text string.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

68

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 Data total

Yield

Formula =UPPER(A 2) =UPPER(A 3)

Description (Result) Upper case of first string (TOTAL)

Upper case of second string (YIELD)

LOWER
Show All

Converts all uppercase letters in a text string to lowercase.

Syntax

LOWER(text)

Text is the text you want to convert to lowercase. LOWER does not change characters in text that are not letters.

Example

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

69

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 Data E. E. Cummings Apt. 2B

Formula =LOWER(A2)

Description (Result) Lower case of first string (e. e. cummings) Lower case of last string (apt. 2b)

=LOWER(A3)

PROPER
Show All

Capitalizes the first letter in a text string and any other letters in text that follow any character other than a letter. Converts all other letters to lowercase letters.

Syntax

PROPER(text)

Text is text enclosed in quotation marks, a formula that returns text, or a reference to a cell containing the text you want to partially capitalize.

Example

70

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Data this is a TITLE 2-cent's worth 76BudGet

Formula =PROPER(A 2) =PROPER(A 3) =PROPER(A 4)

Description (Result) Proper case of first string (This Is A Title)

Proper case of second string (2-Cent'S Worth) Proper case of third string (76Budget)

Math
71

Add numbers Add numbers in a cell


To do this task, use the + (plus sign) arithmetic operator.

For example, if you type the following formula in a cell:

=5+10

The cell displays the following result:

15

Top of Page

Add all contiguous numbers in a row or column


To do this task, use AutoSum .

1.

Click a cell below the column of numbers or to the right of the row of numbers.

2.

On the Home tab, in the Editing group, click AutoSum

, and then press ENTER.

Top of Page

Add noncontiguous numbers


To do this task, use the SUM function.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

72

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 6 7 Salesperson Buchanan Buchanan Suyama Suyama Buchanan Dodsworth Formula =SUM(B2:B3, B5) =SUM(B2,B5,B 7)

B Invoice 15,000 9,000 8,000 20,000 5,000 22,500 Description (Result) Adds two invoices from Buchanan, and one from Suyama (44,000)

Adds individual invoices from Buchanan, Suyama, and Dodsworth (57,500)

NOTE

The SUM function can include up to 30 cell or range references.

Function details
SUM

Top of Page

Add numbers based on one condition


73

You can use the SUMIF function to create a total value for one range based on a value in another range, as in the following example.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 4 5 6 7 Salesperson Buchanan Buchanan Suyama Suyama Buchanan Dodsworth Formula =SUMIF(A2:A7,"Buchanan",B2 :B7) B Invoice 15,000 9,000 8,000 20,000 5,000 22,500 Description (Result) Sum of invoices for Buchanan (29000)

74

=SUMIF(B2:B7,">=9000",B2: B7) =SUMIF(B2:B7,"<9000",B2:B7 )

Sum of large invoices greater than or equal to 9,000 (66500) Sum of small invoices less than 9,000 (13000)

The SUMIF function uses the following arguments

Formula with SUMIF function

Range to evaluate: Check these cells to determine whether a row meets your criteria.

Criteria: The condition that the cells you evaluate must meet for the row to be included in the sum.

Range to sum: Add the numbers in these cells provided that the row satisfies the condition.

Function details
SUMIF

Top of Page

Add numbers based on multiple conditions


To do this task, use the IF and SUM functions.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

75

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 6 7 8 9 1 0 1 1 Region South West East North South South South East North South Formula =SUM(IF((A2:A11="South")*(C2:C11="Meat"),D2: D11)) =SUM(IF((A2:A11="South")+ (A2:A11="East"),D2:D11))

B Salesperson Buchanan Davolio Suyama Suyama Dodsworth Davolio Davolio Suyama Davolio Dodsworth Description (Result) Sum of Meat sales in the South region (14719) Sum of sales where the region is South or East (32753)

C Type Beverages Dairy Beverages Dairy Produce Meat Meat Produce Produce Meat

D Sales 3571 3338 5122 6239 8677 450 7673 664 1500 6596

NOTE

The formulas in the example must be entered as array formulas. After copying the example to a blank worksheet,

select the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the error #VALUE! is returned.

Function details
76

SUM

IF

Top of Page

Add numbers based on criteria stored in a separate range


To do this task, use the DSUM function.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

77

A 1 2 3 4 5 6 7 8 9 1 0 1 1 Region South West East North South South South East North South Region South

B Salesperson Buchanan Davolio Suyama Suyama Dodsworth Davolio Davolio Suyama Davolio Dodsworth Salesperson

C Type Beverages Dairy Beverages Dairy Produce Meat Meat Produce Produce Meat Type Meat Produce

D Sales 3571 3338 5122 6239 8677 450 7673 664 1500 6596 Sales

Formula =DSUM(A1:D11, "Sales", A12:D13) =DSUM(A1:D11, "Sales", A12:D14)

Description (Result) Sum of Meat sales in the South region (14719)

Sum of Meat and Produce sales in the South region (25560)

The DSUM function uses the following arguments.

Range to evaluate: The list from which you want to sum.

Field: The label of the column to sum.

Criteria: The range of cells that contains the conditions.

Function details
DSUM

78

Top of Page

Add numbers based on multiple conditions with the Conditional Sum Wizard
If you want to summarize a range of cells based on specific conditions, you can use the Conditional Sum Wizard. For example, if your range of cells contain sales amounts for different salespeople, the Conditional Sum Wizard add-in program can help you create a formula that calculates the total sales amount for one salesperson.

1.

Click a cell in the range of cells.

2.

On the Formulas tab, in the Solutions group, click Conditional Sum.

If the Conditional Sum command or Solutions tab are not available, then you need to load the Conditional Sum Wizard add-in program.

Install and load the Conditional Sum Wizard add-in program

1.

Click the Microsoft Office Button

, click Excel Options, and then click the Add-ins category.

2.

Select Excel Add-ins in the Manage list box, and then click Go.

3.

In the Add-Ins available list, select the Conditional Sum Wizard check box, and then click OK.

3.

Follow the instructions in the wizard.

NOTE

The formulas created by the Conditional Sum Wizard are array formulas. After you edit these formulas, you must

press CTRL+SHIFT+ENTER to lock in the formulas.

Top of Page

Add unique values


To do this task, use the SUM, IF, and FREQUENCY functions.

The following example uses the:

FREQUENCY function to identify the unique values. For the first occurrence of a specific value, this function returns a number equal to the number of occurrences of that value. For each occurrence of that same value after the first, this function returns a 0 (zero).

79

IF function to assign a value of 1 to each true condition.

The SUM function to add the unique values.

Tip To see a function evaluated step by step, select the cell containing the formula, and then on the Formulas tab, in the Formula Auditing group, click Evaluate Formula.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 6 Data 986

456

67

80

7 8 9 1 0

34

689

456

56

67

Formula =SUM(IF(FREQUENCY(A2:A10,A2:A10)>0,A2: A10))

Description (Result) Add the unique values in cells A2:A10 (2289)

NOTE

The formulas in this example must be entered as array formulas. Select each cell that contains a formula, press F2,

and then press CTRL+SHIFT+ENTER.

Subtract numbers
Show All

Let's say you want to find out how many inventory items are not profitable (total inventory profitable items) or how many employees are approaching retirement age (total employees employees under 55). There are several ways to subtract numbers.

What do you want to do?


Subtract numbers in a cell Subtract numbers in a range

Subtract numbers in a cell


To do this task, use the - (minus sign) arithmetic operator.

For example, if you type the following formula in a cell:

10-5

The cell displays the following result:

81

Top of Page

Subtract numbers in a range


To do this task, use the SUM function. Adding a negative number is the same as subtracting.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Data 15,000

9,000

82

-8,000

Formula =A2-A3 =SUM(A2:A 4)

Description (Result) Subtracts 9,000 from 15,000 (6,000) Adds all numbers in the list, including negative numbers (16,000)

Multiply numbers
Show All

Let's say you want to figure out how much bottled water that you need for a customer conference (total attendees 4 days 3 bottles per day) or the reimbursement travel cost for a business trip (total miles .46). There are several ways to multiply numbers.

What do you want to do?


Multiply numbers in a cell Multiply a range of numbers by a number Multiply numbers in different cells by using a formula

Multiply numbers in a cell


To do this task, use the * (asterisk) arithmetic operator.

For example, if you type the following formula in a cell:

=5*10

The cell displays the following result:

50

Top of Page

Multiply a range of numbers by a number


Important This procedure replaces the numbers in the range with the result of the multiplication.

83

1.

In an empty cell, enter the number that you want to multiply by.

2.

Select the cell, and on the Home tab, in the Clipboard group, click Copy

3.

Select the range of numbers that you want to multiply.

4.

On the Home tab, in the Clipboard group, click the arrow below Paste, and then click Paste Special.

5.

Under Operation, click Multiply.

6.

Click OK.

7.

Delete the content of the cell entered in the first step.

Top of Page

Multiply numbers in different cells by using a formula


To do this task, use the asterisk (*) operator or the PRODUCT function.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

84

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Data 5

15

30

Formula =A2*A3 =PRODUCT(A2:A4 ) =PRODUCT(A2:A4 ,2)

Description (Result) Multiplies the numbers in the first two cells (75) Multiplies all the numbers in the range (2250)

Multiplies all the numbers in the range, and 2 (4500)

Divide numbers
Show All

Let's say you want to find out how many person hours it took to finish a project (total project hours total people on project) or the actual miles per gallon rate for your recent cross-country trip (total miles total gallons). There are several ways divide numbers.

What do you want to do?


Divide numbers in a cell Divide cells in a range

Divide numbers in a cell


To do this task, use the / (forward slash) arithmetic operator.

For example, if you type the following formula in a cell:

=10/5

85

The cell displays the following result:

Top of Page

Divide cells in a range


Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 Data 15,000

12

Formul

Description (Result)

86

a =A2/A3 Divides 15,000 by 12 (1250)

Calculate percentages
Show All

Let's say you want to calculate a sales tax for different states, compute a grade for a test score, or determine a percent change in sales between two fiscal quarters. There are several ways to calculate percentages.

Percentages are calculated by using the following equation:

amount/total = percentage

Where percentage is in decimal format.

What do you want to do?


Calculate the amount if you know the total and percentage Calculate the percentage if you know the total and amount Calculate the total if you know the amount and percentage Calculate the difference between two numbers as a percentage Increase or decrease a number by a percentage

Calculate the amount if you know the total and percentage


For example, if you purchase a computer for $800 and there is an 8.9% sales tax, how much do you have to pay for the sales tax? In this example, you want to find 8.9% of 800.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

87

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Purchase price 800 Formula =A2*B2

Sales tax (in decimal form) 0.089 Description (Result) Multiplies 800 by 0.089 to find the amount of sales tax to pay ($71.20)

NOTE

To convert a number in percentage format to a decimal, divide it by 100. For example, the sales tax in this example

(8.9) divided by 100 is .089.

Top of Page

Calculate the percentage if you know the total and amount


For example, if you score 42 points correctly out of 50, what is the percentage of correct answers?

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

88

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Points answered correctly 42 Formula =A2/B2

Total points possible 50 Description (Result) Divides 42 by 50 to find the percentage of correct answers (0.84 or 84%)

NOTE

You can view the number as a percentage. Select the cell, and then on the Home tab, in the Number group, click .

Percent Style

Top of Page

Calculate the total if you know the amount and percentage


For example, the sale price of a shirt is $15, which is 25% off the original price. What is the original price? In this example, you want to find 75% of which number equals 15.

Example
The example may be easier to understand if you copy it to a blank worksheet.

89

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Sale price 15 Formula =A2/B2

B 100% minus the discount (in decimal form) 0.75 Description (Result) Divides 15 by 0.75 to find the original price (20)

Top of Page

Calculate the difference between two numbers as a percentage


For example, your earnings are $2,342 in November and $2,500 in December. What is the percentage change in your earnings between these two months? To do this task, use the ABS function and the subtraction (-) and division (/) operators.

Example
The example may be easier to understand if you copy it to a blank worksheet.

90

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 November earnings 2342 Formula =(B2A2)/ABS(A2)

December earnings 2500 Description (Result) Divides the difference between the second and first numbers by the absolute value of the first number to get the percentage change (0.06746 or 6.75%)

NOTE

You can view the number as a percentage. Select the cell, and then on the Home tab, in the Number group, click .

Percent Style

Function details
ABS

Top of Page

Increase or decrease a number by a percentage


91

For example, you spend an average of $25 on food each week, and you want to cut your weekly food expenditures by 25%. How much can you spend? Or, if you want to increase your weekly food allowance of $25 by 25%, what is your new weekly allowance?

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 Number 25 Formula =A2*(1-B2) B Percentage 25% Description (Result) Decreases 25 by 25% (18.75) Increases 25 by 25% (31.75) Increases 25 by 35% (33.75)

=A2*(1+B2) =A2*(1+35 %)

92

NOTE

When you type a number followed by a percent sign (%), the number is interpreted as a hundredth of its value. For

example, 5% is interpreted as .05.

Calculate percentages
Show All

Let's say you want to calculate a sales tax for different states, compute a grade for a test score, or determine a percent change in sales between two fiscal quarters. There are several ways to calculate percentages.

Percentages are calculated by using the following equation:

amount/total = percentage

Where percentage is in decimal format.

What do you want to do?


Calculate the amount if you know the total and percentage Calculate the percentage if you know the total and amount Calculate the total if you know the amount and percentage Calculate the difference between two numbers as a percentage Increase or decrease a number by a percentage

Calculate the amount if you know the total and percentage


For example, if you purchase a computer for $800 and there is an 8.9% sales tax, how much do you have to pay for the sales tax? In this example, you want to find 8.9% of 800.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

93

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Purchase price 800 Formula =A2*B2

Sales tax (in decimal form) 0.089 Description (Result) Multiplies 800 by 0.089 to find the amount of sales tax to pay ($71.20)

NOTE

To convert a number in percentage format to a decimal, divide it by 100. For example, the sales tax in this example

(8.9) divided by 100 is .089.

Top of Page

Calculate the percentage if you know the total and amount


For example, if you score 42 points correctly out of 50, what is the percentage of correct answers?

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

94

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Points answered correctly 42 Formula =A2/B2

Total points possible 50 Description (Result) Divides 42 by 50 to find the percentage of correct answers (0.84 or 84%)

NOTE

You can view the number as a percentage. Select the cell, and then on the Home tab, in the Number group, click .

Percent Style

Top of Page

Calculate the total if you know the amount and percentage


For example, the sale price of a shirt is $15, which is 25% off the original price. What is the original price? In this example, you want to find 75% of which number equals 15.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

95

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Sale price 15 Formula =A2/B2

B 100% minus the discount (in decimal form) 0.75 Description (Result) Divides 15 by 0.75 to find the original price (20)

Top of Page

Calculate the difference between two numbers as a percentage


For example, your earnings are $2,342 in November and $2,500 in December. What is the percentage change in your earnings between these two months? To do this task, use the ABS function and the subtraction (-) and division (/) operators.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

96

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 November earnings 2342 Formula =(B2A2)/ABS(A2)

December earnings 2500 Description (Result) Divides the difference between the second and first numbers by the absolute value of the first number to get the percentage change (0.06746 or 6.75%)

NOTE

You can view the number as a percentage. Select the cell, and then on the Home tab, in the Number group, click .

Percent Style

Function details
ABS

Top of Page

Increase or decrease a number by a percentage

97

For example, you spend an average of $25 on food each week, and you want to cut your weekly food expenditures by 25%. How much can you spend? Or, if you want to increase your weekly food allowance of $25 by 25%, what is your new weekly allowance?

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 Number 25 Formula =A2*(1-B2) B Percentage 25% Description (Result) Decreases 25 by 25% (18.75) Increases 25 by 25% (31.75) Increases 25 by 35% (33.75)

=A2*(1+B2) =A2*(1+35 %)

98

NOTE

When you type a number followed by a percent sign (%), the number is interpreted as a hundredth of its value. For

example, 5% is interpreted as .05.

Calculate the smallest or largest number in a range


Show All

Let's say you want to find out who has the the smallest error rate in a production run at a factory or the largest salary in your department. There are several ways to calculate the smallest or largest number in a range.

What do you want to do?


If the cells are in a contiguous row or column If the cells are not in a contiguous row or column

If the cells are in a contiguous row or column


1. Select a cell below or to the right of the numbers for which you want to find the smallest number.

2.

On the Home tab, in the Editing group, click the arrow next to AutoSum or Max (calculates the largest), and then press ENTER.

, click Min (calculates the smallest)

Top of Page

If the cells are not in a contiguous row or column


To do this task, use the MIN, MAX, SMALL, or LARGE functions.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

99

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 5 6 7 27 Data 10

Formula =MIN(A2:A7) =MAX(A2:A7) =SMALL(A2:A7, 2) =LARGE(A2:A7, 3)

Description (Result) Smallest number in the range (0) Largest number in the range (27) Second smallest number in the range (4) Third largest number in the range (9)

Calculate the factorial or permutation of a number


Show All

Let's say you have six bells, each with a different tone, and you want to find the number of unique sequences in which each bell can be rung once. In this example, you are calculating the factorial of six. In general, use a factorial to count the number of

100

ways in which a group of distinct items can be arranged (also called permutations). To calculate the factorial of a number, use the FACT function.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 Data 6

Formula =FACT(A2)

Description (Result) Factorial of 6, or 6*5*4*3*2*1 (720) Factorial of 3, or 3*2*1 (6) Factorial of 10 (3628800)

=FACT(3) =FACT(A2+ 4)

101

Create a multiplication table


Show All

Let's say you want to help your daughter better understand math concepts by dynamically creating a multiplication table. You can use a two-variable data table.

1.

Set up a worksheet with the following structure.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

2.
A 1 2 3 1 1 =A1*A

102

3.

Enter a row of values from B3 to the right, for example, 1 through 10.

4.

Enter a column of values from A4 down, for example, 1 through 10.

5.

Select all cells in the range except cells A1 and A2.

6.

On the Data tab, in the Data Tools group, click What-If Analysis, and then click Data Table.

7.

In the Row input cell box, enter A1.

8.

In the Column input cell box, enter A2.

9.

Click OK.

10.

Optionally, you can freeze the data table by converting the result to their values.

Round a number
Show All

Let's say you want to round a number to the nearest whole number because decimal values are not significant to you or round a number to multiples of 10 to simplify an approximation of amounts. There are several ways to round a number.

What do you want to do?


Change the number of decimal places displayed, without changing the number Round a number up Round a number down Round a number to the nearest number Round a number to a near fraction Round a number to a significant digit above 0 Round a number to a specified multiple

103

Change the number of decimal places displayed, without changing the number
On a worksheet
1. Select the cells that you want to format.

2.

To display more or fewer digits after the decimal point, on the Home tab, in the Number group, click Increase Decimal or Decrease Decimal .

In a built-in number format


1. On the Home tab, in the Number group, click the arrow, and then click More.

2.

In the Category list, click Currency, Accounting, Percentage, or Scientific.

3.

In the Decimal places box, enter the number of decimal places that you want to display.

Top of Page

Round a number up
To do this task, use the ROUNDUP, EVEN, or ODD functions.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

104

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Data 20.3

-5.9

12.5493

Formula =ROUNDUP(A2, 0) =ROUNDUP(A3, 0) =ROUNDUP(A4, 2) =EVEN(A2) =ODD(A2)

Description (Result) Rounds 20.3 up to the nearest whole number (21)

Rounds -5.9 up (-6)

Rounds 12.5493 up to the nearest hundredth, two decimal places (12.55) Rounds 20.3 up to the nearest even number (22) Rounds 20.3 up to the nearest odd number (21)

Function details
ROUNDUP

EVEN

ODD

Top of Page

Round a number down


To do this task, use the ROUNDDOWN function.

Example
105

The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Data 20.3

-5.9

12.5493

Formula =ROUNDDOWN(A2 ,0) =ROUNDDOWN(A3 ,0) =ROUNDDOWN(A4 ,2)

Description (Result) Rounds 20.3 down to the nearest whole number ( 20)

Rounds -5.9 down (-5)

Rounds the number down to the nearest hundredth, two decimal places ( 12.54)

Functions details
106

ROUNDDOWN

Top of Page

Round a number to the nearest number


To do this task, use the ROUND function.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 4 Data 20.3

5.9

107

-5.9

Formula =ROUND(A2, 0) =ROUND(A3, 0) =ROUND(A4, 0)

Description (Result) Rounds 20.3 down, because the fractional part is less than . 5 (20) Rounds 5.9 up, because the fractional part is greater than .5 (6) Rounds -5.9 down, because the fractional part is less than -.5 (-6)

Function details
ROUND

Top of Page

Round a number to a near fraction


To do this task, use the ROUND function.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

108

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 Data 1.25

30.452

Formula =ROUND(A2, 1) =ROUND(A3, 2)

Description (Result) Rounds the number to the nearest tenth (one decimal place). Because the portion to be rounded is 0.05 or greater, the number is rounded up (result: 1.3) Rounds the number to the nearest hundredth (two decimal places). Because the portion to be rounded, 0.002, is less than 0.005, the number is rounded down (result: 30.45)

Functions details
ROUND

Top of Page

Round a number to a significant digit above 0


To do this task, use the ROUND, ROUNDUP, ROUNDDOWN, LEN, and INT functions.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

109

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

A 1 2 3 Data 5492820

22230

Formula =ROUND(A2,3-LEN(INT(A2))) =ROUNDDOWN(A3,3LEN(INT(A3))) =ROUNDUP(A2,5-LEN(INT(A2)))

Description (Result) Rounds the top number to 3 significant digits (5490000) Rounds the bottom number down to 3 significant digits (22200) Rounds the top number up to 5 significant digits (5492900)

Function details
ROUNDUP

ROUNDDOWN

ROUND

LEN, LENB

INT

Top of Page

110

Round a number to a specified multiple


To do this task, use the MROUND function.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 4 5 Formula =MROUND(16, 5) =MROUND(-16, -5) =MROUND(2.6, 0.08) =MROUND(5, -2) B Description (Result) Rounds 16 to a nearest multiple of 5 (15) Rounds -16 to a nearest multiple of -5 (-15) Rounds 2.6 to a nearest multiple of 0.08 (2.64)

Returns an error, because 5 and -2 have different signs (#NUM!)

Function details
111

MROUND

Top of Page

Raise a number to a power


Show All

Let's say you want to calculate an extremely small tolerance level for a machined part or the vast distance between two galaxies. To raise a number to a power, use the "^" operator or the POWER function.

Example
The example may be easier to understand if you copy it to a blank worksheet.

How to copy an example

1.

Create a blank workbook or worksheet.

2.

Select the example in the Help topic.

NOTE

Do not select the row or column headers.

Selecting an example from Help

3.

Press CTRL+C.

4.

In the worksheet, select cell A1, and press CTRL+V.

5.

To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
A 1 2 3 Formula =POWER(5, 2) =5^3 B Description (Result) Calculates five squared (25) Calculates five cubed (125)

112

113

Das könnte Ihnen auch gefallen