Вы находитесь на странице: 1из 29

Excel Formulas

The bread and butter of Excel

You

must have an equals sign ( = ) as the


first character in a cell that contains a
formula.
The = sign tells excel that the contents of
the cell is a formula
Without the = sign, the formula will not
calculate anything. It will simply display
the text of the formula.

Excel Formulas
2

Formulas - correct
formula with = sign

After pressing ENTER

Missing = sign
Missing = sign!
Before pressing enter

After pressing ENTER


(no change - not a function)

Errors in Formulas

The following are some errors that may appear in a spreadsheet


(there are others too).
#######

Cell is too narrow to display the results of the formula. To fix this simply make
the column wider and the real value will be displayed instead of the
###### signs. Note that even when the ###### signs are being displayed,
Excel still uses the real value to calculate formulas that reference this cell.

#NAME?

You used a cell reference in the formula that is not formed correctly (e.g.
=BB+10 instead of =B3+10)

#VALUE!

Usually the result of trying to do math with a textual value. Example: =A1*3
where A1 contains the word hello

#DIV/0!

Trying to divide by zero. Example: =3/A1 where A1 contains 0 (zero)

Circular Reference

Using a formula that contains a reference to the cell that the formula lives in.
Example: putting the formula =A1+1 in cell A1 or putting the formula
=SUM(A1:B2) in any of the cells A1, B1, A2, B2

Common Errors

A function is a "named
Functions have :

operation"

a name
parentheses
parameters/arguments inside the parentheses
The words parameter and argument mean the
same thing
you can have many parameters for one function
separated with commas (,)
The number of parameters is one more than the
number of commas.

What is a function?
7

Logical
Test ?

Value
If
FALSE

Value
TRUE

LOGICAL Function IF
8

NESTED IF
9

FLOWCHART NESTED IF
Logi
cal
Test
_1 ?

Logic
al
Test_
2?

Value
If
TRUE

Value
If
TRUE

Logi
cal
Test
_n ?

Value
If
FALSE

Value
If
TRUE

10

Syntax for NESTED IF


We can type IF on IF (Nested IF)

=IF(logicaltest_1,valueifTrue,IF(logicaltest_n, valueifTrue,valueifFalse))

Note :
Comma (,) or commapoint (;) depend of your excel
use if the value is string or character

11

Create this table!

Fill the desc 2 with :


EXCELLENT
If UHT 90 - 100
VERY GOOD
If UHT 76 89
TRY AGAIN
If UHT 0 -75

We can type on Cell E5


=IF(C5<=75,TRY AGAIN,IF(C5<=89,VERY GOOD,EXCELLENT))

EXAMPLE
12

Gunakan fungsi
LEFT,MID,RIGHT
karakater & ut c. Keterangan ID
mengabungkan
terdiri dari 5 digit, diambil dari
IDnya

No.UJIAN:

- 1 digit terakhir pd segmen ke-1


- 3 digit pada segment ke-3
- 1 digit pada segment ke-4

Gunakan fungsi
LEFT,MID,RIGHT
di dalam fungsi IF

d. Keterangan KELAS
- Jika 2 digit pertama NO.UJIAN
01 = XI-IPA,

02=XI-IPS

- digit ke-4 dari ID menunjukan pararel


kelas, format KELAS (XI-IPA.2)

b. Keterangan lulus
a. Grade
Jika nilai ujian lebih besar dari 90 maka grade A Jika nilai grade A maka keterangan sangat baik
Jika nilai ujian lebih besar dari 80 maka grade B Jika nilai grade B maka keterangan baik
Jika nilai ujian lebih besar dari 70 maka grade C Jika nilai grade C maka keterangan cukup
Jika nilai ujian lebih besar dari = 60 maka grade DJika nilai grade D maka keterangan kurang baik
Jika nilai ujian lebih kecil dari 60 maka grade E Jika nilai grade E maka keterangan sangat jelek

EXERCISE 1 (Nested IF)


13

Exercise 1
Create this table!

Fill the desc 2 with :


EXCELLENT
If UHT 90 - 100
VERY GOOD
If UHT 80 89
GOOD
If UHT 76 79
TRY AGAIN
If UHT 0 -75

14

Warning: this slide was created using


Excel 2007. The dialog box in later
versions of Excel looks a little different,
but it has the same functionality.

Function dialog box


Functions for the selected category
Description
of currently
selected
function

15

Double

click on the function name to get a


dialog box that helps you enter values for
the parameters of the function.
(see next slide)

Function Editor
16

Function Editor
Put values for the parameters in
the edit boxes.

When you press OK, this will create the


function call:
=IF(A1=100,GOOD JOB,TRY AGAIN)

17

Syntax for IF
U can type on cell using :

=IF(logicaltest,valueifTrue,valueifFalse)
Note :
Comma (,) or commapoint (;) depend of your excel
use if the value is string or character
We can type IF on IF (Nested IF)

=IF(logicaltest,valueifTrue,IF(logicaltest, valueifTrue,valueifFalse))
18

Syntax :
=LEFT(text,numchar)
=MID(text,startnum,numchar)
=RIGHT(text,numchar)

TEXT FUNCTION
19

EXAMPLE
20

Example
Create this table!

Fill the desc column with :


REMIDIAL
If UHT Result < KKM
CONGRATULATION
If UHT Result >=KKM

21

Absolute Cell
Create this table!

Example
Fill the desc column with :
REMIDIAL
If UHT Result < KKM
CONGRATULATION
If UHT Result >=KKM

=IF(C5<$D$2,REMIDI,CONGRAT)
=IF(C6<D3,REMIDI,CONGRAT)
=IF(C7<D4,REMIDI,CONGRAT)
=IF(C9<D6,REMIDI,CONGRAT)

22

Exercise 1
Create this table!

Fill the desc 2 with :


EXCELLENT
If UHT 90 - 100
VERY GOOD
If UHT 80 89
GOOD
If UHT 76 79
TRY AGAIN
If UHT 0 -75

23

SOAL 1

What is the value for B1 ?


24

SOAL 2

What is the value for B2 ?


25

Analyze this Formula..>!

SOAL 3

Table for formulas above

What is the value for E5 ?


26

SOAL 1

What is the value for E5 ?


27

APA HASIL OUTPUT SEL B4?

SOAL

Incorrect formula

Correct formula
28

OPERATOR MATEMATIKA
OPERATOR

FUNGSI

Perkalian

Penjumlahan

Pengurangan

Pembagian

>

Lebih dari

<>

Tidak sama dengan

Pangkat

>=

Lebih dari sama dengan

29