You are on page 1of 16

EXCEL IN M.E.

– PART I

Keith A. Woodbury
Mechanical Engineering
University of Alabama
NAMING VARIABLES
 Using cell references can be difficult when working with formulas
and spreadsheets
 References like “A1” and “G47” don’t mean much
 By naming the cell it becomes easier to identify a parameter in a
formula or function call
 Assigning natural names to parameters makes it easier to find mistakes
NAMING VARIABLES - EXAMPLE

Not a good way to code


formulas. Although ‘F2’
reveals which cells are
involved in the computation,
a look at the formula does
not immediately reveal what
variables are involved.
Named Ranges
 Instead, use names for the variables
 Choose names that are longer than two characters so
Excel doesn’t confuse them with cell addresses
 Choose “P_1” instead of “P1”
 Or “Press” instead of “P”
NAMING VARIABLES - EXAMPLE

Create “named cells” to


use in formulas
This is on the
Highlight
“Formulas” ribbon in
cells with
Excel 2007
names and
values in
adjacent cells
Confirm location
of labels
Now the labels can
be used as
parameters in the
formula
NAMED RANGE - EXAMPLE

Named Cells can also be


ranges (vectors); in this
case the named cells are
in columns or rows
NAMED RANGE - EXAMPLE

Now the
formula is
readily human-
readable
Excel uses the
entry in the vector
on the same row
as the formula
DOCUMENTING SPREADSHEETS
 It is easier when working with formulas in Excel to document
them.
 Formulas are shown next to computed result
 Mistakes can be spotted quickly
 Documentation should also make printed copies of the file
understandable to knowledgeable person (teacher or colleague)
 This process involves copying formulas into cells or using Excel’s
Tools tab.
Suggested Convention…
 Use the first column for labels for the values
 Use the second column for the given value or
formula to compute the result
 Put the units of the quantity in the third column
 Use the fourth column to cut-and-paste the text of
the formula, or to provide additional explanatory
information
DOCUMENTING SS - EXAMPLE

First use ‘F2’ to


highlight show
the formula for
the cell
Now use keystroke
“SHIFT+HOME” to
highlight the cell entry
Then use “CTRL+c” to cut
the text to the clipboard
buffer, followed by “ESC” to
get out of “F2” mode
Now move over to the fourth
colum, put a leading tick-
mark (‘) so Excel will treat as
text (not formula), then use
“CTRL-v” to paste the
clipboard contents
Secret Jedi Keystroke sequence
 Highlight formula cell
 “F2” to get equation displayed
 “SHIFT-HOME” to highlight
 “CTRL-c” to copy
 “ESC” to get out of “F2” mode
 Move to fourth column
 Tick mark to treat paste as text
 “CTRL-v” to paste the formula

You might also like