Anda di halaman 1dari 120

M.

S OFFICE EXCEL 2007


CUSTOMIZED MATERIAL

Table of Contents
Section 1 Quick look at the Mathematical Operations . 3
Section 2 Basic Functions ........................................... 7
Section 3 Conditional formatting .............................. 22
Section 4 Relative and Absolute Values ..................... 46
Section 5 Array Formula ........................................... 47
Section 6 Using NAMES ............................................. 53
Section 7 TABLE ........................................................ 63
Section 8 Advanced Filter .......................................... 67
Section 9 Data Validation .......................................... 70
Section 10 Protect Worksheet & Workbook ............... 93
Section 11 Charts ................................................... 101

Microsoft Office Excel 2007 Customized Material

Section 1
Quick look at the Mathematical Operations
There are four different types of calculation operators: arithmetic, comparison, text concatenation, and
reference.

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

Meaning

Example

+ (plus sign)

Addition

3+3

(minus sign)

Subtraction
Negation

31
1

* (asterisk)

Multiplication

3*3

/ (forward slash)

Division

3/3

% (percent sign)

Percent

20%

^ (caret)

Exponentiation

3^2

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

Meaning

Example

= (equal sign)

Equal to

A1=B1

> (greater than sign)

Greater than

A1>B1

< (less than sign)

Less than

A1<B1

>= (greater than or equal to sign)

Greater than or equal to

A1>=B1

<= (less than or equal to sign)

Less than or equal to

A1<=B1

<> (not equal to sign)

Not equal to

A1<>B1

Microsoft Office Excel 2007 Customized Material

Text concatenation operator


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

Meaning

Example

& (ampersand)

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

("North"&"wind")

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

Meaning

Example

: (colon)

Range operator, which produces one reference to all the cells between
two references, including the two references

B5:B15

, (comma)

Union operator, which combines multiple references into one reference

SUM(B5:B15,D5:D15)

(space)

Intersection operator, which produces on reference to cells common to


the two references

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.

Microsoft Office Excel 2007 Customized Material

Operator precedence
If you combine several operators in a single formula, Excel performs the operations in the order shown in
the following table. If a formula contains operators with the same precedence for example, if a formula
contains both a multiplication and division operator Excel evaluates the operators from left to right.
Operator

Description

: (colon)

Reference operators

(single space)
, (comma)

Negation (as in 1)

Percent

Exponentiation

* and /

Multiplication and division

+ and

Addition and subtraction

&

Connects two strings of text (concatenation)

=
<>
<=
>=
<>

Comparison

Microsoft Office Excel 2007 Customized Material

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)

Resources
Basic Formula Exercise
Loan Exercise

Microsoft Office Excel 2007 Customized Material

Section 2
Basic Functions
SUM function
The SUM function adds all the numbers that you specify as arguments. Each argument can be a range, a
cell reference, an array, a constant, a formula, or the result from another function. For example,
SUM(A1:A5) adds all the numbers that are contained in cells A1 through A5. For another example,
SUM(A1, A3, A5) adds the numbers that are contained in cells A1, A3, and A5.

Syntax
SUM(number1, [number2], [number3], [number4], ...)
The SUM function syntax has the following arguments:
number1 Required. The first item that you want to add.
number2, number3, number4, ... Optional. The remaining items that you want to add, up to a
total of 255 items.

Microsoft Office Excel 2007 Customized Material

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

Data

-5

15

30

'5

TRUE

Formula

Description

Result

=SUM(3, 2)

Adds 3 and 2.

=SUM("5", 15,
TRUE)

Adds 5, 15 and 1. The text value "5" is first translated into a number,
and the logical value TRUE is first translated into the number 1.

21

=SUM(A2:A4)

Adds the values in cells A2 through A4.

40

10

=SUM(A2:A4,
15)

Adds the values in cells A2 through A4, and then adds 15 to that result.

55

=SUM(A5,A6,
2)

Adds the values in cells A5 and A6, and then adds 2 to that result.
Because non-numeric values in references are not translated the value
in cell A5 ('5) and the value in cell A6 (TRUE) are both treated as text
the values in those cells are ignored.

11

12

Microsoft Office Excel 2007 Customized Material

MAX function
Returns the largest value in a set of values.
Syntax
MAX(number1,number2,...)
Number1, number2, ... are 1 to 255 numbers for which you want to find the maximum value.
Remarks
Arguments can either be numbers or names, arrays, or references that contain numbers.
Logical values and text representations of numbers that you type directly into the list of
arguments are counted.
If an argument is an array or reference, only numbers in that array or reference are used. Empty
cells, logical values, or text in the array or reference are ignored.
If the arguments contain no numbers, MAX returns 0 (zero).
Arguments that are error values or text that cannot be translated into numbers cause errors.
If you want to include logical values and text representations of numbers in a reference as part of
the calculation, use the MAXA function.
Example
A
1

Data

10

27

2
Formula

Description (Result)

=MAX(A2:A6)

Largest of the numbers above (27)

=MAX(A2:A6, 30)

Largest of the numbers above and 30 (30)

Microsoft Office Excel 2007 Customized Material

MIN function
Returns the smallest number in a set of values.
Syntax
MIN(number1,number2,...)
Number1, number2, ... are 1 to 255 numbers for which you want to find the minimum value.
Remarks
Arguments can either be numbers or names, arrays, or references that contain numbers.
Logical values and text representations of numbers that you type directly into the list of
arguments are counted.
If an argument is an array or reference, only numbers in that array or reference are used. Empty
cells, logical values, or text in the array or reference are ignored.
If the arguments contain no numbers, MIN returns 0.
Arguments that are error values or text that cannot be translated into numbers cause errors.
If you want to include logical values and text representations of numbers in a reference as part of
the calculation, use the MINA function.

Microsoft Office Excel 2007 Customized Material

10

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

A
1

Data

10

27

2
Formula

Description (Result)

=MIN(A2:A6)

Smallest of the numbers above (2)

=MIN(A2:A6,0)

Smallest of the numbers above and 0 (0)

Microsoft Office Excel 2007 Customized Material

11

COUNT function
This article describes the formula syntax and usage of the COUNT function (function: A prewritten formula
that takes a value or values, performs an operation, and returns a value or values. Use functions to
simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex
calculations.) in Microsoft Office Excel.

Description
The COUNT function counts the number of cells that contain numbers, and counts numbers within the list
of arguments. Use the COUNT function to get the number of entries in a number field that is in a range or
array of numbers. For example, you can enter the following formula to count the numbers in the range
A1:A20:
=COUNT(A1:A20)
In this example, if five of the cells in the range contain numbers, the result is 5.

Syntax
COUNT(value1, [value2],...)
The COUNT function syntax has these arguments (argument: A value that provides information to an
action, an event, a method, a property, a function, or a procedure.):
value1 Required. The first item, cell reference, or range within which you want to count
numbers.
value2, ... Optional. Up to 255 additional items, cell references, or ranges within which you want
to count numbers.
NOTE

The arguments can contain or refer to a variety of different types of data, but only numbers are

counted.

Microsoft Office Excel 2007 Customized Material

12

Remarks
Arguments that are numbers, dates, or a text representation of numbers (for example, a number
enclosed in quotation marks, such as "1") are counted.
Logical values and text representations of numbers that you type directly into the list of
arguments are counted.
Arguments that are error values or text that cannot be translated into numbers are not counted.
If an argument is an array or reference, only numbers in that array or reference are counted.
Empty cells, logical values, text, or error values in the array or reference are not counted.
If you want to count logical values, text, or error values, use the COUNTA function.
If you want to count only numbers that meet certain criteria, use the COUNTIF function or the
COUNTIFS function.
Example

A
1

Data

Sales

12/8/2008

4
5

19

22.24

TRUE

#DIV/0!

Formula

Description

Result

=COUNT(A2:A8)

Counts the number of cells that contain numbers in cells A2 through


A8.

=COUNT(A5:A8)

Counts the number of cells that contain numbers in cells A5 through


A8.

=COUNT(A2:A8,2)

Counts the number of cells that contain numbers in cells A2 through


A8, and the value 2

10

11

12

Microsoft Office Excel 2007 Customized Material

13

IF function
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 (argument: A value that provides information to an
action, an event, a method, a property, a function, or a procedure.):
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 omitted (that is, in the IF function, there is no comma following the value_if_true argument),
the IF function returns the value 0 (zero).

Microsoft Office Excel 2007 Customized Material

14

Remarks
Up to 64 IF functions can be nested as value_if_true and value_if_false arguments to construct
more elaborate tests.

Example 1

Data

50

23

Formula

Description

Result

=IF(A2<=100,"Within
budget","Over budget")

If the number in cell A2 is less than or equal to 100, the


formula returns "Within budget." Otherwise, the
function displays "Over budget."

Within
budget

=IF(A2=100,A2+B2,"")

If the number in cell A2 is equal to 100, A2 + B2 is


calculated and returned. Otherwise, empty text ("") is
returned.

Empty
text ("")

Microsoft Office Excel 2007 Customized Material

15

Example 2

Actual Expenses

Predicted Expenses

1500

900

500

900

500

925

Formula

Description

Result

=IF(A2>B2,"Over
Budget","OK")

Checks whether the expenses in row 2 are over


budget

Over
Budget

=IF(A3>B3,"Over
Budget","OK")

Checks whether the expenses in row 3 are over


budget

OK

Microsoft Office Excel 2007 Customized Material

16

COUNTIF function
This article describes the formula syntax and usage of the COUNTIF function in Microsoft Office Excel.

Description
The COUNTIF function counts the number of cells within a range that meet a single criterion that you
specify. For example, you can count all the cells that start with a certain letter, or you can count all the
cells that contain a number that is larger or smaller than a number you specify. For example, suppose you
have a worksheet that contains a list of tasks in column A, and the first name of the person assigned to
each task in column B. You can use the COUNTIF function to count how many times a person's name
appears in column B and, in that way, determine how many tasks are assigned to that person. For
example:
=COUNTIF(B2:B25,"Nancy")

Syntax
COUNTIF(range, criteria)
The COUNTIF function syntax has the following arguments:
range Required. One or more cells to count, including numbers or names, arrays, or references
that contain numbers. Blank and text values are ignored.
criteria Required. A number, expression, cell reference, or text string that defines which cells
will be counted. For example, criteria can be expressed as 32, ">32", B4, "apples", or "32".
NOTES

You can use the wildcard characters the question mark (?) and the asterisk (*) in
criteria. A question mark matches any single character, and an asterisk matches any
sequence of characters. If you want to find an actual question mark or asterisk, type a tilde
(~) before the character.
Criteria are case insensitive; for example, the string "apples" and the string "APPLES" will
match the same cells.

Microsoft Office Excel 2007 Customized Material

17

Example 1: Common COUNTIF formulas


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

Data

Data

apples

32

oranges

54

peaches

75

apples

86

Formula

Description

Result

=COUNTIF(A2:A5,"apples")

Number of cells with apples in cells A2


through A5.

=COUNTIF(A2:A5,A4)

Number of cells with peaches in cells A2


through A5.

=COUNTIF(A2:A5,A3)+COUNTIF(A2:A5,A2)

Number of cells with oranges and apples in


cells A2 through A5.

=COUNTIF(B2:B5,">55")

Number of cells with a value greater than


55 in cells B2 through B5.

=COUNTIF(B2:B5,"<>"&B4)

Number of cells with a value not equal to


75 in cells B2 through B5.

=COUNTIF(B2:B5,">=32")COUNTIF(B2:B5,">85")

Number of cells with a value greater than


or equal to 32 and less than or equal to 85
in cells B2 through B5.

10

11

12

Microsoft Office Excel 2007 Customized Material

18

SUMIF function
This article describes the formula syntax and usage of the SUMIF function (function: A prewritten formula
that takes a value or values, performs an operation, and returns a value or values. Use functions to
simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex
calculations.) in Microsoft Office Excel.

Description
You use the SUMIF function to sum the values in a range (range: Two or more cells on a sheet. The cells
in a range can be adjacent or nonadjacent.) that meet criteria that you specify. For example, suppose that
in a column that contains numbers, you want to sum only the values that are larger than 5. You can use
the following formula:
=SUMIF(B2:B25,">5")
In this example, the criteria is applied the same values that are being summed. If you want, you can apply
the criteria to one range and sum the corresponding values in a different range. For example, the formula
=SUMIF(B2:B5, "John", C2:C5) sums only the values in the range C2:C5, where the corresponding cells
in the range B2:B5 equal "John."
NOTE

To sum cells based on multiple criteria,.

Syntax
SUMIF(range, criteria, [sum_range])
The SUMIF function syntax has the following arguments (argument: A value that provides information to
an action, an event, a method, a property, a function, or a procedure.):
range Required. 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.

Microsoft Office Excel 2007 Customized Material

19

criteria Required. The criteria in the form of a number, expression, a cell reference, text, or a
function that defines which cells will be added. For example, criteria can be expressed as 32,
">32", B5, 32, "32", "apples", or TODAY().
IMPORTANT Any text criteria or any criteria that includes logical or mathematical symbols must

be enclosed in double quotation marks ("). If the criteria is numeric, double quotation marks are
not required.
sum_range Optional. The actual cells to add, if you want to add cells other than those specified
in the range argument. If the sum_range argument is omitted, Excel adds the cells that are
specified in the range argument (the same cells to which the criteria is applied).
NOTES

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

And sum_range is

Then the actual cells are

A1:A5

B1:B5

B1:B5

A1:A5

B1:B3

B1:B5

A1:B4

C1:D4

C1:D4

A1:B4

C1:C2

C1:D4

You can use the wildcard characters the question mark (?) and asterisk (*) as the criteria
argument. 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 1
The example may be easier to understand if you copy it to a blank worksheet.

Microsoft Office Excel 2007 Customized Material

20

Property Value

Commission

Data

100,000

7,000

250,000

200,000

14,000

300,000

21,000

400,000

28,000

Formula

Description

Result

=SUMIF(A2:A5,">160000",B2:B5)

Sum of the commissions for property values over


160,000.

63,000

=SUMIF(A2:A5,">160000")

Sum of the property values over 160,000.

900,000

=SUMIF(A2:A5,300000,B2:B5)

Sum of the commissions for property values equal to


300,000.

21,000

=SUMIF(A2:A5,">" & C2,B2:B5)

Sum of the commissions for property values greater


than the value in C2.

49,000

10

Resources

Function Step By Step


Basic Functions Exercise
IF function Step By Step
IF function Exercise

Microsoft Office Excel 2007 Customized Material

21

Section 3
Conditional formatting
The benefits of conditional formatting
Whenever you analyze data, you often ask yourself questions, such as:
Where are the exceptions in a summary of profits over the past five years?
What are the trends in a marketing opinion poll over the past two years?
Who has sold more than $50,000 dollars this month?
What is the overall age distribution of employees?
Which products have greater than 10% revenue increases from year to year?
Who are the highest performing and lowest performing students in the freshman class?
Conditional formatting helps to answer these questions by making it easy to highlight interesting cells or
ranges of cells, emphasize unusual values, and visualize data by using data bars, color scales, and icon
sets. A conditional format changes the appearance of a cell range based on a condition (or criteria). If the
condition is true, the cell range is formatted based on that condition; if the conditional is false, the cell
range is not formatted based on that condition.
NOTE

When you create a conditional format, you can only reference other cells on the same worksheet;

you cannot reference cells on other worksheets in the same workbook, or use external references to
another workbook.

Microsoft Office Excel 2007 Customized Material

22

Format all cells by using a two-color scale


Color scales are visual guides that help you understand data distribution and variation. A two-color scale
helps you compare a range of cells by using a gradation of two colors. The shade of the color represents
higher or lower values. For example, in a green and red color scale, you can specify that higher value
cells have a more green color and lower value cells have a more red color.
If one or more cells in the range contain a formula that returns an error, the conditional formatting is not
applied to the entire range. To ensure that the conditional formatting is applied to the entire range, use an
IS or IFERROR function to return a value other than an error value.
Quick formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Color Scales.

3. Select a two-color scale.


TIP Hover over the color scale icons to see which icon is a two-color scale. The top color

represents higher values, and the bottom color represents lower values.
TIP You can change the method of scoping for fields in the Values area of a PivotTable report by using

the Apply formatting rule to options button.

Microsoft Office Excel 2007 Customized Material

23

Advanced formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Manage Rules.
The Conditional Formatting Rules Manager dialog box is displayed.
3. Do one of the following:

To add a conditional format, click New Rule.


The New Formatting Rule dialog box is displayed.

To change a conditional format, do the following:


1. Make sure that the appropriate worksheet, table, or PivotTable report is selected in
the Show formatting rules for list box.
2. Optionally, change the range of cells by clicking Collapse Dialog

in the Applies

to box to temporarily hide the dialog box, by selecting the new range of cells on the
worksheet, and then by selecting Expand Dialog

3. Select the rule, and then click Edit rule.


The Edit Formatting Rule dialog box is displayed.
4. Under Apply Rule To, to optionally change the scope for fields in the Values area of a
PivotTable report by:

Selection, click Just these cells.

Corresponding field, click All <value field> cells with the same fields.

Value field, click All <value field> cells.

5. Under Select a Rule Type, click Format all cells based on their values.
6. Under Edit the Rule Description, in the Format Style list box, select 2-Color Scale.
7. Select a Minimum and Maximum Type. Do one of the following:

Microsoft Office Excel 2007 Customized Material

24

Format lowest and highest values Select Lowest Value and Highest Value.
In this case, you do not enter a Minimum and Maximum Value.

Format a number, date, or time value Select Number, and then enter a Minimum and
Maximum Value.

Format a percentage Select Percent, and then enter a Minimum and Maximum Value.
Valid values are from 0 (zero) to 100. Do not enter a percent sign.
Use a percentage when you want to visualize all values proportionally because the
distribution of values is proportional.

Format a percentile Select Percentile and then enter a Minimum and Maximum Value.
Valid percentiles are from 0 (zero) to 100. You cannot use a percentile if the range of cells
contains more than 8,191 data points.
Use a percentile when you want to visualize a group of high values (such as the top
th

20 percentile) in one color grade proportion and low values (such as the bottom 20

th

percentile) in another color grade proportion, because they represent extreme values that
might skew the visualization of your data.

Format a formula result Select Formula, and then enter a Minimum and Maximum
Value.
The formula must return a number, date, or time value. Start the formula with an equal sign
(=). Invalid formulas result in no formatting applied. It's a good idea to test the formula in
the worksheet to make sure that the formula doesn't return an error value.

8.

NOTES

Minimum and Maximum values are the minimum and maximum values for the range of
cells. Make sure that the Minimum value is less than the Maximum value.

Microsoft Office Excel 2007 Customized Material

25

You can choose a different Minimum and Maximum Type. For example, you can choose
a Minimum Number and Maximum Percent.

9. To choose a Minimum and Maximum color scale, click Color for each, and then select a color.
If you want to choose additional colors or create a custom color, click More Colors.
The color scale that you select is displayed in the Preview box.

Format all cells by using a three-color scale


Color scales are visual guides that help you understand data distribution and variation. A three-color
scale helps you compare a range of cells by using a gradation of three colors. The shade of the color
represents higher, middle, or lower values. For example, in a green, yellow, and red color scale, you can
specify that higher value cells have a green color, middle value cells have a yellow color, and lower value
cells have a red color.
If one or more cells in the range contain a formula that returns an error, the conditional formatting is not
applied to the entire range. To ensure that the conditional formatting is applied to the entire range, use an
IS or IFERROR function to return a value other than an error value.
Quick formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Color Scales.

3. Select a three-color scale. The top color represents higher values, the center color represents
middle values, and the bottom color represents lower values.
TIP Hover over the color scale icons to see which icon is a three-color scale.

Microsoft Office Excel 2007 Customized Material

26

TIP You can change the method of scoping for fields in the Values area of a PivotTable report by using

the Apply formatting rule to options button.


Advanced formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Manage Rules.
The Conditional Formatting Rules Manager dialog box is displayed.
3. Do one of the following:

To add a conditional format, click New Rule.


The New Formatting Rule dialog box is displayed.

To change a conditional format, do the following:


1. Make sure that the appropriate worksheet, table, or PivotTable report is selected in
the Show formatting rules for list box.
2. Optionally, change the range of cells by clicking Collapse Dialog

in the Applies

to box to temporarily hide the dialog box, by selecting the new range of cells on the
worksheet, and then by selecting Expand Dialog

3. Select the rule, and then click Edit rule.


The Edit Formatting Rule dialog box is displayed.
4. Under Apply Rule To, to optionally change the scope for fields in the Values area of a
PivotTable report by:

Selection, click Just these cells.

Corresponding field, click All <value field> cells with the same fields.

Value field, click All <value field> cells.

5. Under Select a Rule Type, click Format all cells based on their values.

Microsoft Office Excel 2007 Customized Material

27

6. Under Edit the Rule Description, in the Format Style list box, select 3-Color Scale.
7. Select a Minimum, Midpoint, and Maximum Type. Do one of the following:

Format lowest and highest values Select a Midpoint.


In this case, you do not enter a Lowest and Highest Value.

Format a number, date, or time value Select Number, and then enter a Minimum,
Midpoint, and Maximum Value.

Format a percentage Select Percent, and then enter a Minimum, Midpoint, and
Maximum Value.
Valid values are from 0 (zero) to 100. Do not enter a percent sign.
Use a percentage when you want to visualize all values proportionally because the
distribution of values is proportional.

Format a percentile Select Percentile and then enter a Minimum, Midpoint, and
Maximum Value.
Valid percentiles are from 0 (zero) to 100. You cannot use a percentile if the range of cells
contains more than 8,191 data points.
Use a percentile when you want to visualize a group of high values (such as the top 20
percentile) in one color grade proportion and low values (such as the bottom 20

th

th

percentile) in another color grade proportion, because they represent extreme values that
might skew the visualization of your data.

Format a formula result Select Formula, and then enter a Minimum, Midpoint, and
Maximum Value.
The formula must return a number, date, or time value. Start the formula with an equal sign
(=). Invalid formulas result in no formatting applied. It's a good idea to test the formula in
the worksheet to make sure that the formula doesn't return an error value.

8.

NOTES

Microsoft Office Excel 2007 Customized Material

28

Minimum, Midpoint, and Maximum values are the minimum, midpoint, and maximum
values for the range of cells. Make sure that the Minimum value is less than the Midpoint
value, which in turn, is less than the Maximum value.

You can choose a different Minimum, Midpoint, and Maximum Type. For example, you
can choose a Minimum Number, Midpoint Percentile, and Maximum Percent.

In many cases, the default Midpoint value of 50 percent works best, but you can adjust this
to fit unique requirements.

9. To choose a Minimum, Midpoint, and Maximum color scale, click Color for each, and then
select a color.
If you want to choose additional colors or create a custom color, click More Colors.
The color scale that you select is displayed in the Preview box.

Format all cells by using data bars


A data bar helps you see the value of a cell relative to other cells. The length of the data bar represents
the value in the cell. A longer bar represents a higher value, and a shorter bar represents a lower value.
Data bars are useful in spotting higher and lower numbers, especially with large amounts of data, such as
top selling and bottom selling toys in a holiday sales report.
Issue: I don't see my conditional formatting for any cell in the range.
If one or more cells in the range contain a formula that returns an error, the conditional formatting is not
applied to the entire range. To ensure that the conditional formatting is applied to the entire range, use an
IS or IFERROR function to return a value other than an error value.

Microsoft Office Excel 2007 Customized Material

29

Quick formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Style group, click the arrow next to Conditional Formatting, click Data
Bars, and then select a data bar icon.

TIP You can change the method of scoping for fields in the Values area of a PivotTable report by using

the Apply formatting rule to options button.


Advanced formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Manage Rules.
The Conditional Formatting Rules Manager dialog box is displayed.
3. Do one of the following:

To add a conditional format, click New Rule.


The New Formatting Rule dialog box is displayed.

To change a conditional format, do the following:


a) Make sure that the appropriate worksheet, table, or PivotTable report is selected in
the Show formatting rules for list box.
b) Optionally, change the range of cells by clicking Collapse Dialog
in the Applies
to box to temporarily hide the dialog box, by selecting the new range of cells on the
worksheet, and then by selecting Expand Dialog

c) Select the rule, and then click Edit rule.


The Edit Formatting Rule dialog box is displayed.

Microsoft Office Excel 2007 Customized Material

30

4. Under Apply Rule To, to optionally change the scope for fields in the Values area of a
PivotTable report by:

Selection, click Just these cells.

Corresponding field, click All <value field> cells with the same fields.

Value field, click All <value field> cells.

5. Under Select a Rule Type, click Format all cells based on their values.
6. Under Edit the Rule Description, in the Format Style list box, select Data Bar.
7. Select a Shortest Bar and Longest Bar Type. Do one of the following:

Format lowest and highest values Select Lowest Value and Highest Value.
In this case, you do not enter a Shortest Bar and Longest Bar Value.

Format a number, date, or time value Select Number, and then enter a Shortest Bar
and Longest Bar Value.

Format a percentage Select Percent, and then enter a Shortest Bar and Longest Bar
Value.
Valid values are from 0 (zero) to 100. Do not enter a percent sign.
Use a percentage when you want to visualize all values proportionally because the
distribution of values is proportional.

Format a percentile Select Percentile and then enter a Shortest Bar and Longest Bar
Value.
Valid percentiles are from 0 (zero) to 100. You cannot use a percentile if the range of cells
contains more than 8,191 data points.
Use a percentile when you want to visualize a group of high values (such as the top 20

th

th

percentile) in one data bar proportion and low values (such as the bottom 20 percentile) in
another data bar proportion, because they represent extreme values that might skew the
visualization of your data.

Microsoft Office Excel 2007 Customized Material

31

Format a formula result Select Formula, and then enter a Shortest Bar and Longest
Bar Value.
The formula must return a number, date, or time value. Start the formula with an equal sign
(=). Invalid formulas result in no formatting applied. It's a good idea to test the formula in
the worksheet to make sure that the formula doesn't return an error value.

8.

NOTES

Make sure that the Shortest Bar value is less than the Longest Bar value.

You can choose a different Shortest Bar and Longest Bar Type. For example, you can
choose a Shortest Bar Number and Longest Bar Percent.

9. To choose a Shortest Bar and Longest Bar color scale, click Bar Color.
If you want to choose additional colors or create a custom color, click More Colors.
The bar color that you select is displayed in the Preview box.
10. To show only the data bar and not the value in the cell, select Show Bar Only.
Top of Page

Format all cells by using an icon set


Use an icon set to annotate and classify data into three to five categories separated by a threshold value.
Each icon represents a range of values. For example, in the 3 Arrows icon set, the green up arrow
represents higher values, the yellow sideways arrow represents middle values, and the red down arrow
represents lower values.
If one or more cells in the range contain a formula that returns an error, the conditional formatting is not
applied to the entire range. To ensure that the conditional formatting is applied to the entire range, use an
IS or IFERROR function to return a value other than an error value.
Quick formatting

Microsoft Office Excel 2007 Customized Material

32

1. Select one or more cells in a range, table, or PivotTable report.


2. On the Home tab, in the Style group, click the arrow next to Conditional Formatting, click Icon
Set, and then select an icon set.

TIP You can change the method of scoping for fields in the Values area of a PivotTable report by using

the Apply formatting rule to options button.


Advanced formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Manage Rules.
The Conditional Formatting Rules Manager dialog box is displayed.
3. Do one of the following:

To add a conditional format, click New Rule.


The New Formatting Rule dialog box is displayed.

To change a conditional format, do the following:


1. Make sure that the appropriate worksheet, table, or PivotTable report is selected in
the Show formatting rules for list box.
2. Optionally, change the range of cells by clicking Collapse Dialog
in the Applies
to box to temporarily hide the dialog box, by selecting the new range of cells on the
worksheet, and then by selecting Expand Dialog

3. Select the rule, and then click Edit rule.


The Edit Formatting Rule dialog box is displayed.
4. Under Apply Rule To, to optionally change the scope for fields in the Values area of a
PivotTable report by:

Selection, click Just these cells.

Corresponding field, click All <value field> cells with the same fields.

Value field, click All <value field> cells.

Microsoft Office Excel 2007 Customized Material

33

5. Under Select a Rule Type, click Format all cells based on their values.
6. Under Edit the Rule Description, in the Format Style list box, select Icon Set.
1. Select an icon set. The default is 3 Traffic Lights (Unrimmed). The number of icons and
the default comparison operators and threshold values for each icon can vary for each icon
set.
2. If you want, you can adjust the comparison operators and threshold values. The default
range of values for each icon are equal in size, but you can adjust these to fit your unique
requirements. Make sure that the thresholds are in a logical sequence of highest to lowest
from top to bottom.
3. Do one of the following:

Format a number, date, or time value Select Number.

Format a percentage Select Percent.


Valid values are from 0 (zero) to 100. Do not enter a percent sign.
Use a percentage when you want to visualize all values proportionally because the
distribution of values is proportional.

Format a percentile Select Percentile.


Valid percentiles are from 0 (zero) to 100. You cannot use a percentile if the range of
cells contains more than 8,191 data points.
Use a percentile when you want to visualize a group of high values (such as the top
th

20 percentile) in one data bar proportion and low values (such as the bottom 20

th

percentile) in another data bar proportion, because they represent extreme values
that might skew the visualization of your data.

Microsoft Office Excel 2007 Customized Material

34

Format a formula result Select Formula, and then enter a formula in each Value
box.
The formula must return a number, date, or time value. Start the formula with an equal
sign (=). Invalid formulas result in no formatting applied. It's a good idea to test the
formula in the worksheet to make sure that the formula doesn't return an error value.

4. To make the first icon represent lower values and the last icon represent higher values,
select Reverse Icon Order.
5. To show only the icon and not the value in the cell, select Show Icon Only.
NOTES

You may need to adjust the column width to accommodate the icon.

There are three sizes of icons. The size of the icon that is displayed depends on the font
size that is used in that cell.

Format only cells that contain text, number, or date or


time values
To more easily find specific cells within a range of cells, you can format those specific cells based on a
comparison operator. For example, in an inventory worksheet sorted by categories, you can highlight the
products with fewer than 10 items on hand in yellow. Or, in a retail store summary worksheet, you can
identify all stores with profits greater than 10%, sales volumes less than $100,000, and region equal to
"SouthEast".
NOTE

You cannot conditionally format fields in the Values area of a PivotTable report by text or date,

only by number.

Microsoft Office Excel 2007 Customized Material

35

Quick formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Style group, click the arrow next to Conditional Formatting, and then
click Highlight Cells Rules.

3. Select the command that you want, such as Between, Equal To Text that Contains, or A Date
Occurring.
4. Enter the values that you want to use, and then select a format.
TIP You can change the method of scoping for fields in the Values area of a PivotTable report by using

the Apply formatting rule to options button.


Advanced formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Manage Rules.
The Conditional Formatting Rules Manager dialog box is displayed.
3. Do one of the following:

To add a conditional format, click New Rule.


The New Formatting Rule dialog box is displayed.

To change a conditional format, do the following:


1. Make sure that the appropriate worksheet, table, or PivotTable report is selected in
the Show formatting rules for list box.

Microsoft Office Excel 2007 Customized Material

36

2. Optionally, change the range of cells by clicking Collapse Dialog

in the Applies

to box to temporarily hide the dialog box, by selecting the new range of cells on the
worksheet, and then by selecting Expand Dialog

3. Select the rule, and then click Edit rule.


The Edit Formatting Rule dialog box is displayed.
4. Under Apply Rule To, to optionally change the scope for fields in the Values area of a
PivotTable report by:

Selection, click Just these cells.

Corresponding field, click All <value field> cells with the same fields.

Value field, click All <value field> cells.

5. Under Select a Rule Type, click Format only cells that contain.
6. Under Edit the Rule Description, in the Format only cells with list box, do one of the
following:

Format by number, date, or time Select Cell Value, select a comparison operator, and
then enter a number, date, or time.
For example, select Between and then enter 100 and 200, or select Equal to and then
enter 1/1/2006.
You can also enter a formula that returns a number, date, or time value. If you enter a
formula, start it with an equal sign (=). Invalid formulas result in no formatting applied. It's a
good idea to test the formula in the worksheet to make sure that the formula doesn't return
an error value.

Microsoft Office Excel 2007 Customized Material

37

Format by text Select Specific Text, select a comparison operator, and then enter text.
For example, select Contains and then enter Silver, or select Starting with and then enter
Tri.
Quotes are included in the search string, and you may use wildcard characters. The
maximum length of a string is 255 characters.
You can also enter a formula that returns text. If you enter a formula, start it with an equal
sign (=). Invalid formulas result in no formatting applied. It's a good idea to test the formula
in the worksheet to make sure that the formula doesn't return an error value.

Format by date Select Dates Occurring, and then select a date comparison.
For example, select Yesterday or Next week.

Format cells with blanks or no blanks Select Blanks or No Blanks.


NOTE

A blank value is a cell that contains no data and is different than a cell that

contains one or more spaces (which are text).

Format cells with error or no error values Select Errors or No Errors.


Error values include: #####, #VALUE!, #DIV/0!, #NAME?, #N/A, #REF!, #NUM!, and
#NULL!.

7. To specify a format, click Format.


The Format Cells dialog box is displayed.
8. Select the number, font, border, or fill format that you want to apply when the cell value meets
the condition, and then click OK.
You can choose more than one format. The formats that you select are displayed in the Preview
box.

Microsoft Office Excel 2007 Customized Material

38

Format only values that are above or below average


You can find values above or below an average or standard deviation in a range of cells. For example,
you can find the above average performers in an annual performance review or you can locate
manufactured materials that fall below two standard deviations in a quality rating.

Quick formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Style group, click the arrow next to Conditional Formatting, and then
click Top/Bottom Rules.

3. Select the command that you want, such as Above Average or Below Average.
4. Enter the values that you want to use, and then select a format.
TIP You can change the method of scoping for fields in the Values area of a PivotTable report by using

the Apply formatting rule to options button.

Microsoft Office Excel 2007 Customized Material

39

Advanced formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Manage Rules.
The Conditional Formatting Rules Manager dialog box is displayed.
3. Do one of the following:

To add a conditional format, click New Rule.


The New Formatting Rule dialog box is displayed.

To change a conditional format, do the following:


1. Make sure that the appropriate worksheet, table, or PivotTable report is selected in
the Show formatting rules for list box.
2. Optionally, change the range of cells by clicking Collapse Dialog

in the Applies

to box to temporarily hide the dialog box, by selecting the new range of cells on the
worksheet, and then by selecting Expand Dialog

3. Select the rule, and then click Edit rule.


The Edit Formatting Rule dialog box is displayed.
4. Under Apply Rule To, to optionally change the scope for fields in the Values area of a
PivotTable report by:

Selection, click Just these cells.

Corresponding field, click All <value field> cells with the same fields.

Value field, click All <value field> cells.

5. Under Select a Rule Type, click Format only values that are above or below average.
6. Under Edit the Rule Description, in the Format values that are list box, do one of the
following:

Microsoft Office Excel 2007 Customized Material

40

To format cells that are above or below the average for all of the cells in the range, select
Above or Below.

To format cells that are above or below one, two, or three standard deviations for all of the
cells in the range, select a standard deviation.

7. Optionally, change how the format is applied for fields in the Values area of a PivotTable report
that are scoped by corresponding field.
By default, the conditionally format is based on all visible values. However when you scope by
corresponding field, instead of using all visible values, you can apply the conditional format for
each combination of:

A column and its parent row field, by selecting each Column group.

A row and its parent column field, by selecting each Row group.

8. Click Format to display the Format Cells dialog box.


9. Select the number, font, border, or fill format that you want to apply when the cell value meets
the condition, and then click OK.
You can choose more than one format. The formats that you select are displayed in the Preview
box.

Microsoft Office Excel 2007 Customized Material

41

Format only unique or duplicate values


NOTE

You cannot conditionally format fields in the Values area of a PivotTable report by unique or

duplicate values.

Quick formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Style group, click the arrow next to Conditional Formatting, and then
click Highlight Cells Rules.

3. Select Duplicate Values.


4. Enter the values that you want to use, and then select a format.
Advanced formatting
1. Select one or more cells in a range, table, or PivotTable report.
2. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting, and then
click Manage Rules.
The Conditional Formatting Rules Manager dialog box is displayed.
3. Do one of the following:

To add a conditional format, click New Rule.


The New Formatting Rule dialog box is displayed.

To change a conditional format, do the following:

Microsoft Office Excel 2007 Customized Material

42

a) Make sure that the appropriate worksheet or table is selected in the Show formatting
rules for list box.
b) Optionally, change the range of cells by clicking Collapse Dialog

in the Applies

to box to temporarily hide the dialog box, by selecting the new range of cells on the
worksheet, and then by selecting Expand Dialog

c) Select the rule, and then click Edit rule.


The Edit Formatting Rule dialog box is displayed.
4. Under Select a Rule Type, click Format only unique or duplicate values.
5. Under Edit the Rule Description, in the Format all list box, select unique or duplicate.
6. Click Format to display the Format Cells dialog box.
7. Select the number, font, border, or fill format that you want to apply when the cell value meets
the condition, and then click OK.
You can choose more than one format. The formats that you select are displayed in the Preview
box.

Microsoft Office Excel 2007 Customized Material

43

Find cells that have conditional formats


If your worksheet has one or more cells with a conditional format, you can quickly locate them so that you
can copy, change, or delete the conditional formats. You can use the Go To Special command to either
find only cells with a specific conditional format or find all cells with conditional formats.

Find all cells that have a conditional format


1. Click any cell without a conditional format.
2. On the Home tab, in the Editing group, click the arrow next to Find & Select, and then click
Conditional Formatting.

Find only cells with the same conditional format


1. Click the cell that has the conditional format that you want to find.
2. On the Home tab, in the Editing group, click the arrow next to Find & Select, and then click Go
To Special.

3. Click Conditional formats.


4. Click Same under Data validation.
Top of Page

Microsoft Office Excel 2007 Customized Material

44

Clear conditional formats


Do one of the following:
Worksheet
1. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting,
and then click Clear Rules.

2. Click Entire Sheet.


A range of cells, table, or PivotTable
3. Select the range of cells, table, or PivotTable for which you want to clear conditional
formats.
4. On the Home tab, in the Styles group, click the arrow next to Conditional Formatting,
and then click Clear Rules.

Resources
Conditional Formatting Step By Step
Conditional Formatting Exercise

Microsoft Office Excel 2007 Customized Material

45

Section 4
Relative and Absolute Values
1. Select the cell that contains the formula.
2. In the formula bar (formula bar: A bar at the top of the Excel window that you use to enter or edit
values or formulas in cells or charts. Displays the constant value or formula stored in the active
cell.)

, select the reference that you want to change.

3. Press F4 to switch between the reference types.


The following table summarizes how a reference type updates if a formula containing 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 (absolute cell reference: In a formula, the exact


address of a cell, regardless of the position of the cell that contains
the formula. An absolute cell reference takes the form $A$1.)
column and absolute row)

$A$1

A$1 (relative (relative reference: In a formula, the address of a cell


based on the relative position of the cell that contains the formula
and the cell referred to. If you copy the formula, the reference
automatically adjusts. A relative reference takes the form A1.)
column and absolute row)

C$1

$A1 (absolute column and relative row)

$A3

A1 (relative column and relative row)

C3

Resources
Absolute Values Exercise

Microsoft Office Excel 2007 Customized Material

46

Section 5
Array Formula
This section introduces array constants and explains how to enter, edit, and troubleshoot them.

A brief introduction to array constants


Array constants are a component of array formulas. You create array constants by entering a list of items
and then manually surrounding the list with braces ({ }), like so:
={1,2,3,4,5}
Earlier in this article, we emphasized the need to press CTRL+SHIFT+ENTER when you create array
formulas. Because array constants are a component of array formulas, you surround the constants with
braces manually by typing them. You then use CTRL+SHIFT+ENTER to enter the entire formula.
If you delimit (separate) the items by using commas, you create a horizontal array (a row). If you delimit
the items by using semicolons, you create a vertical array (a column). To create a two-dimensional array,
you delimit the items in each row by using commas, and you delimit each row by using semicolons.
As with array formulas, you can use array constants with any of the built-in functions that Excel provides.
The following sections explain how to create each kind of constant and how to use these constants with
functions in Excel.

Microsoft Office Excel 2007 Customized Material

47

Create one-dimensional and two-dimensional constants


The following procedure will give you some practice in creating horizontal, vertical, and two-dimensional
constants.

Create a horizontal constant


1. Use the workbook from the previous column, or start a new workbook.
2. Select cells A1 through E1.
3. In the formula bar, enter the following formula, and then press CTRL+SHIFT+ENTER:
={1,2,3,4,5}
NOTE

In this case, you should type the opening and closing braces ({ }).

You see the following result.

You may wonder why you can't just type the numbers manually. Keep going, because the Use constants
in formulas section, later in this article, demonstrates the advantages of using array constants.

Create a vertical constant


1. In your workbook, select a column of five cells.
2. In the formula bar, enter the following formula and press CTRL+SHIFT+ENTER:
={1;2;3;4;5}
You see the following result.

Microsoft Office Excel 2007 Customized Material

48

Create a two-dimensional constant


1. In your workbook, select a block of cells four columns wide by three rows high.
2. In the formula bar, enter the following formula, and then press CTRL+SHIFT+ENTER:
={1,2,3,4;5,6,7,8;9,10,11,12}
You see the following result:

Use constants in formulas


Now that you are familiar with entering array constants, here is a simple example that uses what we've
discussed:
1. Open a blank worksheet.

Microsoft Office Excel 2007 Customized Material

49

2. Copy the following table starting at cell A1. Use the Paste Options button

that appears

nearby to match the destination formatting.

3. In cell A3, enter the following formula, and then press CTRL+SHIFT+ENTER:
=SUM(A1:E1*{1,2,3,4,5})
Notice that Excel surrounds the constant with another set of braces, because you entered it as an array
formula.

The value 85 appears in cell A3. The next section explains how the formula works.

Microsoft Office Excel 2007 Customized Material

50

A look at the array constant syntax


The formula you just used contains several parts.

Function
Stored array
Operator
Array constant

The last element inside the parentheses is the array constant: {1,2,3,4,5}. Remember that Excel does not
surround array constants with braces; you must do this. Also remember that after you add a constant to
an array formula, you press CTRL+SHIFT+ENTER to enter the formula.
Because Excel performs operations on expressions enclosed in parentheses first, the next two elements
that come into play are the values stored in the workbook (A1:E1) and the operator. At this point, the
formula multiplies the values in the stored array by the corresponding values in the constant. It's the
equivalent of:
=SUM(A1*1,B1*2,C1*3,D1*4,E1*5)
Finally, the SUM function adds the values, and the sum 85 appears in cell A3:
To avoid using the stored array and to just keep the operation entirely in memory, replace the stored
array with another array constant:
=SUM({3,4,5,6,7}*{1,2,3,4,5})

Microsoft Office Excel 2007 Customized Material

51

To try this, copy the function, select a blank cell in your workbook, paste the formula into the formula bar,
and then press CTRL+SHIFT+ENTER. You see the same result as you did in the earlier exercise that
used the array formula =SUM(A1:E1*{1,2,3,4,5}).

Elements that you can use in constants


Array constants can contain numbers, text, logical values (such as TRUE and FALSE), and error values (
such as #N/A). You can use numbers in the integer, decimal, and scientific formats. If you include text,
you must surround that text with double quotation marks (").
Array constants cannot contain additional arrays, formulas, or functions. In other words, they can contain
only text or numbers that are separated by commas or semicolons. Excel displays a warning message
when you enter a formula such as {1,2,A1:D4} or {1,2,SUM(Q2:Z8)}. Also, numeric values cannot contain
percent signs, dollar signs, commas, or parentheses.

Resources
Array Formula Step By Step
Array with IF Exercise

Microsoft Office Excel 2007 Customized Material

52

Section 6
Using NAMES
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

Example with no name

Example with a name

Reference

=SUM(C20:C30)

=SUM(FirstQuarterSales)

Constant

=PRODUCT(A5,8.3)

=PRODUCT(Price,WASalesTax)

Formula

=SUM(VLOOKUP(A1,B1:F20,5,FALSE), -G5)

=SUM(Inventory_Level,-Order_Amt)

Table

C4:G36

=TopSales06

Types of names
There are several types of names that 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 Microsoft Office 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 that you insert an Excel table, but you can change a table's name to make it more
meaningful. For more information about Excel tables.

The scope of a name


All names have a scope, either to a specific worksheet (also called the local worksheet level) or to the
entire workbook (also called the global workbook level). The scope of a name is the location within which
the name is recognized without qualification. For example:
If you have defined a name, such as Budget_FY08, and its scope is Sheet1, that name, if not
qualified, is recognized only in Sheet1, but not in other sheets without qualification.

Microsoft Office Excel 2007 Customized Material

53

To use a local worksheet name in another worksheet, you can qualify it by preceding it with the
worksheet name, as the following example shows:
Sheet1!Budget_FY08
If you have defined a name, such as Sales_Dept_Goals, and its scope is the workbook, that
name is recognized for all worksheets in that workbook, but not for any other workbook.
A name must always be unique within its scope. Excel prevents you from defining a name that is not
unique within its scope. However you can use the same name in different scopes. For example, you can
define a name, such as GrossProfit that is scoped to Sheet1, Sheet2, and Sheet3 in the same workbook.
Although each name is the same, each name is unique within its scope. You might do this to ensure that
a formula that uses the name, GrossProfit, is always referencing the same cells at the local worksheet
level.
You can even define the same name, GrossProfit, for the global workbook level, but again the scope is
unique. In this case, however, there can be a name conflict. To resolve this conflict, by default Excel uses
the name that is defined for the worksheet because the local worksheet level takes precedence over the
global workbook level. If you want to override the precedence and you want to use the workbook name,
you can disambiguate the name by prefixing the workbook name as the following example shows:
WorkbookFile!GrossProfit
You can override the local worksheet level for all worksheets in the workbook, with the exception of the
first worksheet, which always uses the local name if there is a name conflict and cannot be overridden.

Defining and entering names


You define 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.

Microsoft Office Excel 2007 Customized Material

54

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

By default, names use absolute cell references.

You can enter a name by:


Typing 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 Formulas tab.

Auditing names
You can also create a list of defined names in a workbook. Locate an area with two empty columns on the
worksheet (the list will contain two columns, one for the name and one for a description of the name).
Select a cell that will be the upper-left corner of the list. On the Formulas tab, in the Defined Names
group, click Use in Formula, click Paste and then, in the Paste Names dialog box, click Paste List.

Learn about syntax rules for names


The following is a list of syntax rules that you need to be aware of when you create and edit names.
Valid characters The first character of a name must be a letter, an underscore character (_), or
a backslash (\). Remaining characters in the name can be letters, numbers, periods, and
underscore characters.
NOTE

You cannot use the uppercase and lowercase characters "C", "c", "R", or "r" as a

defined name, because they are all used as a shorthand for selecting a row or column for the
currently selected cell when you enter them in a Name or Go To text box.
Cell references disallowed Names cannot be the same as a cell reference, such as Z$100 or
R1C1.

Microsoft Office Excel 2007 Customized Material

55

Spaces are not valid Spaces are not allowed as part of a name. Use the underscore character
(_) and period (.) as word separators, such as, Sales_Tax or First.Quarter.
Name length A name can contain up to 255 characters.
Case sensitivity Names can contain uppercase and lowercase letters. Excel does not
distinguish between uppercase and lowercase characters in names. For example, if you created
the name Sales and then create another name called SALES in the same workbook, Excel
prompts you to choose a unique name.

Define a name for a cell or cell range on a worksheet


1. Select the cell, range of cells, or nonadjacent selections that you want to name.
2. Click the Name box at the left end of the formula bar.

Name box

3. Type the name that you want to use to refer to your selection. Names can be up to 255
characters in length.
4. Press ENTER.
NOTE

You cannot name a cell while you are changing the contents of the cell.

Microsoft Office Excel 2007 Customized Material

56

Define a name by using a selection of cells in the


worksheet
You can convert existing row and column labels to names.
1. Select the range that you want to name, including the row or column labels.
2. On the Formulas tab, in the Defined Names group, click Create from Selection.

3. In the Create Names from Selection dialog box, designate the location that contains the labels
by selecting the Top row, Left column, Bottom row, or Right column check box.
NOTE

A name created by using this procedure refers only to the cells that contain values and does not

include the existing row and column labels.

Microsoft Office Excel 2007 Customized Material

57

Define a name by using the New Name dialog box


1. On the Formulas tab, in the Defined Names group, click Define Name.

2. In the New Name dialog box, in the Name box, type the name that you want to use for your
reference.
NOTE

Names can be up to 255 characters in length.

3. To specify the scope of the name, in the Scope drop-down list box, select Workbook or the
name of a worksheet in the workbook.
4. Optionally, in the Comment box, enter a descriptive comment up to 255 characters.
NOTE

If you save the workbook to Microsoft Office SharePoint Server 2007 Excel Services,

and you specify one or more parameters, the comment is used as a ScreenTip in the
Parameters Task Pane.
5. In the Refers to box, do one of the following:

To enter a cell reference, type the cell reference.


TIP The current selection is entered by default. To enter other cell references as an

argument, click Collapse Dialog

(which temporarily shrinks the dialog box), select the

cells on the worksheet, and then click Expand Dialog

To enter a constant, type = (equal sign) and then type the constant value.

To enter a formula, type = and then type the formula.

6. To finish and return to the worksheet, click OK.


TIP To make the New Name dialog box wider or longer, click and drag the grip handle at the bottom.

Microsoft Office Excel 2007 Customized Material

58

Manage names by using the Name Manager Dialog box


Use the Name Manager dialog box to work with all of the defined names and table names in the
workbook. For example, you may want to find names with errors, confirm the value and reference of a
name, view or edit descriptive comments, or determine the scope. You can also sort and filter the list of
names, and easily add, change, or delete names from one location.
To open the Name Manager dialog box, on the Formulas tab, in the Defined Names group, click Name
Manager.

View names
The Name Manager dialog box displays the following information about each name in a list box:
This
Column:
Icon and
Name

Displays:
One of the following:
A defined name, which is indicated by a defined name icon.
A table name, which is indicated by a table name icon.

Value

The current value of the name, such as the results of a formula, a string constant, a cell range, an error,
an array of values, or a placeholder if the formula cannot be evaluated. The following are representative
examples:
"this is my string constant"
3.1459
{2003;12,2002;23,;2001,18
}
#REF!
{...}

Refers To

The current reference for the name. The following are representative examples:
=Sheet1!$A$3

Microsoft Office Excel 2007 Customized Material

59

=8.3
=HR!$A$1:$Z$345
=SUM(Sheet1!A1,Sheet2!B2
)
Scope

A worksheet name, if the scope is the local worksheet


level.
"Workbook", if the scope is the global worksheet level.

Comment

Additional information about the name up to 255 characters. The following are representative examples:
This value will expire on May 2, 2007.
Don't delete! Critical name!
Based on the ISO certification exam
numbers.

NOTE If you save the workbook to Microsoft Office SharePoint Server 2007 Excel Services, and you
specify one or more parameters, the comment is used as a ScreenTip in the Parameters Task Pane.

NOTES

You cannot use the Name Manager dialog box while you are changing the contents of the cell.
The Name Manager dialog box does not display names defined in Visual Basic for Applications
(VBA), or hidden names (the Visible property of the name is set to "False").

Resize columns
To automatically size the column to fit the largest value in that column, double-click the right side
of the column header.

Sort names
To sort the list of names in ascending or descending order, alternately click the column header.

Microsoft Office Excel 2007 Customized Material

60

Filter names
Use the commands in the Filter drop-down list to quickly display a subset of names. Selecting each
command toggles the filter operation on or off, which makes it easy to combine or remove different filter
operations to get the results that you want.
To filter the list of names, do one or more of the following:
Select:

To:

Names Scoped To
Worksheet

Display only those names that are local to a worksheet.

Names Scoped To
Workbook

Display only those names that are global to a workbook.

Names With Errors

Display only those names with values that contain errors (such as #REF, #VALUE, or
#NAME).

Names Without Errors

Display only those names with values that do not contain errors.

Defined Names

Display only names defined by you or by Excel, such as a print area.

Table Names

Display only table names.

Change a name
If you change a defined name or table name, all uses of that name in the workbook are also changed.
1. On the Formulas tab, in the Defined Names group, click Name Manager.

2. In the Name Manager dialog box, click the name that you want to change, and then click Edit.
TIP You can also double-click the name.

3. In the Edit Name dialog box, in the Name box, type the new name for the reference.
4. In the Refers to box, change the reference , and then click OK.
5. In the Name Manager dialog box, in the Refers to box, change the cell, formula, or constant
represented by the name.

Microsoft Office Excel 2007 Customized Material

61

To cancel unwanted or accidental changes, click Cancel

To save changes, click Commit

, or press ESC.

, or press ENTER.

The Close button only closes the Name Manager dialog box. It is not required to commit
changes that have already been made.
NOTE

Delete one or more names


1. On the Formulas tab, in the Defined Names group, click Name Manager.

2. In the Name Manager dialog box, click the name that you want to change.
3. Select one or more names by doing one of the following:

To select a name, click it.

To select more than one name in a contiguous group, click and drag the names, or press
SHIFT and click the mouse button for each name in the group.

To select more than one name in a noncontiguous group, press CTRL and click the mouse
button for each name in the group.

4. Click Delete. You can also press DELETE.


5. Click OK to confirm the deletion.
NOTE The Close button only closes the Name Manager dialog box. It is not required to commit
changes that have already been made

Resources

Name Step By Step


Name Exercise
Edited Name Exercise
Using Name in Function Exercise
Delete Name Exercise
General Exercise

Microsoft Office Excel 2007 Customized Material

62

Section 7
TABLE
When you create a table (previously known as list) in a Microsoft Office Excel worksheet (worksheet: The
primary document that you use in Excel to store and work with data. Also called a spreadsheet. A
worksheet consists of cells that are organized into columns and rows; a worksheet is always stored in a
workbook.), you can manage and analyze the data in that table independently of data outside the table.
For example, you can filter table columns, add a row for totals, apply table formatting, and publish a table
to a server that is running Windows SharePoint Services 3.0.

If you do not want to work with your data in a table, you can convert the table to a regular range while
keeping any table style formatting that you applied. When you no longer need a table, you can delete it.
NOTE

Excel tables should not be confused with the data tables (data table: A range of cells that shows

the results of substituting different values in one or more formulas. There are two types of data tables:
one-input tables and two-input tables.) that are part of a suite of what-if analysis commands.

Microsoft Office Excel 2007 Customized Material

63

Create a table
You can use one of two ways to create a table. You can either insert a table in the default table style or
you can format your data as a table in a style that you choose.

Insert a table
1. On a worksheet, select the range of cells that you want to include in the table. The cells can be
empty or can contain data.
2. On the Insert tab, in the Tables group, click Table.

Keyboard shortcut You can also press CTRL+L or CTRL+T.


3. If the selected range contains data that you want to display as table headers, select the My table
has headers check box.
Table headers display default names if you do not select the My table has headers check box.
You can change the default names by typing the text that you want.
NOTE

If you do not want to display table headers, you can turn them off later. For more

information about how to turn table headers off.

Tips
After you create a table, the Table Tools become available, and a Design tab is displayed. You
can use the tools on the Design tab to customize or edit the table.
Unlike lists in Office Excel 2003, a table does not have a special row (marked with *) for quickly
adding new rows. For more information about how to add or insert rows in a table.

Microsoft Office Excel 2007 Customized Material

64

Format data as a table


1. On the worksheet, select a range of empty cells or cells that contain the data that you want to
quickly format as a table.
2. On the Home tab, in the Styles group, click Format as Table.

NOTE

When you use Format as Table, Office Excel automatically inserts a table.

3. Under Light, Medium, or Dark, click the table style that you want to use.
NOTE

Custom table styles are available under Custom after you create one or more of them.

For information about how to create a custom table style.

Tips
After you create a table, the Table Tools become available, and a Design tab is displayed. You
can use the tools on the Design tab to customize or edit the table.

Unlike lists in Office Excel 2003, a table does not have a special row (marked with *) for quickly
adding new rows. For more information about how to add or insert rows in a table,

Convert a table to a range of data


1. Click anywhere in the table.
TIP This displays the Table Tools, adding the Design tab.

2. On the Design tab, in the Tools group, click Convert to Range.

Microsoft Office Excel 2007 Customized Material

65

NOTE

Table features are no longer available after you convert the table back to a range. For

example, the row headers no longer include the sort and filter arrows, and structured references
(references that use table names) that were used in formulas turn into regular cell references.

Tips
You can also right-click the table, point to Table, and then click Convert to Range.
Immediately after you create a table, you can also click Undo

on the Quick Access Toolbar

to convert that table back to a range.

Delete a table
1. On a worksheet, select a table.
2. Press DELETE.
TIP You can also click Undo

on the Quick Access Toolbar to delete a table that you just created.

Resources
Filter Step By Step
Table Step By Step
Table Exercise

Microsoft Office Excel 2007 Customized Material

66

Section 8
Advanced Filter
The Advanced command works differently from the Filter command in several important ways.
It displays the Advanced Filter dialog box instead of the AutoFilter menu.
You type the advanced criteria in a separate criteria range on the worksheet and above the
range of cells or table you want to filter. Microsoft Office Excel uses the separate criteria range in
the Advanced Filter dialog box as the source for the advanced criteria.
Example: Criteria range (A1:C4) and list range (A6:C10) used for the following
procedures
The example may be easier to understand if you copy it to a blank worksheet.
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

Microsoft Office Excel 2007 Customized Material

67

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

Type

Salesperson

Sales

Type

Salesperson

Sales

Beverages

Suyama

$5122

Meat

Davolio

$450

produce

Buchanan

$6328

10

Produce

Davolio

$6544

1
2
3
4
5

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

Meaning

Example

= (equal sign)

Equal to

A1=B1

> (greater than sign)

Greater than

A1>B1

< (less than sign)

Less than

A1<B1

>= (greater than or equal to sign)

Greater than or equal to

A1>=B1

<= (less than or equal to sign)

Less than or equal to

A1<=B1

<> (not equal to sign)

Not equal to

A1<>B1

Microsoft Office Excel 2007 Customized Material

68

Using the equal sign to type text or a value


Because the equal sign (=) is used to indicate a formula when you type text or a value in a cell, Excel
evaluates what you type; however, this may cause unexpected filter results. To indicate an equality
comparison operator for either text or a value, type the criteria as a string expression in the appropriate
cell in the criteria range:
=''=entry''
Where entry is the text or value you want to find. For example:
What you type in the cell

What Excel evaluates and displays

="=Davolio"

=Davolio

="=3000"

=3000

Resources
Advanced Filter Step By Step
Advanced Filter Exercise

Microsoft Office Excel 2007 Customized Material

69

Section 9
Data Validation
Data validation is an Excel feature that you can use to define restrictions on what data can or should be
entered in a cell. You can configure data validation to prevent users from entering data that is not valid. If
you prefer, you can allow users to enter invalid data but warn them when they try to type it in the cell. You
can also provide messages to define what input you expect for the cell, and instructions to help users
correct any errors.
For example, in a marketing workbook, you can set up a cell to allow only account numbers that are
exactly three characters long. When users select the cell, you can show them a message such as this
one:

If users ignore this message and type invalid data in the cell, such as a two-digit or five-digit number, you
can show them an actual error message.
In a slightly more advanced scenario, you might use data validation to calculate the maximum allowed
value in a cell based on a value elsewhere in the workbook. In the following example, the user has typed
$4,000 in cell E7, which exceeds the maximum limit specified for commissions and bonuses.

Microsoft Office Excel 2007 Customized Material

70

If the payroll budget were to increase or decrease, the allowed maximum in E7 would automatically
increase or decrease with it.
Data validation options are located in the Data Tools group.

You configure data validation in the Data Validation dialog box.

Microsoft Office Excel 2007 Customized Material

71

When is data validation useful?


Data validation is invaluable when you want to share a workbook with others in your organization, and
you want the data entered in the workbook to be accurate and consistent.
Among other things, you can use data validation to do the following:
Restrict data to predefined items in a list For example, you can limit types of departments to
Sales, Finance, R&D, and IT. Similarly, you can create a list of values from a range of cells
elsewhere in the worksheet. For more information.

Restrict numbers outside a specified range For example, you can specify a minimum limit of
deductions to two times the number of children in a particular cell.
Restrict dates outside a certain time frame For example, you can specify a time frame
between today's date and 3 days from today's date.

Microsoft Office Excel 2007 Customized Material

72

Restrict times outside a certain time frame For example, you can specify a time frame for
serving breakfast between the time when the restaurant opens and 5 hours after the restaurant
opens.
Limit the number of text characters For example, you can limit the allowed text in a cell to 10
or fewer characters. Similarly, you can set the specific length for a full name field (C1) to be the
current length of a first name field (A1) and a last name field (B1), plus 10 characters.
Validate data based on formulas or values in other cells For example, you can use data
validation to set a maximum limit for commissions and bonuses of $3,600, based on the overall
projected payroll value. If users enter more than $3,600 in the cell, they see a validation
message.

Data validation messages


What users see when they enter invalid data into a cell depends on how you have configured the data
validation. You can choose to show an input message when the user selects the cell. This type of
message appears near the cell. You can move this message, if you want to, and it remains until you
move to another cell or press ESC.

Input messages are generally used to offer users guidance about the type of data that you want entered
in the cell.
You can also choose to show an error alert that appears only after users enter invalid data.

Microsoft Office Excel 2007 Customized Material

73

You can choose from three types of error alerts:


Icon

Type

Use to

Stop

Prevent users from entering invalid data in a cell. A Stop alert message has two options:
Retry or Cancel.

Warning

Warn users that the data they entered is invalid, without preventing them from entering it.
When a Warning alert message appears, users can click Yes to accept the invalid entry, No
to edit the invalid entry, or Cancel to remove the invalid entry.

Information

Inform users that the data they entered is invalid, without preventing them from entering it.
This type of error alert is the most flexible. When an Information alert message appears,
users can click OK to accept the invalid value or Cancel to reject it.

You can customize the text that users see in an error alert message. If you choose not to do so, users
see a default message.
Input messages and error alerts appear only when data is typed directly into the cells. They do not appear
under the following conditions:
A user enters data in the cell by copying or filling.
A formula in the cell calculates a result that is not valid.
A macro enters invalid data in the cell.

Microsoft Office Excel 2007 Customized Material

74

Tips for working with data validation


In the following list, you will find tips and tricks for working with data validation in Excel.
If you plan to protect the worksheet or workbook, protect it after you have finished specifying any
validation settings. Make sure that you unlock any validated cells before you protect the
worksheet. Otherwise, users will not be able to type any data in the cells.
If you plan to share the workbook, share it only after you have finished specifying data validation
and protection settings. After you share a workbook, you won't be able to change the validation
settings unless you stop sharing, but Excel will continue to validate the cells that you have
designated while the workbook is being shared.
You can apply data validation to cells that already have data entered in them. However, Excel
does not automatically notify you that the existing cells contain invalid data. In this scenario, you
can highlight invalid data by instructing Excel to circle it on the worksheet. Once you have
identified the invalid data, you can hide the circles again. If you correct an invalid entry, the circle
disappears automatically.

To quickly remove data validation for a cell, select it, and then open the Data Validation dialog
box (Data tab, Data Tools group). On the Settings tab, click Clear All.
To find the cells on the worksheet that have data validation, on the Home tab, in the Editing
group, click Find & Select, and then click Data Validation. After you have found the cells that
have data validation, you can change, copy, or remove validation settings.
When creating a drop-down list, you can use the Define Name command (Formulas tab,
Defined Names group) to define a name for the range that contains the list. After you create the
list on another worksheet, you can hide the worksheet that contains the list and then protect the
workbook so that users won't have access to the list.
If data validation isn't working, make sure that:

Microsoft Office Excel 2007 Customized Material

75

Users are not copying or filling data Data validation is designed to show messages and prevent
invalid entries only when users type data directly in a cell. When data is copied or filled, the messages do
not appear. To prevent users from copying and filling data by dragging and dropping cells, clear the
Enable fill handle and cell drag-and-drop check box (Excel Options dialog box, Advanced options),
and then protect the worksheet.
Manual recalculation is turned off If manual recalculation is turned on, uncalculated cells can prevent
data from being validated correctly. To turn off manual recalculation, on the Formulas tab, in the
Calculation group, click Calculation Options, and then click Automatic.
Formulas are error free Make sure that formulas in validated cells do not cause errors, such as #REF!
or #DIV/0!. Excel ignores the data validation until you correct the error.
Cells referenced in formulas are correct If a referenced cell changes so that a formula in a validated
cell calculates an invalid result, the validation message for the cell won't appear.

Add data validation to a cell or range

Restrict data entry to values in a drop-down list


It is not possible to change the font or font size for items in a list.
1. Select one or more cells to validate.
2. On the Data tab, in the Data Tools group, click Data Validation.

Issue: The Data Validation command is unavailable.


3. In the Data Validation dialog box, click the Settings tab.
4. In the Allow box, select List.

Microsoft Office Excel 2007 Customized Material

76

5. Click the Source box and then type the list values separated by the Microsoft Windows list
separator character (commas by default).
For example:

To limit entry to a question, such as "Do you have children?", to two choices, type Yes, No.

To limit a vendor's quality reputation to three ratings, type Low, Average, High.
You can also create the list entries by referring to a range of cells elsewhere in the workbook.
For more information.
NOTE

The width of the drop-down list is determined by the width of the cell that has the data

validation. You might need to adjust the width of that cell to prevent truncating the width of valid
entries that are wider than the width of the drop-down list.
6. Make sure that the In-cell dropdown check box is selected. Otherwise, you won't be able to see
the drop-down arrow next to the cell.
7. To specify how you want to handle blank (null) values, select or clear the Ignore blank check
box.
NOTE

If your allowed values are based on a cell range that has a defined name and there is a

blank cell anywhere in that range, selecting the Ignore blank check box allows any value to be
entered in the validated cell. This is also true for any cells that are referenced by validation
formulas: if any referenced cell is blank, selecting the Ignore blank check box allows any value
to be entered in the validated cell.
8. Optionally, display an input message when the cell is clicked.
How to display an input message
1. Click the Input Message tab.
2. Make sure the Show input message when cell is selected check box is selected.
3. Fill in the title and text for the message.
Specify how you want Microsoft Office Excel to respond when invalid data is entered.

Microsoft Office Excel 2007 Customized Material

77

How to specify a response to invalid data


0. Click the Error Alert tab, and make sure that the Show error alert after invalid data is
entered check box is selected.
NOTE

If you want to allow users to type entries that are not in the list, clear the Show

error alert after invalid data is entered check box instead.


1. Select one of the following options for the Style box:

To display an information message that does not prevent entry of invalid data, select
Information.

To display a warning message that does not prevent entry of invalid data, select
Warning.

To prevent entry of invalid data, select Stop.

2. Fill in the title and text for the message (up to 225 characters).
NOTE

If you don't enter a title or text, the title uses the default string "Microsoft Excel" and

the message is (by default): "The value you entered is not valid. A user has restricted
values that can be entered into this cell."
Test the data validation to make sure that it is working correctly.
Try entering both valid and invalid data in the cells to make sure that your settings are working
as you intended and your messages are appearing when you expect.
Tip If you change the validation settings for a cell, you can automatically apply your changes to
all other cells that have the same settings. To do so, open the Data Validation dialog box, and
then select the Apply these changes to all other cells with the same settings check box on
the Settings tab.

Restrict data entry to a whole number within limits


1. Select one or more cells to validate.
2. On the Data tab, in the Data Tools group, click Data Validation.

Microsoft Office Excel 2007 Customized Material

78

Issue: The Data Validation command is unavailable.


3. In the Data Validation dialog box, click the Settings tab.
4. In the Allow box, select Whole number.
5. In the Data box, select the type of restriction that you want. For example, to set upper and lower
limits, select between.
6. Enter the minimum, maximum, or specific value to allow. You can also enter a formula that
returns a number value.
For example, to set a minimum limit of deductions to two times the number of children in cell F1,
select greater than or equal to in the Data box and enter the formula, =2*F1, in the Minimum
box.
7. To specify how you want to handle blank (null) values, select or clear the Ignore blank check
box.
NOTE

If your allowed values are based on a cell range with a defined name, and there is a

blank cell anywhere in the range, setting the Ignore blank check box allows any values to be
entered in the validated cell. This is also true for any cells that are referenced by validation
formulas: if any referenced cell is blank, setting the Ignore blank check box allows any values to
be entered in the validated cell.
8. Optionally, display an input message when the cell is clicked.
How to display an input message
1. Click the Input Message tab.
2. Make sure the Show input message when cell is selected check box is selected.
3. Fill in the title and text for the message.

Microsoft Office Excel 2007 Customized Material

79

9. Specify how you want Microsoft Office Excel to respond when invalid data is entered.
How to specify a response to invalid data
1. Click the Error Alert tab, and make sure that the Show error alert after invalid data is
entered check box is selected.
2. Select one of the following options for the Style box:

To display an information message that does not prevent entry of invalid data, select
Information.

To display a warning message that does not prevent entry of invalid data, select
Warning.

To prevent entry of invalid data, select Stop.

3. Fill in the title and text for the message (up to 225 characters).
NOTE

If you don't enter a title or text, the title defaults to "Microsoft Excel" and the

message to: "The value you entered is not valid. A user has restricted values that can be
entered into this cell."
10. Test the data validation to make sure that it is working correctly.
Try entering both valid and invalid data in the cells to make sure that your settings are working
as you intended and your messages are appearing when you expect.
Tip If you change the validation settings for a cell, you can automatically apply your changes to
all other cells that have the same settings. To do so, open the Data Validation dialog box, and
then select the Apply these changes to all other cells with the same settings check box on
the Settings tab.

Restrict data entry to a decimal number within limits


1. Select one or more cells to validate.
2. On the Data tab, in the Data Tools group, click Data Validation.

Microsoft Office Excel 2007 Customized Material

80

Issue: The Data Validation command is unavailable.


3. In the Data Validation dialog box, click the Settings tab.
4. In the Allow box, select Decimal.
5. In the Data box, select the type of restriction that you want. For example, to set upper and lower
limits, select between.
6. Enter the minimum, maximum, or specific value to allow. You can also enter a formula that
returns a number value.
For example, to set a maximum limit for commissions and bonuses of 6% of a salesperson's
salary in cell E1, select less than or equal to in the Data box and enter the formula, =E1*6%, in
the Maximum box.
NOTE

To let a user enter percentages, for example 20%, select Decimal in the Allow box,

select the type of restriction that you want in the Data box, enter the minimum, maximum, or
specific value as a decimal, for example .2, and then display the data validation cell as a
percentage by selecting the cell and clicking Percent Style

in the Number group on the

Home tab.
7. To specify how you want to handle blank (null) values, select or clear the Ignore blank check
box.
NOTE

If your allowed values are based on a cell range with a defined name, and there is a

blank cell anywhere in the range, setting the Ignore blank check box allows any values to be
entered in the validated cell. This is also true for any cells that are referenced by validation
formulas: if any referenced cell is blank, setting the Ignore blank check box allows any values to
be entered in the validated cell.
8. Optionally, display an input message when the cell is clicked.

Microsoft Office Excel 2007 Customized Material

81

How to display an input message


1. Click the Input Message tab.
2. Make sure the Show input message when cell is selected check box is selected.
3. Fill in the title and text for the message.
9. Specify how you want Microsoft Office Excel to respond when invalid data is entered.
How to specify a response to invalid data
1. Click the Error Alert tab, and make sure that the Show error alert after invalid data is
entered check box is selected.
2. Select one of the following options for the Style box:

To display an information message that does not prevent entry of invalid data, select
Information.

To display a warning message that does not prevent entry of invalid data, select
Warning.

To prevent entry of invalid data, select Stop.

3. Fill in the title and text for the message (up to 225 characters).
NOTE

If you don't enter a title or text, the title defaults to "Microsoft Excel" and the

message to: "The value you entered is not valid. A user has restricted values that can be
entered into this cell."
10. Test the data validation to make sure that it is working correctly.
Try entering both valid and invalid data in the cells to make sure that your settings are working
as you intended and your messages are appearing when you expect.
Tip If you change the validation settings for a cell, you can automatically apply your changes to
all other cells that have the same settings. To do so, open the Data Validation dialog box, and
then select the Apply these changes to all other cells with the same settings check box on
the Settings tab.

Microsoft Office Excel 2007 Customized Material

82

Restrict data entry to a date within a time frame


1. Select one or more cells to validate.
2. On the Data tab, in the Data Tools group, click Data Validation.

Issue: The Data Validation command is unavailable.


3. In the Data Validation dialog box, click the Settings tab.
4. In the Allow box, select Date.
5. In the Data box, select the type of restriction that you want. For example, to allow dates after a
certain day, select greater than.
6. Enter the start, end, or specific date to allow. You can also enter a formula that returns a date.
For example, to set a time frame between today's date and 3 days from today's date, select
between in the Data box, enter =TODAY() in the Minimum box, and enter =TODAY()+3 in the
Maximum box.
7. To specify how you want to handle blank (null) values, select or clear the Ignore blank check
box.
NOTE

If your allowed values are based on a cell range with a defined name, and there is a

blank cell anywhere in the range, setting the Ignore blank check box allows any values to be
entered in the validated cell. This is also true for any cells that are referenced by validation
formulas: if any referenced cell is blank, setting the Ignore blank check box allows any values to
be entered in the validated cell.
8. Optionally, display an input message when the cell is clicked.
How to display an input message
1. Click the Input Message tab.

Microsoft Office Excel 2007 Customized Material

83

2. Make sure the Show input message when cell is selected check box is selected.
3. Fill in the title and text for the message.
9. Specify how you want Microsoft Office Excel to respond when invalid data is entered.
How to specify a response to invalid data
1. Click the Error Alert tab, and make sure that the Show error alert after invalid data is
entered check box is selected.
2. Select one of the following options for the Style box:

To display an information message that does not prevent entry of invalid data, select
Information.

To display a warning message that does not prevent entry of invalid data, select
Warning.

To prevent entry of invalid data, select Stop.

3. Fill in the title and text for the message (up to 225 characters).
NOTE

If you don't enter a title or text, the title defaults to "Microsoft Excel" and the

message to: "The value you entered is not valid. A user has restricted values that can be
entered into this cell."
10. Test the data validation to make sure that it is working correctly.
Try entering both valid and invalid data in the cells to make sure that your settings are working
as you intended and your messages are appearing when you expect.
Tip If you change the validation settings for a cell, you can automatically apply your changes to
all other cells that have the same settings. To do so, open the Data Validation dialog box, and
then select the Apply these changes to all other cells with the same settings check box on
the Settings tab.

Microsoft Office Excel 2007 Customized Material

84

Restrict data entry to a time within a time frame


1. Select one or more cells to validate.
2. On the Data tab, in the Data Tools group, click Data Validation.

Issue: The Data Validation command is unavailable.


3. In the Data Validation dialog box, click the Settings tab.
4. In the Allow box, select Time.
5. In the Data box, select the type of restriction that you want. For example, to allow times before a
certain time of day, select less than.
6. Enter the start, end, or specific time to allow. You can also enter a formula that returns a time.
For example, to set a time frame for serving breakfast between the time when the restaurant
opens (the value in cell H1) and five hours after that, select between in the Data box, enter =H1
in the Minimum box, and then enter =H1+"5:00" in the Maximum box.
7. To specify how you want to handle blank (null) values, select or clear the Ignore blank check
box.
NOTE If your allowed values are based on a cell range with a defined name, and there is a
blank cell anywhere in the range, setting the Ignore blank check box allows any values to be
entered in the validated cell. This is also true for any cells that are referenced by validation
formulas: if any referenced cell is blank, setting the Ignore blank check box allows any values to
be entered in the validated cell.

8. Optionally, display an input message when the cell is clicked.


a) Click the Input Message tab.
b) Make sure the Show input message when cell is selected check box is selected.
c) Fill in the title and text for the message.

Microsoft Office Excel 2007 Customized Material

85

9. Specify how you want Microsoft Office Excel to respond when invalid data is entered.
a) Click the Error Alert tab, and make sure that the Show error alert after invalid data is
entered check box is selected.
b) Select one of the following options for the Style box:

To display an information message that does not prevent entry of invalid data, select
Information.

To display a warning message that does not prevent entry of invalid data, select
Warning.

To prevent entry of invalid data, select Stop.

c) Fill in the title and text for the message (up to 225 characters).
NOTE

If you don't enter a title or text, the title defaults to "Microsoft Excel" and the

message to: "The value you entered is not valid. A user has restricted values that can be
entered into this cell."
10. Test the data validation to make sure that it is working correctly.
Try entering both valid and invalid data in the cells to make sure that your settings are working
as you intended and your messages are appearing when you expect.
Tip If you change the validation settings for a cell, you can automatically apply your changes to
all other cells that have the same settings. To do so, open the Data Validation dialog box, and
then select the Apply these changes to all other cells with the same settings check box on
the Settings tab.

Restrict data entry to text of a specified length


1. Select one or more cells to validate.
2. On the Data tab, in the Data Tools group, click Data Validation.

Microsoft Office Excel 2007 Customized Material

86

3. In the Data Validation dialog box, click the Settings tab.


4. In the Allow box, select Text Length.
5. In the Data box, select the type of restriction that you want. For example, to allow up to a certain
number of characters, select less than or equal to.
6. Enter the minimum, maximum, or specific length for the text. You can also enter a formula that
returns a number value.
For example, to set the specific length for a full name field (C1) to be the current length of a first
name field (A1) and a last name field (B1) plus 10, select less than or equal to in the Data box
and enter =SUM(LEN(A1),LEN(B1),10) in the Maximum box.
7. To specify how you want to handle blank (null) values, select or clear the Ignore blank check
box.
NOTE

If your allowed values are based on a cell range with a defined name, and there is a

blank cell anywhere in the range, setting the Ignore blank check box allows any values to be
entered in the validated cell. This is also true for any cells that are referenced by validation
formulas: if any referenced cell is blank, setting the Ignore blank check box allows any values to
be entered in the validated cell.
8. Optionally, display an input message when the cell is clicked.
How to display an input message
1. Click the Input Message tab.
2. Make sure the Show input message when cell is selected check box is selected.
3. Fill in the title and text for the message.
9. Specify how you want Microsoft Office Excel to respond when invalid data is entered.
1. Click the Error Alert tab, and make sure that the Show error alert after invalid data is
entered check box is selected.
2. Select one of the following options for the Style box:

Microsoft Office Excel 2007 Customized Material

87

To display an information message that does not prevent entry of invalid data, select
Information.

To display a warning message that does not prevent entry of invalid data, select
Warning.

To prevent entry of invalid data, select Stop.

3. Fill in the title and text for the message (up to 225 characters).
NOTE

If you don't enter a title or text, the title defaults to "Microsoft Excel" and the

message to: "The value you entered is not valid. A user has restricted values that can be
entered into this cell."
10. Test the data validation to make sure that it is working correctly.
Try entering both valid and invalid data in the cells to make sure that your settings are working
as you intended and your messages are appearing when you expect.
Tip If you change the validation settings for a cell, you can automatically apply your changes to
all other cells that have the same settings. To do so, open the Data Validation dialog box, and
then select the Apply these changes to all other cells with the same settings check box on
the Settings tab.

Calculate what is allowed based on the content of another cell


1. Select one or more cells to validate.
2. On the Data tab, in the Data Tools group, click Data Validation.

3. In the Data Validation dialog box, click the Settings tab.


4. In the Allow box, select the type of data that you want.
5. In the Data box, select the type of restriction that you want.

Microsoft Office Excel 2007 Customized Material

88

6. In the box or boxes below the Data box, click the cell that you want to use to specify what is
allowed.
For example, to allow entries for an account only if the result won't go over the budget in cell E4,
select Decimal for Allow, select less than or equal to for Data, and in the Maximum box, enter
=E4.
7. To specify how you want to handle blank (null) values, select or clear the Ignore blank check
box.
NOTE

If your allowed values are based on a cell range with a defined name, and there is a

blank cell anywhere in the range, setting the Ignore blank check box allows any values to be
entered in the validated cell. This is also true for any cells that are referenced by validation
formulas: if any referenced cell is blank, setting the Ignore blank check box allows any values to
be entered in the validated cell.
8. Optionally, display an input message when the cell is clicked.
How to display an input message
1. Click the Input Message tab.
2. Make sure the Show input message when cell is selected check box is selected.
3. Fill in the title and text for the message.
9. Specify how you want Microsoft Office Excel to respond when invalid data is entered.
How to specify a response to invalid data
1. Click the Error Alert tab, and make sure that the Show error alert after invalid data is
entered check box is selected.
2. Select one of the following options for the Style box:

To display an information message that does not prevent entry of invalid data, select
Information.

Microsoft Office Excel 2007 Customized Material

89

To display a warning message that does not prevent entry of invalid data, select
Warning.

To prevent entry of invalid data, select Stop.

3. Fill in the title and text for the message (up to 225 characters).
NOTE

If you don't enter a title or text, the title defaults to "Microsoft Excel" and the

message to: "The value you entered is not valid. A user has restricted values that can be
entered into this cell."
10. Test the data validation to make sure that it is working correctly.
Try entering both valid and invalid data in the cells to make sure that your settings are working
as you intended and your messages are appearing when you expect.
Tip If you change the validation settings for a cell, you can automatically apply your changes to
all other cells that have the same settings. To do so, open the Data Validation dialog box, and
then select the Apply these changes to all other cells with the same settings check box on
the Settings tab.

Use a formula to calculate what is allowed


1. Select one or more cells to validate.
2. On the Data tab, in the Data Tools group, click Data Validation.

3. In the Data Validation dialog box, click the Settings tab.


4. In the Allow box, select Custom.
5. In the Formula box, enter a formula that calculates a logical value (TRUE for valid or FALSE for
invalid entries). For example:

Microsoft Office Excel 2007 Customized Material

90

To make sure that

Enter this formula

The cell for the picnic account (B1) can only be updated
if nothing is budgeted for the discretionary account (D1)
and the total budget (D2) is less than the $40,000
allocated.

=AND(D1=0,D2<40000)

The cell that contains a product description (B2) only


contains text.

=ISTEXT(B2)

For the cell that contains a projected advertising budget


(B3), the subtotal for subcontractors and services (E1)
must be less than or equal to $800, and the total budget
amount (E2) must also be less than or equal to $97,000.

=AND(E1<=800,E2<=97000)

The cell that contains an employee age (B4) is always


greater than the number of full years of employment
(F1) plus 18 (the minimum age of employment).

=IF(B4>F1+18,TRUE,FALSE)

All the data in the cell range A1:A20 contains unique


values.

=COUNTIF($A$1:$A$20,A1)=1
You must enter the formula in the data validation for cell
A1, and then fill the cells A2 though A20 so that the data
validation for each cell in the range has a similar
formula, but the second argument to the COUNTIF will
match the current cell.

The cell that contains a product code name (B5) always


begins with the standard prefix of ID- and is at least 10
characters long.

=AND(LEFT(B5, 3) ="ID-",LEN(B5) > 9)

6. To specify how you want to handle blank (null) values, select or clear the Ignore blank check
box.
NOTE

If your allowed values are based on a cell range with a defined name, and there is a

blank cell anywhere in the range, setting the Ignore blank check box allows any values to be
entered in the validated cell. This is also true for any cells that are referenced by validation
formulas: if any referenced cell is blank, setting the Ignore blank check box allows any values to
be entered in the validated cell.
7. Optionally, display an input message when the cell is clicked.
a) Click the Input Message tab.
b) Make sure the Show input message when cell is selected check box is selected.
c) Fill in the title and text for the message.
8. Specify how you want Microsoft Office Excel to respond when invalid data is entered.

Microsoft Office Excel 2007 Customized Material

91

How to specify a response to invalid data?


a) Click the Error Alert tab, and make sure that the Show error alert after invalid data is
entered check box is selected.
b) Select one of the following options for the Style box:

To display an information message that does not prevent entry of invalid data, select
Information.

To display a warning message that does not prevent entry of invalid data, select
Warning.

To prevent entry of invalid data, select Stop.

c) Fill in the title and text for the message (up to 225 characters).
NOTE

If you don't enter a title or text, the title defaults to "Microsoft Excel" and the

message to: "The value you entered is not valid. A user has restricted values that can be
entered into this cell."
9. Test the data validation to make sure that it is working correctly.
Try entering both valid and invalid data in the cells to make sure that your settings are working
as you intended and your messages are appearing when you expect.
Tip If you change the validation settings for a cell, you can automatically apply your changes to
all other cells that have the same settings. To do so, open the Data Validation dialog box, and
then select the Apply these changes to all other cells with the same settings check box on
the Settings tab.

Resources
Data Validation Step By Step
Data Validation Exercise
Data Validation Workshop

Microsoft Office Excel 2007 Customized Material

92

Section 10
Protect Worksheet & Workbook
Overview of worksheet or workbook element protection
When you share a workbook with other users, you may want to protect data in specific worksheet or
workbook elements to help prevent it from being changed. You can also specify a password that users
must enter to modify specific, protected worksheet and workbook elements. In addition, you can prevent
users from changing the structure of a worksheet.

Protecting worksheet elements


By default, when you protect a worksheet, all the cells on the worksheet are locked, and users cannot
make any changes to a locked cell. For example, they cannot insert, modify, delete, or format data in a
locked cell. However, you can specify which elements users will be able to change when you protect the
worksheet.
Hiding, locking, and protecting workbook and worksheet elements is not intended to help secure or
protect any confidential information that you keep in a workbook. It only helps obscure data or formulas
that might confuse other users and prevents them from viewing or making changes to that data.
Excel does not encrypt data that is hidden or locked in a workbook. To help keep confidential data
confidential, you may want to limit access to workbooks that contain such information by storing them in a
location that is available only to authorized users.
Before you protect a worksheet, you can unlock the ranges that you want users to be able to change or
enter data in. You can unlock cells for all users or for specific users.
For information on how to unlock cells and ranges in a protected worksheet.

Using a password to control access to protected elements


When you protect a worksheet or workbook by locking its elements, adding a password to edit the
unlocked elements is optional. In this context, the password is only intended to allow access to certain
users while helping to prevent changes by other users. This level of password protection does not

Microsoft Office Excel 2007 Customized Material

93

guarantee that all sensitive data in your workbook is secure. For optimal security, you should secure a
workbook itself with a password to help safeguard it from unauthorized access.
When you protect worksheet or workbook elements by using a password, it is very important that you
remember that password. Without it, you cannot unprotect the workbook or worksheet.
IMPORTANT

Use strong passwords that combine uppercase and lowercase letters, numbers, and symbols. Weak
passwords don't mix these elements. Strong password: Y6dh!et5. Weak password: House27. Passwords
should be 8 or more characters in length. A pass phrase that uses 14 or more characters is better. It is
critical that you remember your password. If you forget your password, Microsoft cannot retrieve it. Store
the passwords that you write down in a secure place away from the information that they help protect.

Protecting the structure and windows of a workbook


You can lock the structure of a workbook, which prevents users from adding or deleting worksheets or
from displaying hidden worksheets. You can also prevent users from changing the size or position of
worksheet windows. Workbook structure and window protection applies to the whole workbook.

Protect worksheet elements


1. Select the worksheet that you want to protect.
2. To unlock any cells or ranges that you want other users to be able to change, do the following:
1. Select each cell or range that you want to unlock.
2. On the Home tab, in the Cells group, click Format, and then click Format Cells.

3. On the Protection tab, clear the Locked check box, and then click OK.
3. To hide any formulas that you do not want to be visible, do the following:

Microsoft Office Excel 2007 Customized Material

94

Steps :1. In the worksheet, select the cells that contain the formulas that you want to hide.
2. On the Home tab, in the Cells group, click Format, and then click Format Cells.
3. On the Protection tab, select the Hidden check box, and then click OK.
4. To unlock any graphic objects (such as pictures, clip art, shapes, or Smart Art graphics) that you
want users to be able to change, do the following:
1. Hold down CTRL and then click each graphic object that you want to unlock.
This displays the Picture Tools or Drawing Tools, adding the Format tab.
TIP You can also use the Go To command to quickly select all the graphic objects in a

worksheet. On the Home tab, in the Editing group, click Find & Select, and then click Go To.
Click Special, and then click Objects.
2. On the Format tab, in the Size group, click the Dialog Box Launcher

next to Size.

3. On the Properties tab, clear the Locked check box, and if present, clear the Lock text check
box.
NOTE

You do not need to unlock buttons or controls for users to be able to click and use

them. You can unlock embedded charts, text boxes, and other objects created with the
drawing tools that you want users to be able to modify.
5. On the Review tab, in the Changes group, click Protect Sheet.

6. In the Allow all users of this worksheet to list, select the elements that you want users to be able
to change.

Microsoft Office Excel 2007 Customized Material

95

Worksheet elements
Clear this check box

To prevent users from

Select locked cells

Moving the pointer to cells for which the Locked check box is selected on the
Protection tab of the Format Cells dialog box. By default, users are allowed to
select locked cells.

Select unlocked cells

Moving the pointer to cells for which the Locked check box is cleared on the
Protection tab of the Format Cells dialog box. By default, users can select
unlocked cells, and they can press the TAB key to move between the unlocked cells
on a protected worksheet.

Format cells

Changing any of the options in the Format Cells or Conditional Formatting dialog
boxes. If you applied conditional formats before you protected the worksheet, the
formatting continues to change when a user enters a value that satisfies a different
condition.

Format columns

Using any of the column formatting commands, including changing column width or
hiding columns (Home tab, Cells group, Format button).

Format rows

Using any of the row formatting commands, including changing row height or hiding
rows (Home tab, Cells group, Format button).

Insert columns

Inserting columns.

Insert rows

Inserting rows.

Insert hyperlinks

Inserting new hyperlinks, even in unlocked cells.

Delete columns

Deleting columns.
NOTE If Delete columns is protected and Insert columns is not also
protected, a user can insert columns that he or she cannot delete.

Delete rows

Deleting rows.
NOTE If Delete rows is protected and Insert rows is not also protected, a user
can insert rows that he or she cannot delete.

Sort

Using any commands to sort data (Data tab, Sort & Filter group).
NOTE Users can't sort ranges that contain locked cells on a protected worksheet,
regardless of this setting.

Use AutoFilter

Using the drop-down arrows to change the filter on ranges when AutoFilters are
applied.
NOTE

Users cannot apply or remove AutoFilters on a protected worksheet,

Microsoft Office Excel 2007 Customized Material

96

regardless of this setting.

Use PivotTable reports

Formatting, changing the layout, refreshing, or otherwise modifying PivotTable


reports, or creating new reports.

Edit objects

Doing the any of the following:

Edit scenarios

Making changes to graphic objects including maps, embedded charts, shapes,


text boxes, and controls that you did not unlock before you protected the
worksheet. For example, if a worksheet has a button that runs a macro, you
can click the button to run the macro, but you cannot delete the button.

Making any changes, such as formatting, to an embedded chart. The chart


continues to be updated when you change its source data.

Adding or editing comments.


Viewing scenarios that you have hidden, making changes to scenarios that you have
prevented changes to, and deleting these scenarios. Users can change the values in
the changing cells, if the cells are not protected, and add new scenarios.

Chart sheet elements


Select this check box

To prevent users from

Contents

Making changes to items that are part of the chart, such as data series, axes, and
legends. The chart continues to reflect changes made to its source data.

Objects

Making changes to graphic objectsincluding shapes, text boxes, and controlsunless


you unlock the objects before you protect the chart sheet.

In the Password to unprotect sheet box, type a password for the sheet, click OK, and then
retype the password to confirm it.
NOTE

The password is optional. If you do not supply a password, then any user can unprotect the

sheet and change the protected elements. Make sure that you choose a password that is easy to
remember, because if you lose the password, you cannot gain access to the protected elements on
the worksheet.

Microsoft Office Excel 2007 Customized Material

97

Protect workbook elements


1. On the Review tab, in the Changes group, click Protect Workbook.

2. Under Protect workbook for, do one or more of the following:

To protect the structure of a workbook, select the Structure check box.

To keep workbook windows in the same size and position every time the workbook is opened,
select the Windows check box.

Microsoft Office Excel 2007 Customized Material

98

Workbook elements
Select this check box
Structure

To prevent users from

Viewing worksheets that you have hidden.

Moving, deleting, hiding, or changing the names of worksheets.

Inserting new worksheets or chart sheets (chart sheet: A sheet in a workbook


that contains only a chart. A chart sheet is beneficial when you want to view a
chart or a PivotChart report separately from worksheet data or a PivotTable
report.).
NOTE

Users will be able to insert an embedded chart (embedded chart: A

chart that is placed on a worksheet rather than on a separate chart sheet.


Embedded charts are beneficial when you want to view or print a chart or a
PivotChart report with its source data or other information in a worksheet.) in an
existing worksheet.

Windows

Moving or copying worksheets to another workbook.

In PivotTable reports, displaying the source data for a cell in the data area, or
displaying page field pages on separate worksheets.

For scenarios, creating a scenario summary report.

In the Analysis ToolPak, using the analysis tools that place results on a new
worksheet.

Changing the size and position of the windows for the workbook when the
workbook is opened.

Moving, resizing, or closing the windows.


NOTE

NOTE

Users will be able to hide and unhide windows.

If you run a macro that includes an operation that can't be performed in a protected

workbook, a message appears and the macro stops running.


3. To prevent other users from removing workbook protection, in the Password (optional) box, type a
password, click OK, and then retype the password to confirm it.
NOTE

The password is optional. If you do not supply a password, then any user can unprotect the

workbook and change the protected elements. Make sure that you choose a password that you can
remember, because if you lose the password, you cannot gain access to the protected elements in
the workbook.

Microsoft Office Excel 2007 Customized Material

99

Remove protection from a worksheet


1. On the Review tab, in the Changes group, click Unprotect Sheet.

NOTE

The Protect Sheet option changes to Unprotect Sheet when a worksheet is protected.

2. If prompted, type the password to unprotect the worksheet.

Resources
Protect Workbook Step By step
Protect Worksheet Step By Step
Protection Exercise

Microsoft Office Excel 2007 Customized Material

100

Section 11
Charts
Charts are used to display series of numeric data in a graphical format to make it easier to understand
large quantities of data and the relationship between different series of data.
To create a chart in Excel, you start by entering the numeric data for the chart on a worksheet. Then you
can plot that data into a chart by selecting the chart type that you want to use on the Office Fluent Ribbon
(Insert tab, Charts group).

Worksheet data
Chart created from worksheet data

Excel supports many types of charts to help you display data in ways that are meaningful to your
audience. When you create a chart or change an existing chart, you can select from a variety of chart

Microsoft Office Excel 2007 Customized Material

101

types (such as a column chart or a pie chart) and their subtypes (such as a stacked column chart or a pie
in 3-D chart). You can also create a combination chart by using more than one chart type in your chart.

Example of a combination chart that uses a column and line chart type.

For more information about the chart types that you can select in Excel

Getting to know the elements of a chart


A chart has many elements. Some of these elements are displayed by default, others can be added as
needed. You can change the display of the chart elements by moving them to other locations in the chart,
resizing them, or by changing the format. You can also remove chart elements that you do not want to
display.

Microsoft Office Excel 2007 Customized Material

102

The chart area of the chart.


The plot area of the chart.
The data points of the data series that are plotted in the chart.
The horizontal (category) and vertical (value) axis along which the data is plotted in the chart.
The legend of the chart.
A chart and axis title that you can use in the chart.
A data label that you can use to identify the details of a data point in a data series.

Modifying a basic chart to meet your needs


After you create a chart, you can modify any one of its elements. For example, you might want to change
the way that axes are displayed, add a chart title, move or hide the legend, or display additional chart
elements.
To modify a chart, you can:

Microsoft Office Excel 2007 Customized Material

103

Change the display of chart axes You can specify the scale of axes and adjust the interval
between the values or categories that are displayed. To make your chart easier to read, you can
also add tick marks to an axis, and specify the interval at which they will appear.
Add titles and data labels to a chart To help clarify the information that appears in your chart,
you can add a chart title, axis titles, and data labels.
Add a legend or data table You can show or hide a legend, change its location, or modify the
legend entries. In some charts, you can also show a data table that displays the legend keys and
the values that are presented in the chart.
Apply special options for each chart type Special lines (such as high-low lines and
trendlines), bars (such as up-down bars and error bars), data markers, and other options are
available for different chart types.
Applying a predefined chart layout and chart style for a professional look
Instead of manually adding or changing chart elements or formatting the chart, you can quickly apply a
predefined chart layout and chart style to your chart. Excel provides a variety of useful predefined layouts
and styles that you can select, but you can fine-tune a layout or style if it is needed by making manual
changes to the layout and format of individual chart elements, such as the chart area, plot area, data
series, or legend of the chart.
When you apply a predefined chart layout, a specific set of chart elements (such as titles, a legend, a
data table, or data labels) are displayed in a specific arrangement in your chart. You can select from a
variety of layouts that are provided for each chart type.
When you apply a predefined chart style, the chart is formatted based on the document theme that you
have applied, so that your chart matches your organization's or your own theme colors (a set of colors),
theme fonts (a set of heading and body text fonts), and theme effects (a set of lines and fill effects).
You cannot create your own chart layouts or styles, but you can create chart templates that include the
chart layout and formatting that you want.

Adding eye-catching formatting to a chart

Microsoft Office Excel 2007 Customized Material

104

In addition to applying a predefined chart style, you can easily apply formatting to individual chart
elements such as data markers, the chart area, the plot area, and the numbers and text in titles and
labels to give your chart a custom, eye-catching look. You can apply specific shape styles and WordArt
styles, and you can also format the shapes and text of chart elements manually.
To add formatting, you can:
Fill chart elements You can use colors, textures, pictures, and gradient fills to help draw
attention to specific chart elements.
Change the outline of chart elements You can use colors, line styles, and line weights to
emphasize chart elements.
Add special effects to chart elements You can apply special effects, such as shadow,
reflection, glow, soft edges, bevel, and 3-D rotation to chart element shapes, which gives your
chart a finished look.
Format text and numbers You can format text and numbers in titles, labels, and text boxes on
a chart as you would text and numbers on a worksheet. To make text and numbers stand out,
you can even apply WordArt styles.

Reusing charts by creating chart templates


If you want to reuse a chart that you customized to meet your needs, you can save that chart as a chart
template (*.crtx) in the chart templates folder. When you create a chart, you can then apply the chart
template just as you would any other built-in chart type. In fact, chart templates are custom chart types
you can also use them to change the chart type of an existing chart. If you use a specific chart template
frequently, you can save it as the default chart type.

Microsoft Office Excel 2007 Customized Material

105

Step 1: Create a basic chart


For most charts, such as column and bar charts, you can plot the data that you arrange in rows or
columns on a worksheet into a chart. However, some chart types (such as pie and bubble charts) require
a specific data arrangement.
1. On the worksheet, arrange the data that you want to plot in a chart.
The data can be arranged in rows or columns Excel automatically determines the best way to
plot the data in the chart. Some chart types (such as pie and bubble charts) require a specific
data arrangement as described in the following table.
For this chart type

Arrange the data

Column, bar, line, area, surface, or radar


chart

In columns or rows, such as:


Lorem

Ipsum

Or:

Pie or doughnut chart

Lorem

Ipsum

For one data series, in one column or row of


data and one column or row of data labels,
such as:
A

Or:
A

For multiple data series, in multiple columns or


rows of data and one column or row of data
labels, such as:

Microsoft Office Excel 2007 Customized Material

106

Or:

XY (scatter) or bubble chart

Stock chart

In columns, placing x values in the first column


and corresponding y values and bubble size
values in adjacent columns, like:
X

Bubble size

In columns or rows in the following order, using


names or dates as labels:
high values, low values, and closing values
Like:
Date

High

Low

Close

1/1/2002

46.125

42

44.063

Or:
Date

1/1/2002

High

46.125

Low

42

Close

44.063

2. Select the cells that contain the data that you want to use for the chart.
TIP If you select only one cell, Excel automatically plots all cells that contain data that is

adjacent to that cell into a chart. If the cells that you want to plot in a chart are not in a

Microsoft Office Excel 2007 Customized Material

107

continuous range, you can select nonadjacent cells or ranges as long as the selection forms a
rectangle. You can also hide the rows or columns that you do not want to plot in the chart.
How to select cells, ranges, rows, or columns

To select

Do this

A single cell

Click the cell, or press the arrow keys to move to the cell.

A range of cells

Click the first cell in the range, and then drag to the last cell, or hold down SHIFT
while you press the arrow keys to extend the selection.
You can also select the first cell in the range, and then press F8 to extend the
selection by using the arrow keys. To stop extending the selection, press F8 again.

A large range of cells

Click the first cell in the range, and then hold down SHIFT while you click the last
cell in the range. You can scroll to make the last cell visible.

All cells on a worksheet

Click the Select All button.

To select the entire worksheet, you can also press CTRL+A.


NOTE If the worksheet contains data, CTRL+A selects the current region.
Pressing CTRL+A a second time selects the entire worksheet.

Nonadjacent cells or cell


ranges

Select the first cell or range of cells, and then hold down CTRL while you select the
other cells or ranges.
You can also select the first cell or range of cells, and then press SHIFT+F8 to add
another nonadjacent cell or range to the selection. To stop adding cells or ranges to
the selection, press SHIFT+F8 again.
NOTE You cannot cancel the selection of a cell or range of cells in a nonadjacent
selection without canceling the entire selection.

An entire row or column

Click the row or column heading.

Microsoft Office Excel 2007 Customized Material

108

Row heading
Column heading
You can also select cells in a row or column by selecting the first cell and then
pressing CTRL+SHIFT+ARROW key (RIGHT ARROW or LEFT ARROW for rows, UP
ARROW or DOWN ARROW for columns).
NOTE If the row or column contains data, CTRL+SHIFT+ARROW key selects the
row or column to the last used cell. Pressing CTRL+SHIFT+ARROW key a second
time selects the entire row or column.

Adjacent rows or columns

Drag across the row or column headings. Or select the first row or column; then
hold down SHIFT while you select the last row or column.

Nonadjacent rows or columns

Click the column or row heading of the first row or column in your selection; then
hold down CTRL while you click the column or row headings of other rows or
columns that you want to add to the selection.

The first or last cell in a row


or column

Select a cell in the row or column, and then press CTRL+ARROW key (RIGHT
ARROW or LEFT ARROW for rows, UP ARROW or DOWN ARROW for columns).

The first or last cell on a


worksheet or in a Microsoft
Office Excel table

Press CTRL+HOME to select the first cell on the worksheet or in an Excel list.

Cells to the last used cell on


the worksheet (lower-right
corner)

Select the first cell, and then press CTRL+SHIFT+END to extend the selection of
cells to the last used cell on the worksheet (lower-right corner).

Cells to the beginning of the


worksheet

Select the first cell, and then press CTRL+SHIFT+HOME to extend the selection of
cells to the beginning of the worksheet.

More or fewer cells than the


active selection

Hold down SHIFT while you click the last cell that you want to include in the new
selection. The rectangular range between the active cell and the cell that you click
becomes the new selection.

Press CTRL+END to select the last cell on the worksheet or in an Excel list that
contains data or formatting.

3. On the Insert tab, in the Charts group, do one of the following:

Click the chart type, and then click a chart subtype that you want to use.

To see all available chart types, click a chart type, and then click All Chart Types to
display the Insert Chart dialog box, click the arrows to scroll through all available chart
types and chart subtypes, and then click the ones that you want to use.

Microsoft Office Excel 2007 Customized Material

109

TIP A ScreenTip displays the chart type name when you rest the mouse pointer over any chart type or

chart subtype. For more information about the chart types that you can use. By default, the chart is placed
on the worksheet as an embedded chart. If you want to place the chart in a separate chart sheet, you can
change its location by doing the following:
3. Click the embedded chart to select it.
This displays the Chart Tools, adding the Design, Layout, and Format tabs.
4. On the Design tab, in the Location group, click Move Chart.

5. Under Choose where you want the chart to be placed, do one of the following:

To display the chart in a chart sheet, click New sheet.


TIP If you want to replace the suggested name for the chart, you can type a new

name in the New sheet box.

To display the chart as an embedded chart in a worksheet, click Object in, and then
click a worksheet in the Object in box.
Excel automatically assigns a name to the chart, such as Chart1 if it is the first chart that you

create on a worksheet. To change the name of the chart, do the following:


0. Click the chart.
1. On the Layout tab, in the Properties group, click the Chart Name text box.
TIP If necessary, click the Properties icon in the Properties group to expand the group.

2. Type a new name.

Microsoft Office Excel 2007 Customized Material

110

3. Press ENTER.

NOTES

To quickly create a chart that is based on the default chart type, select the data that you want to
use for the chart, and then press ALT+F1 or F11. When you press ALT+F1, the chart is
displayed as an embedded chart; when you press F11, the chart is displayed on a separate chart
sheet.
When you create a chart, Excel determines the orientation of the data series based on the
number of worksheet rows and columns that are included in the chart. After you create a chart,
you can change the way that worksheet rows and columns are plotted in the chart by switching
rows to columns or vice versa. For more information.
After you create a chart, you can quickly change the chart type of the whole chart to give the
chart a different look, or you can select a different chart type for any single data series, which
turns the chart into a combination chart., If you no longer need a chart, you can delete it. Click
the chart to select it, and then press DELETE.

Step 2: Change the layout or style of a chart


After you create a chart, you can instantly change its look. Instead of manually adding or changing chart
elements or formatting the chart, you can quickly apply a predefined layout and style to your chart. Excel
provides a variety of useful predefined layouts and styles (or quick layouts and quick styles) that you can
select from, but you can customize a layout or style as needed by manually changing the layout and
format of individual chart elements.

Apply a predefined chart layout


1. Click the chart that you want to format by using a predefined chart layout.
TIP This displays the Chart Tools, adding the Design, Layout, and Format tabs.

2. On the Design tab, in the Chart Layouts group, click the chart layout that you want to use.

Microsoft Office Excel 2007 Customized Material

111

NOTE

When the size of the Excel window is reduced, chart layouts will be available in the

Quick Layout gallery in the Chart Layouts group.

Apply a predefined chart style


1. Click the chart that you want to format by using a predefined chart style.
TIP This displays the Chart Tools, adding the Design, Layout, and Format tabs.

2. On the Design tab, in the Chart Styles group, click the chart style that you want to use.

NOTE

When the size of the Excel window is reduced, chart styles will be available in the Chart

Quick Styles gallery in the Chart Styles group.

Change the layout of chart elements manually


1. Click the chart or the chart element for which you want to change the layout, or do the following
to select a chart element from a list of chart elements.
1. Click anywhere in the chart to display the Chart Tools.
2. On the Format tab, in the Current Selection group, click the arrow next to the Chart
Elements box, and then click the chart element that you want.

Microsoft Office Excel 2007 Customized Material

112

2. On the Layout tab, in the Labels, Axes, or Background group, click the chart element that you
want to change, and then click the layout option that you want.

NOTE

The layout options that you select are applied to the chart element that you have selected. For

example, if you have the entire chart selected, data labels will be applied to all data series. If you have a
single data point selected, data labels will only be applied to the selected data series or data point.

Change the format of chart elements manually


1. Click the chart or the chart element for which you want to change the style, or do the following to
select a chart element from a list of chart elements.
1. Click a chart to display the Chart Tools.
2. On the Format tab, in the Current Selection group, click the arrow next to the Chart
Elements box, and then click the chart element that you want.

Microsoft Office Excel 2007 Customized Material

113

2.

TIP This displays the Chart Tools, adding the Design, Layout, and Format tabs.

3. On the Format tab, do any of the following:

To format any selected chart element, in the Current Selection group, click Format
Selection, and then select the formatting options that you want.

To format the shape of a selected chart element, in the Shape Styles group, click the style
that you want, or click Shape Fill, Shape Outline, or Shape Effects, and then select the
formatting options that you want.

To format the text in a selected chart element by using WordArt, in the WordArt Styles
group, click the style that you want, or click Text Fill, Text Outline, or Text Effects, and
then select the formatting options that you want.
NOTE

After you apply a WordArt style, you cannot remove the WordArt format. If you do

not want the WordArt style that you applied, you can select another WordArt style, or you
can click Undo on the Quick Access Toolbar to return to the previous text format.
4.

TIP To use regular text formatting to format the text in chart elements, you can right-click or

select the text, and then click the formatting options that you want on the Mini toolbar. You can
also use the formatting buttons on the Ribbon (Home tab, Font group).

Step 3: Add or remove titles or data labels


To make a chart easier to understand, you can add titles, such as a chart title and axis titles. Axis titles
are typically available for all axes that can be displayed in a chart, including depth (series) axes in 3-D
charts. Some chart types (such as radar charts) have axes, but they cannot display axis titles. Chart types
that do not have axes (such as pie and doughnut charts) cannot display axis titles either.
You can also link chart and axis titles to corresponding text in worksheet cells by creating a reference to
those cells. Linked titles are automatically updated in the chart when you change the corresponding text
on the worksheet.

Microsoft Office Excel 2007 Customized Material

114

To quickly identify a data series in a chart, you can add data labels to the data points of the chart. By
default, the data labels are linked to values on the worksheet, and they update automatically when
changes are made to these values.

Add a chart title


1. Click the chart to which you want to add a title.
This displays the Chart Tools, adding the Design, Layout, and Format tabs.
2. On the Layout tab, in the Labels group, click Chart Title.

3. Click Centered Overlay Title or Above Chart.


4. In the Chart Title text box that appears in the chart, type the text that you want.
TIP To insert a line break, click to place the pointer where you want to break the line, and then

press ENTER.
5. To format the text, select it, and then click the formatting options that you want on the Mini
toolbar.
TIP You can also use the formatting buttons on the Ribbon (Home tab, Font group). To format

the whole title, you can right-click it, click Format Chart Title, and then select the formatting
options that you want.

Microsoft Office Excel 2007 Customized Material

115

Add axis titles


1. Click the chart to which you want to add axis titles.
This displays the Chart Tools, adding the Design, Layout, and Format tabs.
2. On the Layout tab, in the Labels group, click Axis Titles.

3. Do any of the following:

To add a title to a primary horizontal (category) axis, click Primary Horizontal Axis Title,
and then click the option that you want.
TIP If the chart has a secondary horizontal axis, you can also click Secondary Horizontal

Axis Title.

To add a title to primary vertical (value) axis, click Primary Vertical Axis Title, and then
click the option that you want.
TIP If the chart has a secondary vertical axis, you can also click Secondary Vertical Axis

Title.

To add a title to a depth (series) axis, click Depth Axis Title, and then click the option that
you want.
NOTE

This option is only available when the selected chart is a true 3-D chart, such as a

3-D column chart.


4. In the Axis Title text box that appears in the chart, type the text that you want.
TIP To insert a line break, click to place the pointer where you want to break the line, and then

press ENTER.

Microsoft Office Excel 2007 Customized Material

116

5. To format the text, select it, and then click the formatting options that you want on the Mini
toolbar.
TIP You can also use the formatting buttons on the Ribbon (Home tab, Font group). To format

the whole title, you can right-click it, click Format Axis Title , and then select the formatting
options that you want.
NOTES

If you switch to another chart type that does not support axis titles (such as a pie chart), the axis
titles will no longer be displayed. The titles will be displayed again when you switch back to a
chart type that does support axis titles.
Axis titles that are displayed for secondary axes will be lost when you switch to a chart type that
does not display secondary axes.

Link a title to a worksheet cell


1. On a chart, click the chart or axis title that you want to link to a worksheet cell.
2. On the worksheet, click in the formula bar, and then type an equal sign (=).
3. Select the worksheet cell that contains the data or text that you want to display in your chart.
TIP You can also type the reference to the worksheet cell in the formula bar. Include an equal

sign, the sheet name, followed by an exclamation point; for example, =Sheet1!F2
4. Press ENTER.

Add data labels


1. On a chart, do one of the following:

To add a data label to all data points of all data series, click the chart area.

Microsoft Office Excel 2007 Customized Material

117

To add a data label to all data points of a data series, click anywhere in the data series that
you want to label.

To add a data label to a single data point in a data series, click the data series that contains
the data point that you want to label, and then click the data point that you want to label.
This displays the Chart Tools, adding the Design, Layout, and Format tabs.

2. On the Layout tab, in the Labels group, click Data Labels, and then click the display option that
you want.

NOTE

Depending on the chart type that you used, different data label options will be available.

TIP For more information about how to change data label entries or how to reposition data labels.

Remove titles or data labels from a chart


1. Click the chart.
This displays the Chart Tools, adding the Design, Layout, and Format tabs.
2. On the Layout tab, in the Labels group, do one of the following:

To remove a chart title, click Chart Title, and then click None.

To remove an axis title, click Axis Title, click the type of axis title that you want to remove,
and then click None.

To remove data labels, click Data Labels, and then click None.

TIP To quickly remove a title or data label, click it, and then press DELETE.

Microsoft Office Excel 2007 Customized Material

118

Step 4: Show or hide a legend


When you create a chart, the legend appears, but you can hide the legend or change its location after you
create the chart.
1. Click the chart in which you want to show or hide a legend.
This displays the Chart Tools, adding the Design, Layout, and Format tabs.
2. On the Layout tab, in the Labels group, click Legend.

3. Do one of the following:

To hide the legend, click None.


TIP To quickly remove a legend or a legend entry from a chart, you can select it, and then

press DELETE. You can also right-click the legend or a legend entry, and then click Delete.

To display a legend, click the display option that you want.


NOTE When you click one of the display options, the legend moves, and the plot area
automatically adjusts to make room for it. If you move and size the legend by using the
mouse, the plot area does not automatically adjust.

For additional options, click More Legend Options, and then select the display option that
you want.
TIP By default, a legend does not overlap the chart. If you have space constraints, you

might be able to reduce the size of the chart by clearing the Show the legend without
overlapping the chart check box.
TIP When a chart has a legend displayed, you can modify the individual legend entries.

Microsoft Office Excel 2007 Customized Material

119

Step 5: Move or resize a chart


You can move a chart to any location on a worksheet or to a new or existing worksheet. You can also
change the size of the chart for a better fit.

Move a chart
To move a chart, drag it to the location that you want.
Or Go to Design tab and Move chart which you can move it to specials sheet for chars.

Resize a chart
To resize a chart, do one of the following:
Click the chart, and then drag the sizing handles to the size that you want.
On the Format tab, in the Size group, enter the size in the Shape Height and Shape Width box.

TIP For more sizing options, on the Format tab, in the Size group, click the Dialog Box Launcher

. In

the Size and Properties dialog box, on the Size tab, you can select options to size, rotate, or scale the
chart. On the Properties tab, you can specify how you want the chart to move or size with the cells on
the worksheet.

Resources
Chart Step By Step
Chart Exercise
Finished


Microsoft Office Excel 2007 Customized Material

120

Anda mungkin juga menyukai