You are on page 1of 27

Lecture (3)

Formulas and Functions


Outlines
Class Work
Formulas
- create formulas
- copying formulas
Operators
Formula error messages
Functions
Common functions
Sum & average function
Class Work
1. Create new spread sheet with patients
“group name” and type the following
information for any five patients.
Patient Patient Address Age TBW ECF PLAS ICF ISF
NO name MA
1
2
3
4
5
Cont,,,
Determine data type for each column and
apply the following format:
 The font color for all columns: red.
 The font size : 12.
 Back color of TBW column : blue, back
color of other columns : white, darker 15%.
(grey)
3. Add border line for all cells in all directions
with following format:
 Line color :red

4. change the column width and row height
upon data.
5. Find the following percents for all
patients
- ECF= 1/3 TBW
- Plasma=1/4 ECF
- ICF= TBW-ECF
- ISF=ECF-Plasma
Formulas: Creating formulas
Formula means the special format that
used to calculate values that represent the
contents of cells.
All formulas within Excel start with the
'equals' symbol. For example you can type
the following formula to multiply the
contents of cell C3 by the content of cell
D3.
=c3*d3
Cont…
The formulas is typed in formulas bar and
after finish typing press the Enter key and
you will see the result of the calculation in
new cell.
Cont…
The easy way to create formulas type
equals and click on cell and type operator
and click on other cell . And after press
enter you will see the same result of the
calculation.
Copying formulas
To copy formula click on cell that contains
result and move the mouse pointer to the
bottom-right border of this cell and you will
notice that the mouse pointer changes to the
shape of a small, solid black cross. When
you see this shape change press the mouse
button and while keeping the mouse button
depressed, drag down to other cells release
the mouse button and you will see the
formula copied down.
Operators
You use operators as part of your formulas.
There are other operators but these are the
commonly used ones.
+ (plus)
 (minus)
 / (divide)
 * (multiply)
Formula error messages
When writing formulas it is easy to make a
mistake: listed below are some common
error messages.
 #######
The contents of the cell cannot be displayed
correctly as the column is too narrow.
 #REF!
Indicates that a cell reference is invalid. This
is often displayed when you delete cells
which are involved in a formula.
Cont…
#NAME?
Excel does not recognise text contained
within a formula.
 #DIV/0!
This indicates that you have tried to
divide a number by zero (0).
Functions
A function allows you to calculate a result
such as adding numbers together, or
finding the average of a range of numbers.

To display the available functions, press


Ctrl+N to display a blank workbook and
then click on the Formulas tab and within
the Function Library group click on the
Insert Function icon.
Cont…

This will display the Insert Function


dialog box.
Common functions
Some commonly used functions include:
 SUM:
Used to add the contents of selected cells.
 AVERAGE:
Used to determine the average value of the
selected cells contents.
 COLUMNS:
Used to return the number of columns within a
reference.
Cont…
COUNT:
Used to count how many numbers are in the
list.
COUNTA:
Used to count the number of cells that are
not empty and the values within the list of
arguments.
COUNTBLANK:
Used to count empty cells within a cell range
Cont…
 MAX:
Used to return the maximum number from a
list.
 MIN:
Used to return the minimum number from a
list
 ROUND:
Used to round off numbers to a specified
number of decimal points.
MAX function
 Frompatients work book find the
maximum number of TBW.

= MAX(j2:j6)
MIN function
The MIN function will display the
minimum number within a range.
 from patients work book find the
minimum number of anatomy column.

=MIN (D2:D6)
Count function
The Count function will count up the number
of cells which contain numbers.
 Click on cell that you want to display the
number of cells in the column above that
contain a number.
- Click on the Formulas tab and within the
Function Library group click on the down
arrow next to (or under) the AutoSum icon.
You will see a drop down list displayed. Click
on the Count Numbers command
COUNTA function
COUNTA function used to count the
number of cells within a range that are not
empty.

the function has counted every instance of


a number or letter within the specified cell
range.
COUNTBLANK function
COUNTBLANK function used to count
empty cells within a cell range.
Round function
function is used to reduce a given value to
a specific number of decimal places. the
syntax of ROUND function is :
 =ROUND(number,num_digits)
number : the value to be rounded
num_digits: the number of decimal
places to reduce the above number.
IF function
IF function introduces decision making by
testing a specified condition in your
spreadsheet to see if it is true or false. if the
condition is true the function will execute
one action. if the condition is false the
function will execute different action. the
syntax of IF function is :
Cont …
=IF(logical_test,value_if_true,value_if_false)
- logical _test: a value that is tested to see
if it is true or false. i.e. j8>70.
- value_if_true: the value that is displayed
if the logical_test is true. i.e “A”
- value_if_false:the value that is displayed if
the logical_test is false. i.e “D”
Cont…
Example :
Create column in students work book with
name grade to show pass if total greater
than 150 and fail if it’s less than 150.

=IF(j2>150,”pass”,”fail”)
END
QUESTION ????

You might also like