Professional Documents
Culture Documents
Formulas are equations that perform calculations on values in your worksheet. A formula
starts with an equal sign (=). For example, the following formula multiplies 2 by 3 and then
adds 5 to the result.
=5+2*3
A formula can also contain any or all of the following: functions (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.), references, operators (operator: A sign or symbol
that specifies the type of calculation to perform within an expression. There are
mathematical, comparison, logical, and reference operators.), and constants (constant: A
value that is not calculated and, therefore, does not change. For example, the number 210,
and the text "Quarterly Earnings" are constants. An expression, or a value resulting from an
expression, is not a constant.).
Parts of a formula
Operators: The ^ (caret) operator raises a number to a power, and the * (asterisk) operator
multiplies.
Functions are predefined formulas that perform calculations by using specific values, called
arguments, in a particular order, or structure. Functions can be used to perform simple or
complex calculations. For example, the ROUND function rounds off a number in cell A10.
Structure of a function
Structure. The structure of a function begins with an equal sign (=), followed by the
function name, an opening parenthesis, the arguments for the function separated by
commas, and a closing parenthesis.
Function name. For a list of available functions, click a cell and press SHIFT+F3.
Arguments. Arguments can be numbers, text, logical values such as TRUE or FALSE,
arrays (array: Used to build single formulas that produce multiple results or that operate on
a group of arguments that are arranged in rows and columns. An array range shares a
common formula; an array constant is a group of constants used as an argument.), error
values such as #N/A, or cell references (cell reference: The set of coordinates that a cell
occupies on a worksheet. For example, the reference of the cell that appears at the
intersection of column B and row 3 is B3.). The argument you designate must produce a
valid value for that argument. Arguments can also be constants, formulas, or other
functions.
Argument tooltip. A tooltip with the syntax and arguments appears as you type the function.
For example, type =ROUND( and the tooltip appears. Tooltips only appear for built-in
functions.
Entering 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.
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.
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 Use
The cell in column A and row 10 A10
The range of cells in column A and rows 10 through 20 A10:A20
The range of cells in row 15 and columns B through E B15:E15
All cells in row 5 5:5
All cells in rows 5 through 10 5:10
All cells in column H H:H
Relative references A relative cell reference in a formula, such as A1, is based on the
relative position of the cell that contains the formula and the cell the reference refers to. If
the position of the cell that contains the formula changes, the reference is changed. If you
copy the formula across rows or down columns, the reference automatically adjusts. By
default, new formulas use relative references. For example, if you copy a relative reference
in cell B2 to cell B3, it automatically adjusts from =A1 to =A2.
Absolute references An absolute cell reference in a formula, such as $A$1, always refer
to a cell in a specific location. If the position of the cell that contains the formula changes,
the absolute reference remains the same. If you copy the formula across rows or down
columns, the absolute reference does not adjust. By default, new formulas use relative
references, and you need to switch them to absolute references. For example, if you copy a
absolute reference in cell B2 to cell B3, it stays the same in both cells =$A$1.
Mixed references A mixed reference has either an absolute column and relative row, or
absolute row and relative column. An absolute column reference takes the form $A1, $B1,
and so on. An absolute row reference takes the form A$1, B$1, and so on. If the position of
the cell that contains the formula changes, the relative reference is changed, and the
absolute reference does not change. If you copy the formula across rows or down columns,
the relative reference automatically adjusts, and the absolute reference does not adjust. For
example, if you copy a mixed reference from cell A2 to B3, it adjusts from =A$1 to =B$1.
If you want to analyze data in the same cell or range of cells on multiple worksheets within
the workbook, use a 3-D reference. A 3-D reference includes the cell or range reference,
preceded by a range of worksheet names. Excel uses any worksheets stored between the
starting and ending names of the reference. For example, =SUM(Sheet2:Sheet13!B5) adds
all the values contained in cell B5 on all the worksheets between and including Sheet 2 and
Sheet 13.
•You can use 3-D references to refer to cells on other sheets, to define names, and to
create formulas by using the following functions: SUM, AVERAGE, AVERAGEA,
COUNT, COUNTA, MAX, MAXA, MIN, MINA, PRODUCT, STDEV, STDEVA, STDEVP,
STDEVPA, VAR, VARA, VARP, and VARPA.
• 3-D references cannot be used in array formulas (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.
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
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.
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-to-
understand 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.
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.
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
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.
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').
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
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.
Text concatenation operator Use the ampersand (&) to join, or concatenate, one or
more text strings to produce a single piece of text.
Reference operators Combine ranges of cells for calculations with the following
operators.
Reference
Meaning (Example)
operator
Range operator, which produces one reference to all the cells between two
: (colon)
references, including the two references (B5:B15)
Union operator, which combines multiple references into one reference
, (comma)
(SUM(B5:B15,D5:D15))
Intersection operator, which produces on reference to cells common to the
(space)
two references (B7:D7 C6:C8)
Formulas calculate values in a specific order. A formula in Excel always begins with an equal
sign (=). The equal sign tells Excel that the succeeding characters constitute a formula.
Following the equal sign are the elements to be calculated (the operands), which are
separated by calculation operators. Excel calculates the formula from left to right, according
to a specific order for each operator in the formula.
Operator precedence
If you combine several operators in a single formula, Excel performs the operations in the
order shown in the following table. If a formula contains operators with the same
precedence— for example, if a formula contains both a multiplication and division operator
— Excel evaluates the operators from left to right.
Operator 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)
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.
Database functions
Function Description
DAVERAGE Returns the average of selected database entries
DCOUNT Counts the cells that contain numbers in a database
DCOUNTA Counts nonblank cells in a database
DGET Extracts from a database a single record that matches the specified criteria
DMAX Returns the maximum value from selected database entries
Engineering functions
Function Description
BESSELI Returns the modified Bessel function In(x)
BESSELJ Returns the Bessel function Jn(x)
BESSELK Returns the modified Bessel function Kn(x)
BESSELY Returns the Bessel function Yn(x)
BIN2DEC Converts a binary number to decimal
BIN2HEX Converts a binary number to hexadecimal
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
PRICEDISC Returns the price per $100 face value of a discounted security
Returns the price per $100 face value of a security that pays interest at
PRICEMAT
maturity
PV Returns the present value of an investment
RATE Returns the interest rate per period of an annuity
RECEIVED Returns the amount received at maturity for a fully invested security
SLN Returns the straight-line depreciation of an asset for one period
Returns the sum-of-years' digits depreciation of an asset for a specified
SYD
period
TBILLEQ Returns the bond-equivalent yield for a Treasury bill
TBILLPRICE Returns the price per $100 face value for a Treasury bill
TBILLYIELD Returns the yield for a Treasury bill
Returns the depreciation of an asset for a specified or partial period by using
VDB
a declining balance method
Returns the internal rate of return for a schedule of cash flows that is not
XIRR
necessarily periodic
Returns the net present value for a schedule of cash flows that is not
XNPV
necessarily periodic
YIELD Returns the yield on a security that pays periodic interest
Returns the annual yield for a discounted security; for example, a Treasury
YIELDDISC
bill
YIELDMAT Returns the annual yield of a security that pays interest at maturity
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
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
INTERCEPT Returns the intercept of the linear regression line
Text functions
Function Description
Changes full-width (double-byte) English letters or katakana within a
ASC
character string to half-width (single-byte) characters
BAHTTEXT Converts a number to text, using the ß (baht) currency format
CHAR Returns the character specified by the code number
CLEAN Removes all nonprintable characters from text
CODE Returns a numeric code for the first character in a text string
CONCATENATE Joins several text items into one text item
DOLLAR Converts a number to text, using the $ (dollar) currency format
EXACT Checks to see if two text values are identical
FIND, FINDB Finds one text value within another (case-sensitive)
FIXED Formats a number as text with a fixed number of decimals
Changes half-width (single-byte) English letters or katakana within a
JIS
character string to full-width (double-byte) characters
LEFT, LEFTB Returns the leftmost characters from a text value
LEN, LENB Returns the number of characters in a text string
LOWER Converts text to lowercase
Returns a specific number of characters from a text string starting at the
MID, MIDB
position you specify
PHONETIC Extracts the phonetic (furigana) characters from a text string
PROPER Capitalizes the first letter in each word of a text value
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
Converts a number to euros, converts a number from euros to a euro
EUROCONVERT member currency, or converts a number from one euro member currency to
another by using the euro as an intermediary (triangulation)
Connects with an external data source and runs a query from a worksheet,
SQL.REQUEST
then returns the result as an array without the need for macro programming
AUDITING WORKBOOK
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.
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.
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.
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:
• If more than one error path exists, Excel stops tracing at the branch point when
you use Trace Error . To continue tracing the error, click Trace Error
again.
• If the formula that displays the error contains a reference to another worksheet
or workbook, double-click the arrow that displays the worksheet icon . In the
Go to list, double-click the reference you want to locate. Then, click Trace
Error 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.
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.
DATA ANALYSIS
Create a scenario
CONDITIONAL FORMATTING
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
condition applied so that the formatting will be automatically reapplied when the
condition is met.
• 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.
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
in the formula so that each cell in the range B2:E3 is compared with the corresponding
total in column F.
Formula Is Formats
=AND(AVERAGE($A$1:$A$5)>3000,
Condition 1 Green cell shading
MIN($A$1:$A$5)>=1800)
Verify a conditional format before applying it An easy way to ensure that formula
references are correct is to apply the conditional formatting first to one cell in the
range. Then select the entire range, click Conditional Formatting on the Format
menu, and then click OK. The conditional formatting you applied to the first cell is
applied to the entire range, with the formula correctly adjusted for each cell.
Testing whether conditions are true or false and making logical comparisons between
expressions are common to many tasks. You can use the AND, OR, NOT, and IF
function to create conditional formulas.
The IF function uses the following arguments.
To do this task, use the AND, OR, and NOT functions, and operators.
Example
The example may be easier to understand if you copy it to a blank worksheet.
A
Data
15
9
8
Sprockets
Widgets
Formula Description (Result)
=AND(A2>A3, A2<A4) Is 15 greater than 9 and less than 8? (FALSE)
=OR(A2>A3, A2<A4) Is 15 greater than 9 or less than 8? (TRUE)
=NOT(A2+A3=24) Is 15 plus 9 not equal to 24? (FALSE)
=NOT(A5="Sprockets") Is A5 not equal to "Sprockets"? (FALSE)
=OR(A5<>"Sprockets",A6 = Is A5 not equal to "Sprockets" or A6 equal to
"Widgets") "Widgets"? (TRUE)
Function details
AND
OR
NOT
A
Data
15
9
8
Sprockets
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
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:
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.
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. Go to the network location where the shared workbook is stored, and open the
workbook.
2. Set the user name to identify your work in the shared workbook: on the Tools
menu, click Options, click the General tab, and then type your user name in
the User name box.
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.
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.
Worksheet elements
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.
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.
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
How?
1. Have all other users save and close the shared workbook. If other users
are editing, they will lose any unsaved work.
2. Unsharing the workbook deletes the change history. If you want to keep
a copy of this information, print out the History worksheet or copy it to
another workbook.
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. Do one or more of the following:
To print the History worksheet, click Print .
To copy the history to another workbook, select the cells
you want to copy, click Copy , switch to another
workbook, click where you want the copy to go, and click
Paste .
Note You may also want to save or print the current version of
the workbook, because this history might not apply to later
versions. For example, cell locations, including row numbers, in
the copied history may no longer be current.
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
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.
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 protection
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.
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.
7. In the Refers to cells box, type or select the new range, and then click
OK.
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.
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.
Remove protection
To allow only authorized users to view or modify your data, you can help secure your
entire workbook file with a password.
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.
6. Click OK.
7. When prompted, retype your passwords to confirm them.
8. Click Save.
9. 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).
Important Use strong passwords that combine upper- 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.
6. When prompted, retype the new password, and then click OK.
7. Click Save.
8. If prompted, click Yes to replace the existing workbook.
Note If you have protected a shared workbook with a password, you can't change the
password without unsharing the workbook, which deletes the change history.
1. Have all other users save and close the shared workbook. If other users are
editing, they will lose any unsaved work.
2. Unsharing the workbook deletes the change history. If you want to keep a copy
of this information, print out the History worksheet or copy it to another
workbook.
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. Do one or more of the following:
To print the History worksheet, click Print .
To copy the history to another workbook, select the cells you want
to copy, click Copy , switch to another workbook, click where
you want the copy to go, and click Paste .
Note You may also want to save or print the current version of the
workbook, because this history might not apply to later versions. For
example, cell locations, including row numbers, in the copied history may
no longer be current.
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.
1. Open the workbook where you want to create the PivotTable report (PivotTable
report: An interactive, crosstabulated Excel report that summarizes and
analyzes data, such as database records, from various sources, including ones
that are external to Excel.).
o If you are basing the report on a Web query (Web query: A query that
retrieves data stored on your intranet or the Internet.), parameter
query (parameter query: A type of query that, when you run it, prompts
for values (criteria) to use to select the records for the result set so that
the same query can be used to retrieve different result sets.), report
template (report template: An Excel template (.xlt file) that includes one
or more queries or PivotTable reports that are based on external data.
When you save a report template, Excel saves the query definition but
doesn't store the queried data in the template.), Office Data Connection
file, or query file, retrieve the data into the workbook, and then click a
cell in the Microsoft Excel 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.) containing the retrieved data.
If the retrieved data is from an OLAP (OLAP: A database technology that
has been optimized for querying and reporting, instead of processing
transactions. OLAP data is organized hierarchically and stored in cubes
instead of tables.) database, or the Office Data Connection returns the
data as a blank PivotTable report, continue with step 6 below.
o If you are basing the report on an Excel list or database, click a cell in
the list or database.
2. On the Data menu, click PivotTable and PivotChart Report.
3. In step 1 of the PivotTable and PivotChart Wizard, follow the instructions, and
click PivotTable under What kind of report do you want to create?
4. Follow the instructions in step 2 of the wizard.
5. Follow the instructions in step 3 of the wizard, and then decide whether to lay
out the report onscreen or in the wizard.
Usually you can lay out the report onscreen, and this method is recommended.
Use the wizard to lay out the report only if you expect retrieval from a large
external data source to be slow, or you need to set page fields (page field: A
field that's assigned to a page orientation in a PivotTable or PivotChart report.
You can either display a summary of all items in a page field, or display one item
at a time, which filters out the data for all other items.) to retrieve data one
page at a time. If you aren't sure, try laying out the report onscreen. You can
return to the wizard if necessary.
6. Do one of the following:
If you add more than one data field, arrange these fields in the order you
want: Right-click a data field, point to Order on the shortcut menu, and use
the commands on the Order menu to move the field.
3.Drag fields that you want to use as page fields to the area labeled Drop
Page Fields Here.
To rearrange fields, drag them from one area to another. To remove a field,
drag it out of the PivotTable report.
To hide the drop area outlines, click a cell outside the PivotTable report.
Note If data is very slow to appear as you lay out the report, click Always
Display Items on the PivotTable toolbar to turn off initial data display. If
retrieval is still very slow or error messages appear, click PivotTable and
PivotChart Report on the Data menu, and lay out the report in the wizard.
Note To restore the report to its previous layout, click Undo immediately after
applying a new format.
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.
2. On the PivotTable toolbar, click PivotTable, and then click Table Options.
3. Do one or more of the following:
Change error display Select the For error values, show check box under
Format options. In the box, type the value you want to display instead of
errors. To display errors as blank cells, delete any characters in the box.
Change empty cell display Select the For empty cells, show check box.
In the box, type the value you want to display in empty cells. To display blank
cells, delete any characters in the box. To display zeros, clear the check box.
Note Conditional formatting and cell borders aren't preserved when you refresh or
change the layout.
Note When you change formatting in a PivotTable report, some formatting may be lost
in PivotChart reports based on it.
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.
Note When you refresh the report or change its layout, Excel resorts the field
in the order you specified.
Note You can organize items in a custom order manually by selecting and
dragging them.
Note After you sort a PivotChart report or its associated PivotTable report, some chart
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.
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.
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.
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.
Notes
• 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.
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. Click Copy .
3. Click a cell in a blank area.
4. On the Edit menu, click Paste Special.
5. Click Values, and then click OK.
6. Click Chart Wizard and follow the instructions in the wizard to create the
chart.
1. Find and click the associated PivotTable report for the PivotChart report.
How?
This report has the same name as the PivotChart report. To check the name:
1. Click the PivotChart report.
2. Click PivotChart on the PivotTable toolbar.
3. Click Options, and note the name in the Name box.
4. Click each PivotTable report in the workbook, click PivotTable on the
PivotTable toolbar, click Table Options, and check for the same name
in the Name box.
2. On the PivotTable toolbar, click PivotTable, point to Select, and then click
Entire Table.
3. Press DELETE.
Tip
If the worksheet containing the associated PivotTable report doesn't have any data you
want to keep, you can delete the entire worksheet instead of deleting just the report.
On the Edit menu, click Delete Sheet.
1. Click the cell that contains the data you want to link to, and then click Copy on the
Standard toolbar.
2. Click the cell you want to link from, and then click Paste.
3. Click Paste Options and then click Link Cells.
1. Open both the workbook that will contain the link and the workbook that contains the
data you want to link to.
Link or embed content from another program using Object Linking and Embedding
(OLE)
OLE (Object Linking and Embedding) is supported by many different programs, and is used
to make content created in one program available in another. For example, you can insert a
Microsoft Word document into Microsoft Excel. To see what types of content you can insert,
click Object on the Insert menu. Only programs that are installed on your computer and
that support OLE objects appear in the Object type box.
The main differences between linked objects and embedded objects are where the data is
stored and how the object is updated after you place it in the destination file .
Embedded objects are stored in the workbook they are inserted in, and are not updated.
Linked objects remain as separate files, and need to be updated.
1. Click in the worksheet where you want to place the linked object.
2. On the Insert menu, click Object.
3. Click the Create from File tab.
4. 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.
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.
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
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
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.
You can create descriptive names to represent a cell or range of cells in another workbook.
1. Open both the workbook that will contain the link (called the destination workbook),
and the workbook that contains the data you want to link to (called the source
workbook).
2. In the destination workbook, click Save.
3. Select a cell or cells you want to link from. If you are creating a new formula, type =
(an equal sign).
If you are entering the link elsewhere in the formula, type the operator or function
that you want to precede the link.
4. On the Window menu, click the name of the source workbook, and then click the
worksheet that contains the cells you want to link to.
5. Press F3, and select the name you want to link to.
1. Open both the workbook that will contain the link (called the destination workbook),
and the workbook that contains the data you want to link to (called the source
workbook).
2. In the destination workbook, point to Name on the Insert menu, and then click
Define.
3. In the Names in workbook box, enter the name for the link.
4. Delete the contents of the Refers to box, and keep the cursor in the box.
If the name is a formula, enter the formula, and position the cursor where you want
the link. For example, type =SUM(), and position the cursor between the
parenthesis.
5. On the Window menu, click the name of the source workbook, and then click the
worksheet that contains the cells you want to link to.
6. Select the cell or range of cells you want to link to.
7. In the Define Name dialog box, click Add.
Change the source workbook for all links that use the source
Change the source of one link without affecting other links that use the source
1. Select the cell with the link.
2. In the formula bar, look for a reference to another workbook, such as
C:\Reports\[Budget.xls], and change it to the name of the new workbook.
USING MACRO
Create a macro
Record 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.
4. Click the Security Level tab, and then select the security level you want to
use.
2. On the Tools menu, point to Macro, and then click Record New Macro.
3. In the Macro name box, enter a name for the macro.
Notes
o The first character of the macro name must be a letter. Other characters can
be letters, numbers, or underscore characters. Spaces are not allowed in a
macro name; an underscore character works well as a word separator.
o Do not use a macro name that is also a cell reference or you can get an error
message that the macro name is not valid.
2. If you want to run the macro by pressing a keyboard shortcut key, enter a
letter in the Shortcut key box. You can use CTRL+ letter (for lowercase
letters) or CTRL+SHIFT+ letter (for uppercase letters), where letter is any
letter key on the keyboard. The shortcut key letter you use cannot be a
number or special character such as @ or #.
Note The shortcut key will override any equivalent default Microsoft Excel shortcut
keys while the workbook that contains the macro is open.
3. In the Store macro in box, click the location where you want to store the
macro.
If you want a macro to be available whenever you use Excel, select Personal Macro
Workbook.
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.
4. Click the Security Level tab, and then select the security level you want to
use.
2. Open the workbook that contains the macro .
3. On the Tools menu, point to Macro, and then click Macros.
4. In the Macro name box, enter the name of the macro you want to run.
5. Do one of the following:
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.
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.
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.