Documentos de Académico
Documentos de Profesional
Documentos de Cultura
MS ADVANCED EXCEL
Argument tooltip. A tooltip with the syntax and arguments appears as you type the function.
For example, type =ROUND( and the tooltip appears. Tooltips only appear for built-in
functions.
Entering formulas
When you create a formula that contains a function, the Insert
Function dialog box helps you enter worksheet functions. As you enter a function into the
formula, the Insert Function dialog box displays the name of the function, each of its
arguments, a description of the function and each argument, the current result of the
function, and the current result of the entire formula.
Nested functions
In certain cases, you may need to use a function as one of the arguments (argument: The
values that a function uses to perform operations or calculations. The type of argument a
function uses is specific to the function. Common arguments that are used within functions
include numbers, text, cell references, and names.) of another function. For example, the
following formula uses a nested AVERAGE function and compares the result with the value
50.
Valid returns When a nested function is used as an argument, it must return the same
type of value that the argument uses. For example, if the argument returns a TRUE or
FALSE value, then the nested function must return a TRUE or FALSE. If it doesn't, Microsoft
Excel displays a #VALUE! error value.
Nesting level limits A formula can contain up to seven levels of nested functions. When
Function B is used as an argument in Function A, Function B is a second-level function. For
instance, the AVERAGE function and the SUM function are both second-level functions
because they are arguments of the IF function. A function nested within the AVERAGE
function would be a third-level function, and so on.
About references in formulas
A reference identifies a cell or a range of cells on a worksheet and tells Microsoft Excel
where to look for the values or data you want to use in a formula. With references, you can
use data contained in different parts of a worksheet in one formula or use the value from
one cell in several formulas. You can also refer to cells on other sheets in the same
workbook, and to other workbooks. References to cells in other workbooks are called links.
The A1 reference style
By default, Excel uses the A1 reference style, which refers to columns with letters (A
through IV, for a total of 256 columns) and refers to rows with numbers (1 through 65536).
These letters and numbers are called row and column headings. To refer to a cell, enter the
column letter followed by the row number. For example, B2 refers to the cell at the
intersection of column B and row 2.
To refer to
The cell in column A and row 10
The range of cells in column A and rows 10 through 20
The range of cells in row 15 and columns B through E
All cells in row 5
All cells in rows 5 through 10
All cells in column H
MS ADVANCED EXCEL
Use
A10
A10:A20
B15:E15
5:5
5:10
H:H
ACSAT CORPORATE TRAINING
You can use 3-D references to refer to cells on other sheets, to define names, and to
create formulas by using the following functions: SUM, AVERAGE, AVERAGEA,
COUNT, COUNTA, MAX, MAXA, MIN, MINA, PRODUCT, STDEV, STDEVA, STDEVP,
STDEVPA, VAR, VARA, VARP, and VARPA.
3-D references cannot be used in array formulas (array formula: A formula that
performs multiple calculations on one or more sets of values, and then returns either
a single result or multiple results. Array formulas are enclosed between braces { }
and are entered by pressing CTRL+SHIFT+ENTER.).
3-D references cannot be used with the intersection operator (a single space) or in
formulas that use implicit intersection (implicit intersection: A reference to a range of
cells, instead of a single cell, that is calculated like a single cell. If cell C10 contains
the formula =B5:B15*5, Excel multiplies the value in cell B10 by 5 because cells B10
and C10 are in the same row.).
How 3-D references change when you move, copy, insert, or delete worksheets
The following examples explain what happens when you move, copy, insert, or delete
worksheets that are included in a 3-D reference. The examples use the formula
=SUM(Sheet2:Sheet6!A2:A5) to add cells A2 through A5 on worksheets 2 through 6.
Insert or copy If you insert or copy sheets between Sheet2 and Sheet6 (the endpoints in
this example), Microsoft Excel includes all values in cells A2 through A5 from the added
sheets in the calculations.
Delete If you delete sheets between Sheet2 and Sheet6, Excel removes their values from
the calculation.
Move
If you move sheets from between Sheet2 and Sheet6 to a location outside the
referenced sheet range, Excel removes their values from the calculation.
Move an endpoint
If you move Sheet2 or Sheet6 to another location in the same
workbook, Excel adjusts the calculation to accommodate the new range of sheets between
them.
Delete an endpoint
If you delete Sheet2 or Sheet6, Excel adjusts the calculation to
accommodate the range of sheets between them.
The R1C1 reference style
You can also use a reference style where both the rows and the columns on the worksheet
are numbered. The R1C1 reference style is useful for computing row and column positions in
macros (macro: An action or a set of actions you can use to automate tasks. Macros are
recorded in the Visual Basic for Applications programming language.). In the R1C1 style,
Excel indicates the location of a cell with an "R" followed by a row number and a "C"
followed by a column number.
Reference Meaning
A relative reference (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
R[-2]C
to. If you copy the formula, the reference automatically adjusts. A relative
reference takes the form A1.) to the cell two rows up and in the same column
R[2]C[2]
A relative reference to the cell two rows down and two columns to the right
An absolute reference (absolute cell reference: In a formula, the exact address
of a cell, regardless of the position of the cell that contains the formula. An
R2C2
absolute cell reference takes the form $A$1.) to the cell in the second row and in
the second column
R[-1]
A relative reference to the entire row above the active cell
R
An absolute reference to the current row
MS ADVANCED EXCEL
When you record a macro, Excel records some commands by using the R1C1 reference
style. For example, if you record a command such as clicking the AutoSum button to insert
a formula that adds a range of cells, Excel records the formula by using R1C1 style, not A1
style, references.
To turn R1C1 reference style on or off
1. Click Options on the Tools menu, and then click the General tab.
2. Under Settings, select or clear the R1C1 reference style check box.
About names in formulas
You can use the labels of columns and rows on a worksheet to refer to the cells within those
columns and rows. Or you can create descriptive names (name: A word or string of
characters that represents a cell, range of cells, formula, or constant value. Use easy-tounderstand names, such as Products, to refer to hard to understand ranges, such as Sales!
C20:C30.) to represent cells, ranges of cells, formulas, or constant values. Labels can be
used in formulas that refer to data on the same worksheet; if you want to represent a range
on another worksheet, use a name.
Using defined names to represent cells, constants, or formulas
A defined name in a formula can make it easier to understand the purpose of the formula.
For example, the formula =SUM(FirstQuarterSales) might be easier to identify than
=SUM(C20:C30).
Names are available to any sheet. For example, if the name ProjectedSales refers to the
range A20:A30 on the first worksheet in a workbook, you can use the name ProjectedSales
on any other sheet in the same workbook to refer to range A20:A30 on the first worksheet.
Names can also be used to represent formulas or values that do not change (constants). For
example, you can use the name SalesTax to represent the sales tax amount (such as 6.2
percent) applied to sales transactions.
You can also link to a defined name in another workbook, or define a name that refers to
cells in another workbook. For example, the formula =SUM(Sales.xls!ProjectedSales) refers
to the named range ProjectedSales in the workbook named Sales.
Note By default, names use absolute cell references .
Guidelines for names
What characters are allowed? The first character of a name must be a letter or an
underscore character. Remaining characters in the name can be letters, numbers, periods,
and underscore characters.
Can names be cell references? Names cannot be the same as a cell reference, such as
Z$100 or R1C1.
Can more than one word be used? Yes, but spaces are not allowed. Underscore
characters and periods may be used as word separators for example, Sales_Tax or
First.Quarter.
How many characters can be used? A name can contain up to 255 characters.
Note If a name defined for a range contains more than 253 characters, you cannot select it
from the Name box.
Are names case sensitive? Names can contain uppercase and lowercase letters. Microsoft
Excel does not distinguish between uppercase and lowercase characters in names. For
MS ADVANCED EXCEL
example, if you have created the name Sales and then create another name called SALES in
the same workbook, the second name will replace the first one.
Using existing row and column labels as names
When you create a formula that refers to data in a worksheet, you can use the column and
row labels in the worksheet to refer to the data. For example, to calculate the total value for
the Product column, use the formula =SUM(Product).
Using a label
Or if you need to refer to the Product 3 amount for the East division (that is, the value
110.00), you can use the formula =Product 3 East. The space in the formula between
"Product 3" and "East" is the intersection operator. This operator designates that Microsoft
Excel should find and return the value in the cell at the intersection of the row labeled East
and the column labeled Product 3.
Note By default, Excel does not recognize labels in formulas. To use labels in formulas,
click Options on the Tools menu, and then click the Calculation tab. Under Workbook
options, select the Accept labels in formulas check box.
Stacked labels
When you use labels for the columns and rows on your worksheet, you
can use those labels to create formulas that refer to data on the worksheet. If your
worksheet contains stacked column labels in which a label in one cell is followed by one or
more labels below it you can use the stacked labels in formulas to refer to data on the
worksheet. For example, if the label West is in cell E5 and the label Projected is in cell E6,
the formula =SUM(West Projected) returns the total value for the West Projected column.
The order for stacked labels
When you refer to information by using stacked labels,
you refer to the information in the order in which the labels appear, from top to bottom. If
the label West is in cell F5 and the label Actual is in cell F6, you can refer to the actual
figures for West by using West Actual in a formula. For example, to calculate the average of
the actual figures for West, use the formula =AVERAGE(West Actual).
Using dates as labels
When you label a range by using the Label Ranges dialog box
and the range contains a year or date as a label, Excel defines the date as a label by placing
single quotation marks around the label when you type the label in a formula. For example,
suppose your worksheet contains the labels 2007 and 2008 and you have specified these
labels by using the Label Ranges dialog box. When you type the formula =SUM(2008),
Excel automatically updates the formula to =SUM('2008').
About calculation operators in formulas
Operators specify the type of calculation that you want to perform on the elements of a
formula. Microsoft Excel includes four different types of calculation operators: arithmetic,
comparison, text, and reference.
Types of operators
Arithmetic operators
To perform basic mathematical operations such as addition,
subtraction, or multiplication; combine numbers; and produce numeric results, use the
following arithmetic operators.
MS ADVANCED EXCEL
Arithmetic operator
+ (plus sign)
7
Meaning (Example)
Addition (3+3)
Subtraction(31)
Negation (1)
Multiplication (3*3)
Division (3/3)
Percent (20%)
Exponentiation (3^2)
(minus sign)
* (asterisk)
/ (forward slash)
% (percent sign)
^ (caret)
Comparison operators You can compare two values with the following operators. When
two values are compared by using these operators, the result is a logical value either TRUE
or FALSE.
Comparison operator
= (equal sign)
> (greater than sign)
< (less than sign)
>= (greater than or equal to sign)
<= (less than or equal to sign)
<> (not equal to sign)
Meaning (Example)
Equal to (A1=B1)
Greater than (A1>B1)
Less than (A1<B1)
Greater than or equal to (A1>=B1)
Less than or equal to (A1<=B1)
Not equal to (A1<>B1)
Meaning (Example)
Range operator, which produces one reference to all the cells between two
references, including the two references (B5:B15)
Union operator, which combines multiple references into one reference
(SUM(B5:B15,D5:D15))
Intersection operator, which produces on reference to cells common to the
two references (B7:D7 C6:C8)
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)
(single space)
Reference operators
, (comma)
Negation (as in 1)
%
Percent
^
Exponentiation
* and /
Multiplication and division
+ and
Addition and subtraction
&
Connects two strings of text (concatenation)
= < > <= >=
Comparison
<>
Use of parentheses
To change the order of evaluation, enclose in parentheses the part of the formula to be
calculated first. For example, the following formula produces 11 because Excel calculates
multiplication before addition. The formula multiplies 2 by 3 and then adds 5 to the result.
=5+2*3
In contrast, if you use parentheses to change the syntax, Excel adds 5 and 2 together and
then multiplies the result by 3 to produce 21.
=(5+2)*3
In the example below, the parentheses around the first part of the formula force Excel to
calculate B4+25 first and then divide the result by the sum of the values in cells D5, E5, and
F5.
=(B4+25)/SUM(D5:F5)
About constants in formulas
A constant is a value that is not calculated. For example, the date 10/9/2008, the number
210, and the text "Quarterly Earnings" are all constants. An expression, or a value resulting
from an expression, is not a constant. If you use constant values in the formula instead of
references to the cells (for example, =30+70+110), the result changes only if you modify
the formula yourself.
DMIN
10
BIN2OCT
COMPLEX
CONVERT
DEC2BIN
DEC2HEX
DEC2OCT
DELTA
ERF
ERFC
GESTEP
HEX2BIN
HEX2DEC
HEX2OCT
IMABS
IMAGINARY
IMDIV
IMEXP
IMLN
IMLOG10
IMLOG2
IMPOWER
IMPRODUCT
IMREAL
IMSIN
IMSQRT
IMSUB
IMSUM
OCT2BIN
OCT2DEC
OCT2HEX
Financial functions
Function
Description
ACCRINT
Returns the accrued interest for a security that pays periodic interest
ACCRINTM
Returns the accrued interest for a security that pays interest at maturity
MS ADVANCED EXCEL
11
MS ADVANCED EXCEL
PRICEDISC
PRICEMAT
PV
RATE
RECEIVED
SLN
SYD
TBILLEQ
TBILLPRICE
TBILLYIELD
VDB
XIRR
XNPV
YIELD
YIELDDISC
YIELDMAT
12
Information functions
Function
Description
CELL
Returns information about the formatting, location, or contents of a cell
ERROR.TYPE Returns a number corresponding to an error type
INFO
Returns information about the current operating environment
ISBLANK
Returns TRUE if the value is blank
ISERR
Returns TRUE if the value is any error value except #N/A
ISERROR
Returns TRUE if the value is any error value
ISEVEN
Returns TRUE if the number is even
ISLOGICAL Returns TRUE if the value is a logical value
ISNA
Returns TRUE if the value is the #N/A error value
ISNONTEXT Returns TRUE if the value is not text
ISNUMBER Returns TRUE if the value is a number
ISODD
Returns TRUE if the number is odd
ISREF
Returns TRUE if the value is a reference
ISTEXT
Returns TRUE if the value is text
N
Returns a value converted to a number
NA
Returns the error value #N/A
TYPE
Returns a number indicating the data type of a value
Logical functions
Function
Description
AND
Returns TRUE if all of its arguments are TRUE
FALSE
Returns the logical value FALSE
MS ADVANCED EXCEL
IF
NOT
OR
TRUE
13
DEGREES
EVEN
EXP
FACT
FACTDOUBLE
FLOOR
GCD
INT
LCM
LN
LOG
LOG10
MDETERM
MINVERSE
MMULT
MOD
MROUND
MULTINOMIAL
ODD
PI
POWER
PRODUCT
QUOTIENT
RADIANS
RAND
RANDBETWEEN
ROMAN
ROUND
ROUNDDOWN
ROUNDUP
SERIESSUM
SIGN
SIN
SINH
SQRT
SQRTPI
SUBTOTAL
SUM
SUMIF
SUMPRODUCT
SUMSQ
SUMX2MY2
SUMX2PY2
SUMXMY2
14
MS ADVANCED EXCEL
TAN
TANH
TRUNC
15
Statistical functions
Function
Description
Returns the average of the absolute deviations of data points from their
AVEDEV
mean
AVERAGE
Returns the average of its arguments
Returns the average of its arguments, including numbers, text, and logical
AVERAGEA
values
BETADIST
Returns the beta cumulative distribution function
Returns the inverse of the cumulative distribution function for a specified
BETAINV
beta distribution
BINOMDIST
Returns the individual term binomial distribution probability
CHIDIST
Returns the one-tailed probability of the chi-squared distribution
Returns the inverse of the one-tailed probability of the chi-squared
CHIINV
distribution
CHITEST
Returns the test for independence
CONFIDENCE
Returns the confidence interval for a population mean
CORREL
Returns the correlation coefficient between two data sets
COUNT
Counts how many numbers are in the list of arguments
COUNTA
Counts how many values are in the list of arguments
COUNTBLANK
Counts the number of blank cells within a range
Counts the number of nonblank cells within a range that meet the given
COUNTIF
criteria
COVAR
Returns covariance, the average of the products of paired deviations
Returns the smallest value for which the cumulative binomial distribution is
CRITBINOM
less than or equal to a criterion value
DEVSQ
Returns the sum of squares of deviations
EXPONDIST
Returns the exponential distribution
FDIST
Returns the F probability distribution
FINV
Returns the inverse of the F probability distribution
FISHER
Returns the Fisher transformation
FISHERINV
Returns the inverse of the Fisher transformation
FORECAST
Returns a value along a linear trend
FREQUENCY
Returns a frequency distribution as a vertical array
FTEST
Returns the result of an F-test
GAMMADIST
Returns the gamma distribution
GAMMAINV
Returns the inverse of the gamma cumulative distribution
GAMMALN
Returns the natural logarithm of the gamma function, (x)
GEOMEAN
Returns the geometric mean
GROWTH
Returns values along an exponential trend
HARMEAN
Returns the harmonic mean
HYPGEOMDIST Returns the hyper-geometric distribution
MS ADVANCED EXCEL
16
INTERCEPT
KURT
LARGE
LINEST
LOGEST
LOGINV
LOGNORMDIST
MAX
VAR
VARA
VARP
VARPA
WEIBULL
ZTEST
Text functions
Function
ASC
BAHTTEXT
CHAR
CLEAN
CODE
CONCATENATE
DOLLAR
EXACT
FIND, FINDB
FIXED
JIS
LEFT, LEFTB
LEN, LENB
LOWER
MID, MIDB
17
Description
Changes full-width (double-byte) English letters or katakana within a
character string to half-width (single-byte) characters
Converts a number to text, using the (baht) currency format
Returns the character specified by the code number
Removes all nonprintable characters from text
Returns a numeric code for the first character in a text string
Joins several text items into one text item
Converts a number to text, using the $ (dollar) currency format
Checks to see if two text values are identical
Finds one text value within another (case-sensitive)
Formats a number as text with a fixed number of decimals
Changes half-width (single-byte) English letters or katakana within a
character string to full-width (double-byte) characters
Returns the leftmost characters from a text value
Returns the number of characters in a text string
Converts text to lowercase
Returns a specific number of characters from a text string starting at the
position you specify
Extracts the phonetic (furigana) characters from a text string
Capitalizes the first letter in each word of a text value
PHONETIC
PROPER
REPLACE,
Replaces characters within text
REPLACEB
REPT
Repeats text a given number of times
RIGHT, RIGHTB Returns the rightmost characters from a text value
SEARCH,
Finds one text value within another (not case-sensitive)
SEARCHB
SUBSTITUTE
Substitutes new text for old text in a text string
T
Converts its arguments to text
TEXT
Formats a number and converts it to text
TRIM
Removes spaces from text
UPPER
Converts text to uppercase
VALUE
Converts a text argument to a number
External functions
Function
Description
EUROCONVERT Converts a number to euros, converts a number from euros to a euro
member currency, or converts a number from one euro member currency to
MS ADVANCED EXCEL
SQL.REQUEST
18
AUDITING WORKBOOK
DATA ENTRY FORM
Microsoft Excel provides the following types of forms to help you enter data in a
worksheet range.
Data forms
Excel can generate a built-in data form (data form: A dialog box that displays one
complete record at a time. You can use data forms to add, change, locate, and delete
records.) for your range. The data form displays all of your column labels in a single
dialog box, with a blank space beside each label for you to fill in data for the column.
You can enter new data, find rows based on cell contents, update existing data, and
delete rows from the range.
Use a data form when a simple form listing the columns is sufficient and you don't need
more sophisticated or custom features. A data form can make data entry easier than
typing across the columns when you have a wide range with more columns than will fit
on the screen at one time.
Worksheet forms
If you need a sophisticated or specialized data entry form, you can create a worksheet
or template (template: A workbook that you create and use as the basis for other
similar workbooks. You can create templates for workbooks and worksheets. The
default template for workbooks is called Book.xlt. The default template for worksheets
is called Sheet.xlt.) to use as a form and then customize the worksheet form to meet
your needs. For example, you might create an expense report form for people to fill out
online or in printed form.
Use this method when you want complete flexibility to customize your form. Worksheet
forms are particularly useful when you want individual printable copies of your forms.
You can develop a data entry application using the Microsoft Visual Basic
Editor (Microsoft Visual Basic Editor: An environment in which you can edit macros that
you've recorded and write new macros and Visual Basic for Applications programs.) to
keep the data from the forms in an Excel range.
Create an Excel list
1. Highlight the range of data that you want make into a list (list: A series of rows
that contains related data or a series of rows that you designate to function as a
datasheet by using the Create List command.).
Note You can also select the range of cells to be specified as a list by selecting
the range of cells from the Create List dialog box.
2. On the Data menu, point to List, and then click Create List.
3. If the selected data has headers, select the My list has headers check box and
click OK.
The selected range of data is highlighted by the list indicator, and the most common list
related functionality is made available on the List toolbar.
MS ADVANCED EXCEL
19
Note If you don't see the List toolbar, on the View menu point to Toolbars, and then
click List.
After the list has been created, it will be identified by a blue border. In addition,
AutoFilter drop-downs will be automatically enabled for each column in the list and the
insert row will be added as the last row or the list. If you choose to add a total row by
clicking Toggle Total Row
on the List toolbar, a total row will be displayed under
the insert row.
When you select a cell, row, or column outside of the list, the list becomes inactive. An
inactive list is surrounded by a blue border and does not display the insert row or
AutoFilter drop-downs.
Note The border will not be displayed if you clicked Hide Border of Inactive Lists on
the List menu.
Tracing dependent, precedent, and error cells
All tracer arrows (tracer arrows: Arrows that show the relationship between the active
cell and its related cells. Tracer arrows are blue when pointing from a cell that provides
data to another cell, and red if a cell contains an error value, such as #DIV/0!.)
disappear if you change the formula the arrows point to, insert or delete columns or
rows, or delete or move cells. To restore the tracer arrows after making any of these
changes, you must use auditing commands on the worksheet again.
Tip
To keep track of the original tracer arrows, print the worksheet with the tracer arrows
displayed before you make the changes.
If Microsoft Excel beeps when you click Trace Dependents
or Trace Precedents
on the Formula Auditing toolbar, either Excel has traced all levels of the formula,
or you are attempting to trace an item that cannot be traced. The following items on
worksheets that can be referenced by formulas cannot be traced by using the auditing
tools:
References to text boxes, embedded charts (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.), or pictures on worksheets
PivotTable reports
MS ADVANCED EXCEL
20
again.
When you are tracing formula dependencies (dependents: Cells that contain formulas
that refer to other cells. For example, if cell D10 contains the formula =B5, cell D10 is a
dependent of cell B5.) or precedents (precedents: Cells that are referred to by a
formula in another cell. For example, if cell D10 contains the formula =B5, cell B5 is a
precedent to cell D10.), Excel cannot go to a cell in a workbook that is not open. Open
the workbook that contains the cell, and then try going to the cell again.
About data tables
Data tables are part of a suite of commands sometimes called what-if analysis (what-if
analysis: A process of changing the values in cells to see how those changes affect the
outcome of formulas on the worksheet. For example, varying the interest rate that is
used in an amortization table to determine the amount of the payments.) tools. A data
table is a range of cells that shows how changing certain values in your formulas affects
the results of the formulas. Data tables provide a shortcut for calculating multiple
versions in one operation and a way to view and compare the results of all of the
different variations together on your worksheet.
One-variable data tables For example, use a one-variable data table if you want to
see how different interest rates affect a monthly mortgage payment. In the following
example, cell D2 contains the payment formula, =PMT(B3/12,B4,-B5), which refers to
the input cell B3.
Two-variable data tables A two-variable data table can show how different interest
rates and loan terms will affect the mortgage payment. In the following example, cell
C2 contains the payment formula, =PMT(B3/12,B4,-B5), which uses two input cells, B3
and B4.
MS ADVANCED EXCEL
21
data table, you can change the Calculation options to automatically recalculate the
worksheet but not data tables.
DATA ANALYSIS
Perform a statistical analysis
1. On the Tools menu, click Data Analysis.
2. In the Data Analysis dialog box, click the name of the analysis tool you want to
use, then click OK.
3. In the dialog box for the tool you selected, set the analysis options you want.
Create a scenario
1. On the Tools menu, click Scenarios.
2. Click Add.
3. In the Scenario name box, type a name for the scenario (scenario: A named
set of input values that you can substitute in a worksheet model.).
4. In the Changing cells box, enter the references for the cells that you want to
change.
Note To preserve the original values for the changing cells, create a scenario
that uses the original cell values before you create scenarios that change the
values.
5. Under Protection, select the options you want.
6. Click OK.
7. In the Scenario Values dialog box, type the values you want for the changing
cells.
8. To create the scenario, click OK.
9. If you want to create additional scenarios, click Add again, and then repeat the
procedure. When you finish creating scenarios, click OK, and then click Close in
the Scenario Manager dialog box.
CONDITIONAL FORMATTING
About conditional formats
Formatting cells based on specific conditions
You can monitor formula results or other cell values by applying conditional
formats (conditional format: A format, such as cell shading or font color, that Excel
automatically applies to cells if a specified condition is true.). For example, you can
apply green text color to the cell if sales exceed forecast and red shading if sales fall
short.
When conditions change If the value of the cell changes and no longer meets the
specified condition, Microsoft Excel clears the formatting from the cell, but leaves the
MS ADVANCED EXCEL
22
condition applied so that the formatting will be automatically reapplied when the
condition is met.
Shared workbooks In a shared workbook, conditional formats that are applied
before a workbook is shared continue to work; however, you cannot modify the
conditional formats or apply new ones while the workbook is shared.
PivotTable reports If you try to apply conditional formats to cells in a PivotTable
report, you will get unpredictable results.
Formulas as formatting criteria
You can compare the values of the selected cells to a constant or to the results of a
formula. To evaluate data in cells outside the selected range or to examine multiple
sets of criteria, you can use a logical formula to specify the formatting criteria.
Use the value in a cell as the condition If you select the Cell Value Is
option and compare the values of the selected cells to the result of a formula,
you must start the formula with an equal sign (=).
Use a formula as the condition If you select the Formula Is option, the
formula you specify must return a logical value of TRUE (1) or FALSE (0). You
must start the formula with an equal sign (=). The formula can evaluate data
only on the active worksheet. To evaluate data on another sheet or in another
workbook, you can define a name on the active worksheet for the data on
another sheet or workbook, or enter a reference to the data in a cell of the
active worksheet. Then refer to that cell or name in the formula. For example, to
evaluate data in cell A5 on Sheet1 of the workbook Fiscal Year.xls, enter the
following reference, including the equal sign (=), in a cell of the active sheet:
=[Fiscal Year.xls]SHEET1!$A$5
The formula can also evaluate criteria that is not based on worksheet data. For
example, the formula =WEEKDAY("12/5/99")=1 returns a value of TRUE if the
date 12/5/99 is a Sunday. Unless a formula specifically refers to the selected
cells you are formatting, the cell values do not affect whether the condition is
true or false. If a formula does refer to the selected cells, you must enter the
cell references in the formula.
Use cell references as the condition You can enter cell references in a
formula by selecting cells directly on a worksheet. Selecting cells on the sheet
inserts absolute cell references. If you want Microsoft Excel to adjust the
references for each cell in the selected range, use relative cell references.
Use dates Dates and times are evaluated as serial numbers. For example, if
you compare the cell value with the date January 7, 2001, the date is
represented by the serial number 36898.
Example 1: Use data in a cell
In the following example, conditional formats applied to the range B2:E3 analyze
quarterly contributions to the yearly total. Quarterly results that contribute 30 percent
or more to the total are displayed in bold and green. Quarterly results that contribute
20 percent or less are displayed in bold and red.
The following table summarizes the conditional formats applied to the range B2:E3.
Microsoft Excel adjusts the relative portion (the row number) of the cell reference $F2
MS ADVANCED EXCEL
23
in the formula so that each cell in the range B2:E3 is compared with the corresponding
total in column F.
Cell Value Is
Condition 1 Greater than or equal to
Condition 2 Less than or equal to
Formula Formats
=$F2*0.3 Bold, green font
=$F2*0.2 Bold, red font
MS ADVANCED EXCEL
24
Description (Result)
Is 15 greater than 9 and less than 8? (FALSE)
Is 15 greater than 9 or less than 8? (TRUE)
Is 15 plus 9 not equal to 24? (FALSE)
Is A5 not equal to "Sprockets"? (FALSE)
= Is A5 not equal to "Sprockets" or A6 equal to
"Widgets"? (TRUE)
Function details
AND
OR
NOT
Create a conditional formula that results in another calculation or in values
other than TRUE or FALSE
To do this task, use the IF, AND, and OR functions.
A
Data
15
9
8
Sprockets
MS ADVANCED EXCEL
25
Widgets
Formula
Description (Result)
If the value in cell A2 equals 15, then return
=IF(A2=15, "OK", "Not OK")
"OK". (OK)
If the value in cell A2 is not equal to 15, then
=IF(A2<>15, "OK", "Not OK")
return "OK". (Not OK)
=IF(NOT(A2<=15),
"OK",
"Not If the value in cell A2 is not less than or equal
OK")
to 15, then return "OK". (Not OK)
=IF(A5<>"SPROCKETS",
"OK", If the value in cell A5 is not equal to
"Not OK")
"SPROCKETS", then return "OK". (Not OK)
=IF(AND(A2>A3, A2<A4), "OK", If 15 is greater than 9 and less than 8, then
"Not OK")
return "OK". (Not OK)
=IF(AND(A2<>A3,
A2<>A4), If 15 is not equal to 9 and 15 is not equal to 8,
"OK", "Not OK")
then return "OK". (OK)
=IF(OR(A2>A3, A2<A4), "OK", If 15 is greater than 9 or less than 8, then
"Not OK")
return "OK". (OK)
If the value in cell A5 is not equal to
=IF(OR(A5<>"Sprockets",
"Sprockets" or "Widgets", then return "OK".
A6<>"Widgets"), "OK", "Not OK")
(Not OK)
=IF(OR(A2<>A3, A2<>A4), "OK", If 15 is not equal to 9 or 15 is not equal to 8,
"Not OK")
then return "OK". (OK)
Function details
IF
AND
OR
Add, change, or remove conditional formats
1. Select the cells for which you want to add, change, or remove conditional
formatting.
2. On the Format menu, click Conditional Formatting.
3. Do one of the following:
Add a conditional format
1. Do one of the following:
To use values in the selected cells as the formatting criteria, click Cell
Value Is, select the comparison phrase, and then type a constant value
or a formula. If you enter a formula, start it with an equal sign (=).
To use a formula as the formatting criteria (to evaluate data or a
condition other than the values in selected cells), click Formula Is and
then enter the formula that evaluates to a logical value of TRUE or
FALSE.
2. Click Format.
3. Select the formatting you want to apply when the cell value meets the
condition or the formula returns the value TRUE.
4. To add another condition, click Add, and then repeat steps 1 through 3.
You can specify up to three conditions. If none of the specified conditions
are true, the cells keep their existing formats.
MS ADVANCED EXCEL
26
SHARING OF WORKBOOK
Share a workbook
1. Create a workbook you want to make available for multi-user editing, and enter
any data you want to provide.
If you want to include any of the following features, add them now: merged
cells, conditional formats, data validation, charts, pictures, objects including
drawing objects, hyperlinks, scenarios, outlines, subtotals, data tables,
PivotTable reports, workbook and worksheet protection, and macros. You can't
make changes to these features after you share the workbook.
2. On the Tools menu, click Share Workbook, and then click the Editing tab.
3. Select the Allow changes by more than one user at the same time check
box, and then click OK.
4. When prompted, save the workbook.
5. On the File menu, click Save As, and then save the workbook on a network
location accessible to the intended users. Use a shared network folder, not a
Web server.
6. Check any links to other workbooks or documents, and fix any that are broken.
How?
1. On the Edit menu, click Links.
The Links command is unavailable if your file does not contain linked
information.
2. Click Check Status to update the status for all links in the list. This may
take a while if there are a lot of links, or if the source workbook for the
links is on a network location, and the network is slow.
3. Check the status in the Status column, select the link, and then take the
action needed.
MS ADVANCED EXCEL
27
MS ADVANCED EXCEL
28
3. Enter and edit data as usual. You won't be able to add or change the following:
merged cells, conditional formats, data validation, charts, pictures, objects
including drawing objects, hyperlinks, scenarios, outlines, subtotals, 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.), PivotTable reports, workbook and
worksheet protection, and macros.
4. Make any filter (filter: To display only the rows in a list that satisfy the
conditions you specify. You use the AutoFilter command to display rows that
match one or more specific values, calculated values, or conditions.) and print
settings you want for your personal use. Each user's settings are saved
individually by default.
If you want the filter or print settings made by the original author to be in effect
whenever you open the workbook, click Share Workbook on the Tools menu,
click the Advanced tab, and under Include in personal view, clear the Print
settings or Filter settings check box.
5. To save your changes to the workbook and see the changes other users have
saved since your last save, click Save
.
If the Resolve Conflicts dialog box appears, resolve the conflicts.
How?
When two users try to save changes that affect the same cell, Microsoft Excel
displays the Resolve Conflicts dialog box for one of the users.
1. In the Resolve Conflicts dialog box, read the information about each
change and the conflicting changes made by others.
2. To keep your change or the other person's change and go on to the next
conflicting change, click Accept Mine or Accept Other.
To keep all of your remaining changes or all of the other users' changes,
click Accept All Mine or Accept All Others.
3. To have your changes to override all other changes, and never see the
Resolve Conflicts dialog box again, turn this feature off.
How?
1. On the Tools menu, click Share Workbook, and then click the
Advanced tab.
2. Click The changes being saved win.
3. Click Save
.
4. To see how you or others resolved past conflicts, view this information on
the History worksheet.
How?
1. On the Tools menu, point to Track Changes, and then click
Highlight Changes.
2. In the When box, click All.
3. Clear the Who and Where check boxes.
4. Select the List changes on a new sheet check box, and then
click OK.
5. On the History worksheet, scroll to the right to view the Action
Type and Losing Action columns.
Conflicting changes that were kept have "Won" for Action Type.
The row numbers in the Losing Action column identify the rows
with information about the conflicting changes that weren't kept,
including any deleted data.
MS ADVANCED EXCEL
29
Tip
To save a copy of the workbook with all your changes, click Cancel in the
Resolve Conflicts dialog box, click Save As on the File menu, and then type a
new name for the file.
Notes
To see who else has the workbook open, click Share Workbook on the Tools
menu, and then click the Editing tab.
If you want to get automatic updates of the other users' changes periodically,
with or without saving, click Share Workbook on the Tools menu, click the
Advanced tab, and under Update changes, click the options you want.
Protect worksheet or workbook elements
To prevent anyone from accidentally or deliberately changing, moving, or deleting
important data, you can protect certain worksheet or workbook elements, with or
without a password (password: A way to restrict access to a workbook, worksheet, or
part of a worksheet. Excel passwords can be up to 255 letters, numbers, spaces, and
symbols. You must type uppercase and lowercase letters correctly when you set and
enter passwords.).
Important Worksheet or workbook element protection should not be confused with
file security. It is not meant to make your workbook more secure, and cannot protect it
from users who have malicious intent.
Worksheet elements
Protect worksheet elements from all users
1. Switch to the worksheet you want to protect.
2. Unlock any cells you want users to be able to change: Select each cell or range,
click Cells on the Format menu, click the Protection tab, and then clear the
Locked check box.
3. Hide any formulas that you don't want to be visible: Select the cells with the
formulas, click Cells on the Format menu, click the Protection tab, and then
select the Hidden check box.
4. Unlock any graphic objects you want users to be able to change.
How?
You don't 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. To see which
elements on a worksheet are graphic objects, click Go To on the Edit menu,
click Special, and then click Objects.
1. Hold down CTRL and click each object that you want to unlock.
2. On the Format menu, click the command for the object you selected:
AutoShape, Object, Text Box, Picture, Control, or WordArt.
3. Click the Protection tab.
4. Clear the Locked check box, and if present, clear the Lock text check
box.
MS ADVANCED EXCEL
30
5. On the Tools menu, point to Protection, and then click Protect Sheet.
6. Type a password for the sheet.
Note The password is optional; however, if you don't supply a password, any
user will be able to unprotect the sheet and change the protected elements.
Make sure you choose a password you can remember, because if you lose the
password, you cannot gain access to the protected elements on the worksheet.
7. In the Allow all users of this worksheet to list, select the elements that you
want users to be able to change.
8. Click OK. If prompted, retype the password.
Give specific users access to protected ranges
In order to give specific users access to ranges, your computer must be running
Windows 2000 or later and it must be on a domain.
1. On the Tools menu, point to Protection, and then click Allow Users to Edit
Ranges. (This command is available only when the worksheet is not protected.)
2. Click New.
3. In the Title box, type a title for the range you're granting access to.
4. In the Refers to cells box, type an equal sign (=), and then type a reference or
select the range.
5. In the Range password box, type a password to access the range.
The password is optional; if you don't supply a password, any user will be able
to edit the cells.
6. Click Permissions, and then click Add.
7. Locate and select the users to whom you want to grant access. If you want to
select multiple users, hold down CTRL while you click the names.
8. Click OK twice. If prompted, retype the password.
9. Repeat the previous steps for each range for which you're granting access.
10. To retain a separate record of the ranges and users, select the Paste
permissions information into a new workbook check box in the Allow
Users to Edit Ranges dialog box.
11. Protect the worksheet: Click Protect Sheet in the Allow Users to Edit
Ranges dialog box.
12. In the Protect Sheet dialog box, make sure the Protect worksheet and
contents of locked cells check box is selected, type a password for the
worksheet, click OK, and then retype the password to confirm.
Note A sheet password is required to prevent other users from being able to edit your
designated ranges. Make sure you choose a password you can remember, because if
you lose the password, you cannot gain access to the protected elements on the
worksheet.
Workbook elements
Protect workbook elements
1. On the Tools menu, point to Protection, and then click Protect Workbook.
2. Do one or more of the following:
o To protect the structure of a workbook so that worksheets in the
workbook can't be moved, deleted, hidden, unhidden, or renamed, and
new worksheets can't be inserted, select the Structure check box.
MS ADVANCED EXCEL
o
o
31
To protect windows so that they are the same size and position each time
the workbook is opened, select the Windows check box.
To prevent others from removing workbook protection, type a password,
click OK, and then retype the password to confirm it.
Note You may also want to save or print the current version of
the workbook, because this history might not apply to later
versions. For example, cell locations, including row numbers, in
the copied history may no longer be current.
3. On the Tools menu, click Share Workbook, and then click the Editing
tab.
4. Make sure that you are the only person listed in the Who has this
workbook open now box.
5. Clear the Allow changes by more than one user at the same time
check box.
If this check box is not available, you must unprotect the workbook
before clearing the check box.
How?
1. Click OK, point to Protection on the Tools menu, and then click
Unprotect Shared Workbook.
2. Enter the password if prompted, and then click OK.
3. On the Tools menu, click Share Workbook, and then click the
MS ADVANCED EXCEL
32
Editing tab.
6. When prompted about the effects on other users, click Yes.
2. Set other types of protection if you want: Give specific users access to ranges,
protect worksheets, protect workbook elements, and set passwords for viewing
and editing.
3. On the Tools menu, point to Protection, and then click Protect Shared
Workbook or Protect and Share Workbook.
4. Select the Sharing with track changes check box.
5. If you want to require other users to supply a password to turn off the change
history or remove the workbook from shared use, type the password in the
Password box, and then retype the password when prompted.
6. If prompted, save the workbook.
Change or remove protection of worksheet or workbook elements
Change protection
Change the protection or password for a worksheet
1. Switch to the protected worksheet.
2. On the Tools menu, point to Protection, and then click Unprotect Sheet.
3. If prompted type the current password, and then click OK.
4. On the Tools menu, point to Protection, and then click Protect Sheet.
5. In the Allow all users of this worksheet to list, make any changes you want
to the elements users will be able to change.
6. Type the password in the Password to unprotect sheet box.
7. Click OK, and if prompted retype the password.
Note It is very important that you remember the password that you set. Without the
password, there is no way to 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. Use a strong password that you can remember so
that you don't have to write it down.
Change the password for a range
1. Switch to the protected worksheet.
2. On the Tools menu, point to Protection, and then click Unprotect Sheet.
3. If prompted, type the worksheet password, and then click OK.
4. On the Tools menu, point to Protection, and then click Allow Users to Edit
Ranges.
5. In the Ranges unlocked by a password when sheet is protected list, click
the range for which you want to change the password.
6. Click Modify, and then click Password.
7. Type the new password for the range in the New password box.
8. Type the same password in the Confirm new password box, and then click
OK twice.
9. Click Protect Sheet.
10. Type the worksheet password in the Password to unprotect sheet box.
MS ADVANCED EXCEL
33
11. Click OK, and then retype the worksheet password to confirm it.
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. Use a strong password that you can remember so
that you don't have to write it down.
Change which users can edit which cells
1. Open the workbook and switch to the protected worksheet.
2. On the Tools menu, point to Protection, and then click Unprotect Sheet.
3. If prompted type the worksheet password, and then click OK.
4. On the Tools menu, point to Protection, and then click Allow Users to Edit
Ranges.
5. Do one or more of the following:
Change which users are allowed to edit a range
1. In the Ranges unlocked by a password when sheet is protected
box, click the range for which you want to change the users.
2. Click Modify, and then click Permissions.
3. Do one or more of the following:
To block a user temporarily from editing the range, click the user
in the Name list, and then select the Deny check box for the
user.
To unblock a user, click the user in the Name list, and then select
the Allow check box for the user.
To remove a user permanently, click the user in the Name list,
and then click Remove.
To add a new user, click Add, locate and select the new user, click
Add, and then click OK.
4. Click OK, click Yes if prompted about denying users, and then click OK
again.
Change which cells are included in a range
5. In the Ranges unlocked by a password when sheet is protected
box, click the range for which you want to change the included cells.
6. Click Modify.
7. In the Refers to cells box, type or select the new range, and then click
OK.
Remove protection for a range
8. In the Ranges unlocked by a password when sheet is protected
box, click the range you want to delete.
9. Click Delete.
6. When you are finished making changes in the Allow Users to Edit Ranges
dialog box, click OK.
7. On the Tools menu, point to Protection, and then click Protect Sheet.
8. Type the worksheet password in the Password to unprotect sheet box.
9. Click OK, and then retype the worksheet password to confirm it.
Change the protection or password for a workbook
MS ADVANCED EXCEL
34
Unprotect
MS ADVANCED EXCEL
35
4. If prompted about the effects on other users of removing protection, click Yes.
Secure a workbook with a password
To allow only authorized users to view or modify your data, you can help secure your
entire workbook file with a password.
1. On the File menu, click Save As.
2. On the Tools menu, click General Options.
3. Do either or both of the following:
o If you want users to enter a password before they can view the
workbook, type a password in the Password to open box, and then
click OK.
o If you want users to enter a password before they can save changes to
the workbook, type a password in the Password to modify box.
Note Unlike passwords you specify in the Password to open box, passwords
you specify in the Password to modify box are not encrypted. These
passwords are only meant to give specific users permission to modify workbook
data. For optimal password security, it's best to assign both passwords. An
encrypted password to access the workbook, and one to provide specific users
with permission to modify its content.
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. Use a strong password
that you can remember so that you don't have to write it down.
4. If you want to use a different encryption type, click Advanced, click the type
you want in the Choose an encryption type list, and then click OK.
5. If needed, specify the number of characters you want in the Choose a key
length box.
Note Document property encryption is enabled by default for most encryption
types and providers. It prevents unauthorized users from viewing summary and
custom file properties (such as the author or any custom file information) in the
Properties dialog box. When users right-click the password-protected file, and
then click Properties, information won't be available on the Summary tab and
Custom tab. Authorized users, however, can open the file and view all file
properties (File menu, Properties command). To disable document property
encryption, clear the Encrypt document properties check box.
6.
7.
8.
9.
Click OK.
When prompted, retype your passwords to confirm them.
Click Save.
If prompted, click Yes to replace the existing workbook.
Note You can also secure a workbook with a password on the Security tab of the
Options dialog box (Tools menu, Options command).
Change or remove a workbook password
MS ADVANCED EXCEL
36
MS ADVANCED EXCEL
37
Note You may also want to save or print the current version of the
workbook, because this history might not apply to later versions. For
example, cell locations, including row numbers, in the copied history may
no longer be current.
3. On the Tools menu, click Share Workbook, and then click the Editing tab.
4. Make sure that you are the only person listed in the Who has this workbook
open now box.
5. Clear the Allow changes by more than one user at the same time check
box.
If this check box is not available, you must unprotect the workbook before
clearing the check box.
How?
1. Click OK, point to Protection on the Tools menu, and then click
Unprotect Shared Workbook.
2. Enter the password if prompted, and then click OK.
3. On the Tools menu, click Share Workbook, and then click the Editing
tab.
6. When prompted about the effects on other users, click Yes.
MS ADVANCED EXCEL
38
MS ADVANCED EXCEL
39
DATA area.
Drag fields that you want to use as page fields onto the PAGE area.
If you want Excel to retrieve data one page at a time, so you can work
with large amounts of source data, double-click the page field, click
Advanced, click Query external data source as you select each
page field item, and then click OK twice. (This option is unavailable for
some types of source data, including OLAP databases and Office Data
Connections.)
5.
To rearrange fields, drag them from one area to another. Some fields can only
be used in some of the areas; if you drop a field in an area where it can't be used, the
field won't appear in the area.
To remove a field, drag it out of the diagram.
6.
When you are satisfied with the layout, click OK, and then click Finish.
Format a PivotTable report
Do one or more of the following:
Apply indented or nonindented format
1. Click the report.
2. On the PivotTable toolbar, click Format Report
.
3. Do one of the following:
To apply an indented format, click one of options Report 1 through Report 10.
These options both apply formatting and move any column fields (column field:
A field that's assigned a column orientation in a PivotTable report. Items
associated with a column field are displayed as column labels.) in your report to
the row area.
To apply a nonindented (crosstabulated) format, click one of options Table 1
through Table 10 or PivotTable Classic, the default format for new reports.
Options Table 1 through Table 10 also move the leftmost row field (row field:
A field that's assigned a row orientation in a PivotTable report. Items associated
with a row field are displayed as row labels.) to the column area.
Note To restore the report to its previous layout, click Undo
applying a new format.
immediately after
MS ADVANCED EXCEL
40
between items.
2. Click Layout.
3. To add or remove the blank rows, select or clear the Insert blank line after
each item check box.
Note You can apply character and cell formatting to the blank rows, but you can't
enter data in them.
Use merged or regular cells for outer row and column items
1. Click the report.
2. On the PivotTable toolbar, click PivotTable, and then click Table Options.
3. To use merged cells for outer row and column items, select the Merge labels
check box.
To use regular cells, clear the check box.
Change the data area number format
1. Click a cell in the data area.
2.
3.
4.
5.
6.
MS ADVANCED EXCEL
41
Note When you change formatting in a PivotTable report, some formatting may be lost
in PivotChart reports based on it.
Sort a PivotTable or PivotChart report
Microsoft Excel uses the following order for ascending sort: numbers, text, logical
values, error values such as #REF! and #VALUE!, and then blank cells. Descending
order is the reverse, except for blank cells, which are always sorted last.
1. Click the field with the items you want to sort.
For a PivotChart report, click the field in the associated PivotTable
report (associated PivotTable report: The PivotTable report that supplies the
source data to the PivotChart report. It is created automatically when you create
a new PivotChart report. When you change the layout of either report, the other
also changes.). To sort items in a series field, click the corresponding column
field. To sort items in a category field, click the corresponding row field.
2. Do one of the following:
Sort the items ascending or descending
1. On the PivotTable toolbar, click PivotTable, and then click Sort and
Top 10.
2. Under AutoSort options, click Ascending or Descending.
3. In the Using field list, do one of the following:
To sort the items by their labels, click the same field that you're sorting.
To sort the items by their values in the data area (data area: The part of
a PivotTable report that contains summary data. Values in each cell of the
data area represent a summary of data from the source records or
rows.), click the data field (data field: A field from a source list, table, or
database that contains data that is summarized in a PivotTable report or
PivotChart report. A data field usually contains numeric data, such as
statistics or sales amounts.) that supplies the values you want to sort on.
Note When you refresh the report or change its layout, Excel resorts the field
in the order you specified.
Sort the items by a particular data value
4. Click the cell in the data area that contains the value you want to sort by.
For example, if you want to sort your products by a particular month's
MS ADVANCED EXCEL
42
sales value, click the value for that month in the data area.
5. On the Data menu, click Sort.
6. Select any options you want, and then click OK.
Sort the items in a custom order
The custom order is not retained if you refresh the report.
7. On the Data menu, click Sort.
8. Click Options.
9. In the First key sort order box, click an option.
If you don't see the option you want, you can create your own custom
sort order by clicking Options on the Tools menu and using the Custom
Lists tab.
Note You can organize items in a custom order manually by selecting and
dragging them.
Stop sorting or return the items to their original order
10. On the PivotTable toolbar, click PivotTable, and then click Sort and
Top 10.
11. Under AutoSort options, click Manual to stop automatic sorting or
Data source order to return the items to their original order.
Note After you sort a PivotChart report or its associated PivotTable report, some chart
formatting may be lost.
Tip
In a field that's organized in levels, you can sort all the items for a lower level together
by hiding the upper levels before you sort. To hide an upper level, right-click it and then
click Hide Levels on the shortcut menu.
Change the layout of a PivotTable report
1. Click the report.
2. If you have multiple page fields, arrange them in rows or columns.
How?
1. On the PivotTable toolbar, click PivotTable, and then click Table
Options.
2. In the Page layout list, click the order in which you want the page fields
to appear.
3. In the Fields per row or Fields per column box, enter the number of
page fields that you want in each row or column.
3. Decide whether to make the layout changes onscreen or in the wizard. Usually
you can make changes on the worksheet. If changes result in long delays to
retrieve and display data, use the wizard.
If you can work onscreen, do one or more of the following:
Change the layout on the worksheet
1. If you don't see the blue drop area (drop area: An area in a PivotTable or
MS ADVANCED EXCEL
43
PivotChart report where you can drop fields from the Field List dialog
box to display the data in the field. The labels on each drop area indicate
the types of fields you can create in the report.) outlines, click Show
Field List
on the PivotTable toolbar to display the field list.
2. To move a field from its current position to the row, column, or data
area, drag the field button to a new position.
Fields with icons in the PivotTable Field List window can be used only
in the row, column, and page areas. Fields with
icons can be used only
in the data area. Fields with icons can be used in any area.
3. To create a page field, drag the field to the page area at the top of the
report.
If the page area is missing (row or column fields start in row 1), use the
wizard to change the layout and create page fields.
4. To change the order of the items within a row or column field, click an
item label, and then point to the bottom border of the cell. When the
pointer becomes an arrow, drag the item to a new position:
5. To change the order of the data fields, right-click one, point to Order on
the shortcut menu, and use the commands on the Order menu to move
the field.
You can also click a data field and then point to the bottom border of the
cell. When the pointer becomes an arrow, drag the data field to a new
position.
Add or remove a field on the worksheet
Add a field Drag the field from the PivotTable Field List window to the area
of the report for the type of field that you want to create.
Fields with icons in the PivotTable Field List window can be used only in the
row, column, and page areas. Fields with
icons can be used only in the data
area. Fields with icons can be used in any area.
Remove a field Drag the field button out of the report.
If you can't work onscreen:
Notes
Use the wizard to change layout and add and remove fields
6. On the Data menu, click PivotTable and PivotChart report.
7. Click Layout.
8. To rearrange fields, drag them from one area to another in the diagram
on the left.
9. To add fields, drag them from the list of fields on the right to the
diagram.
Some fields can only be used in some of the areas. If you drop a field in
an area where it can't be used, the field won't appear in the area.
10. To remove a field, drag it out of the diagram.
11. When you're finished changing the layout, click OK, and then click
Finish.
MS ADVANCED EXCEL
44
Format Report
can also affect the layout of the report.
Changing the layout of a PivotTable report also affects any PivotChart reports
that are based on the report, and some chart formatting may be lost.
Create a chart from data in a PivotTable report
This procedure creates a regular, non-interactive chart rather than a PivotChart report.
1. Select the data in the PivotTable report that you want to use in your chart. To
include field buttons and data in the first row and column of the report, start
dragging from the lower-right corner of the data you're selecting.
2.
3.
4.
5.
Click Copy
.
Click a cell in a blank area.
On the Edit menu, click Paste Special.
Click Values, and then click OK.
45
Click in the worksheet where you want to place the linked object.
On the Insert menu, click Object.
Click the Create from File tab.
In the File name box, type the name of the file, or click Browse to select from a
list.
5. Select the Link to file check box.
6. To display the content, clear the Display as icon check box.
If you want to display as an icon, select the Display as icon check box.
Note You cannot use the Object command on the Insert menu to insert graphics and
certain types of files. To insert a graphic, point to Picture on the Insert menu, and then
click From File.
Embed a document
1. Click in the worksheet where you want to place the embedded object.
2. On the Insert menu, click Object.
MS ADVANCED EXCEL
46
3. If the document does not already exist, click the Create New tab. In the Object
type box, click the type of object you want to create.
If the document already exists, click the Create from File tab. In the File name
box, type the name of the file, or click Browse to select from a list.
4. Clear the Link to file check box.
5. To display the content, clear the Display as icon check box.
To display as an icon, select the Display as icon check box.
Insert part of an existing document as a linked or embedded object
1. From a program other than Microsoft Excel, select the information you want to copy
as a linked or embedded object.
2. Click Copy.
3. Switch to the worksheet you want to place the information in, and then click where
you want the information to appear.
4. On the Edit menu, click Paste Special.
5. To paste the information as a linked object, click Paste link.
To paste the information as an embedded object, click Paste. In the As box, click
the entry with the word "object" in its name. For example, if you copied the
information from a Microsoft Word document, click Microsoft Word Document
Object.
Note You can't paste worksheet cells or a chart as a linked or embedded object in a
Microsoft Excel workbook. However, you can use the Copy Picture command (hold down
SHIFT and click the Edit menu) to create a link to cells on this or another sheet
Create a reference between cells on the same or different worksheets
The following formulas contain relative references to and names of other cells. The cell that
contains the formula is known as a dependent cell when its value depends on the values in
other cells. For example, cell B2 is a dependent cell if it contains the formula =C2.
Example formula
=C2
=Sheet2!B2
=Asset-Liability
What it does
Uses the value in the cell C2
Uses the value in cell B2 on Sheet2
Subtracts a cell named Liability from a cell named Asset
MS ADVANCED EXCEL
47
USING MACRO
Create a macro
Record a macro
1. Set the security level to Medium or Low.
MS ADVANCED EXCEL
48
How?
1.
2.
3.
4.
Run a macro
Run a macro
1. Set the security level to Medium or Low.
How?
1. On the Tools menu, click Options.
2. Click the Security tab.
3. Under Macro Security, click Macro Security.
MS ADVANCED EXCEL
2.
3.
4.
5.
49
4. Click the Security Level tab, and then select the security level you want to
use.
Open the workbook that contains the macro .
On the Tools menu, point to Macro, and then click Macros.
In the Macro name box, enter the name of the macro you want to run.
Do one of the following:
Run a macro in a Microsoft Excel workbook
o Click Run.
If you want to interrupt, press ESC.
Run a macro from a Microsoft Visual Basic module
1. Click Edit.
2. Click Run Sub/UserForm.
Tip
If you want to run a different macro while you are in the Visual Basic Editor, click
Macros on the Tools menu. In the Macro name box, enter the name of the macro
you want to run, and then click Run.
MS ADVANCED EXCEL
50
Note If you assign a macro to a button or other object that is already in use as a hyperlink,
the hyperlink information is deleted. From then on, clicking the button or object runs the
macro instead.
Start a macro from an area, or hotspot, on a graphic object
1. Draw another object to create a hot spot for an existing object.
2. With the second graphic object selected, right-click a sizing handle of the button or
graphic object to display the shortcut menu.
3. On the shortcut menu, click Assign Macro.
4. Do one of the following:
o To assign an existing macro to the button or graphic object, enter the name
of the macro in the Macro name box, and then click OK.
o To record a new macro to assign to the selected graphic object, click Record.
When you finish recording the macro, click Stop Recording
o on the Stop Recording toolbar.
o To write a new macro in the Visual Basic Editor, click New. To edit an existing
macro, click the name of the macro in the Macro Name box, and then click
Edit.
5. On the Format menu, click AutoShape, and then click the Color and Lines tab.
6. Under Fill, click No Fill in the Color box. Under Line, click No Line in the Color
box.
7. Repeat these steps for each hotspot you want to create. You do not need to create a
new graphic object for each hotspot.
Start a macro from a toolbar button
1. On the Tools menu, click Customize.
2. Do one of the following:
o If the toolbar that contains the button is not visible, click the Toolbars tab,
and then select the check box next to the toolbar name.
o If the button you want to run the macro from is not on a toolbar, click the
Commands tab, and then click Macros in the Categories list. In the
Commands list, drag the Custom button onto a toolbar.
3. Right-click the toolbar button, and then click Assign Macro on the shortcut menu .
4. Enter the name of the macro in the Macro name box, and then click OK.
Delete a macro
1. Open the workbook that contains the macro you want to delete.
2. On the Tools menu, point to Macro, and then click Macros.
3. In the Macros in list, click This Workbook.
4. In the Macro name box, click the name of the macro that you want to delete.
5. Click Delete.
MS ADVANCED EXCEL