Lec 5
Lec 5
PACKAGES
Dr. Mohamed R. Ghetas
E-mail: [email protected]
Lecture 5
Complex Formula
A complex formula is one that uses more than one arithmetic operator.
In formulas containing more than one arithmetic operator, Excel uses the standard
order of precedence rules to determine which operation to perform first.
Order of precedence rules:
=4+.5/40*25
(Ans. 4.3125)
=(4+.5)/40*25
(Ans. 2.8125)
Functions (1)
Functions are predefined worksheet formulas that enable you to perform complex
calculations easily.
Excel functions are classified into groups based on their purposes, e.g. Financial, Date &Time,
Statistical, … etc.
Using the Insert Function button on the formula bar to choose a function from a dialog box.
One can manually type the function into a cell and then complete the arguments
needed.
However, this method requires knowledge of the name and initial characters of the
function, but it can be faster than opening several dialog boxes.
Excel’s Formula AutoComplete feature makes it easier to enter function names by
typing, because it suggests functions depending on the first typed letters.
Cell References
A cell reference refers to a cell or a range of cells on a worksheet and can be used
in a formula so that MS Excel can find the values or data that one wants that
formula to calculate.
In one or several formulas, one can use a cell reference to refer to:
Data from one or more contiguous cells on the worksheet.
Data contained in different areas of a worksheet.
Data on other worksheets in the same workbook or even on other workbooks.
In Ms Excel, one may want to reuse formulas in different parts of a worksheet to
reduce the amount of data to retype.
Based on their construction method, cell references can be classified into relative,
absolute and mixed references.
Relative, Absolute and Mixed Cell References (1)
Relative references are typically used when one wants to preserve the relationship to
the formula location (default).
For example, assume cell F5 contains the formula: =SUM(B5:E5). When Excel
retrieves values to calculate the formula in cell F5, it actually looks for “the four cells
to the left of the formula,” which in this case is cells B5:E5. This way, if one copies
the cell to a new location, such as cell F6, the results will reflect the new formula
location, and will automatically retrieve the values in cells B6:E6. These are relative
cell references, because Excel is recording the input cells in relation to or relative to
the formula cell.
Absolute cell references are typically used when one wants to preserve the exact
cell address in a formula.
Relative, Absolute and Mixed Cell References (2)
For example, one might have a constant like a price in a specific cell that s/he
wants to use in all formulas. Absolute cell reference can be created by placing a $
(dollar sign) in front of both the column letter and the row number of the cell
address manually (e.g. =C12*$B$16) or by pressing F4 after selecting the cell(s) in
the formula bar.
Sometimes when one copies a formula, s/he wants to change the row reference, but
keep the column reference the same. This type of cell referencing combines
elements of both absolute and relative referencing and is called a mixed reference.
For example, when copied, a formula containing the mixed reference C$14 would
change the column letter relative to its new location, but not the row number. In the
mixed reference $C14, the column letter would not change, but the row number
would be updated relative to its location. Like an absolute reference, a mixed
reference can be created by pressing the [F4] function key with the cell reference
selected (i.e. each press will give different combination).
Copy Formulas with Relative Cell References
One can copy formulas with Relative Cell References by using copy and paste or by
using auto fill options.
There are several pasting options including pasting values only, pasting values with
number formatting, pasting formulas only, pasting formatting only etc.
To access fill options see the figure:
Copy Formulas with Absolute and Mixed Cell References
Similar to copying with relative cell references. However, one needs to apply an
absolute cell reference before copying the formula to preserve the specific cell
address when the formula is copied.
Referencing Cells on other Worksheets/Workbooks
One can refer to cells that are on other worksheets in the same workbook by
prepending the name of the worksheet followed by an exclamation point (!) to the
start of the cell reference, e.g. worksheet2!B1:B6 means the six cells B1:B6 on
worksheet2 (on the current workbook).
One can refer to cells that are on other workbooks by prepending the name of the
workbook between brackets [ ], followed by the worksheet name and cell
references, e.g. [Workbook3.xlsx]worksheet1!C1:C6 means the six cells C1:C6 on the
worksheet1 on the Workbook3 file.
It is also possible to name the cells and ranges to simplify referencing as will be
described later.