Anda di halaman 1dari 25

FORMULAS AND FUNCTIONS

Module 2

Contents

If()
Count()
Sum()
Vlookup()

Logical Function: IF Statement

Use the IF function to return one value


if a condition is true and another value
if
it's
false.
F(logical_test, value_if_true, value_if_fals

Logical Function: IF Statement

F(logical_test, value_if_true, value_if_fals


Suppose that we are to output Profit under Remarks if
Total Sales is greater than 5,000, else output is Loss

=if(C2<=5000,Loss
,Profit)

Logical Function: IF Statement

F(logical_test, value_if_true, value_if_fals


=if(F5<=5000,,
Profit)

Returns a zero value if either value_if_true or


value_if_false does not contain any actual
value to return

Logical Function.xls/IF
Function Sheet

Logical Function: IF Statement

F(logical_test, value_if_true, value_if_fals

Erro
r!
A space () was
added BEFORE
the word

Return values set


to Currency (or
with the use of the
Separator
command button
) will
automatically set
zero values to a
dash (-)

A space () was
added AFTER the
word
Logical Function.xls/IF
Function Sheet

Logical Function:
IF Statement

F(logical_test, value_if_true, value_if_fals


=if(B2=Fragile,
200,)
=if(Trim(B2)=Fragile
,200,)

Original
formula
Modified
formula
TRIM() function removes
extra spaces from a word
except single spaces
between two words
A
A drop
drop down
down list
list may
may be
be
used
used under
under the
the Category
Category
to
to avoid
avoid typo
typo error
error
Logical Function.xls/IF
Function Sheet

Auto Sum Functions: COUNT()


The COUNT function counts the number of
cells that contain numbers, and counts
numbers within the list of arguments.
Use the COUNT function to get the number
of entries in a number field that is in a range
or array of numbers.
If you want to count logical values, text, or
error values, use the COUNTA function.
If you want to count only numbers that meet
certain criteria, use the COUNTIF function

Auto Sum Functions: COUNT()


The COUNT function counts the number of
cells that contain numbers, and counts
numbers within the list of arguments.
Use the COUNT function to get the number
of entries in a number field that is in a range
or array of numbers.
If you want to count logical values, text, or
error values, use the COUNTA function.
If you want to count only numbers that meet
certain criteria, use the COUNTIF function

Auto Sum Functions: COUNT()

=countif(A:A
,F4)
=countif(C:C,Li
ne)
=countif(C:C,B
ase)
=count(B:
B)
EXER3: CountCountIf Sheet

Auto Sum Function:


SUM(), SUMIF() Functions

The SUM function, one of the math and


trig functions, adds values. You can add
individual values, cell references or ranges
or a mix of all three.
Use the SUMIF function to sum the values
in a range that meet criteria that you
specify.

Auto Sum Function:


SUM(), SUMIF() Functions

Add Sheet: SumSumIf Sheet

Auto Sum functions: SUM(), SUMIF() Functions

a
1

a =SUMIF(A:A,F4,D:D)
1

Auto Sum functions: SUM(), SUMIF() Functions

a
1
a
2

a =SUMIF(A:A,F4,D:D)
1

=SUMIF(C:C,"line",D:D)
a
2
=SUMIF(C:C,base",D:D)

Auto Sum functions: SUM(), SUMIF() Functions

a
1
a
2
a
3
a =SUMIF(A:A,F4,D:D) =SUM(H4:H8)
1

=SUMIF(C:C,"line",D:D)
a
=SUM(H10,I12)
2
=SUMIF(C:C,base",D:D)

Auto Sum functions: SUM(), SUMIF() Functions


TRY IT OUT!
Suppose you are to create a Service Quotation
Sample in order to determine how much a
service or series of services would cost.

Auto Sum functions: SUM(), SUMIF() Functions

a
2

a
1

a
1
=SUMIF(D6:H6,"x",$D$5:$H$5)
a =SUM(J6:J13)
2

Note: In this example, it is


assumed that Service Rates are
MANUALLY inputted.
Service Rates were based on the
Rate.xls

Lookup and Reference Function: Vlookup()


VLOOKUP is a database function, meaning
that it works with database tables or more
simply, lists of things in an Excel worksheet.

For
For the
the VLOOKUP
VLOOKUP function
function to
to work,
work, list
list must
must have
have aa column
column
containing
containing the
the unique
unique identifier,
identifier, and
and that
that column
column must
must be
be
the
the first
first column
column in
in the
the table.
table.

Lookup and Reference function: Vlookup()

a
1

a
1
=SUMIF(D6:H6,"x",$D$5:$H$5)

TIY#3: Suppose you are to create a Service


Quotation Sample in order to determine how
per
Aircraft
Type would
much a service or
series
of services
Lookup function.xls /
cost
VlookUp

Lookup and Reference function: Vlookup()

Add Sheet: Rate


Sheet

Lookup and Reference function: Creating


Range name

Highlight range of cells to be named


In the Name box, type the name you
want to assign for the range of cells.
To edit range name, go to FORMULAS
tab
In the Defined Names group, click
Name Manager command button
It
It makes
makes little
little difference
difference to
to the
the VLOOKUP
VLOOKUP function,
function, which
which doesnt
doesnt
really
really care
care if
if the
the list
list is
is located
located on
on the
the same
same sheet,
sheet, aa different
different sheet,
sheet,
or
or aa completely
completely different
different workbook.
workbook.

Lookup and Reference function: Vlookup()

=vlookup(C2,R
ATE,2)
It
It makes
makes little
little difference
difference to
to the
the VLOOKUP
VLOOKUP function,
function, which
which doesnt
doesnt
really
really care
care if
if the
the list
list is
is located
located on
on the
the same
same sheet,
sheet, aa different
different sheet,
sheet,
or
or aa completely
completely different
different workbook.
workbook.

Lookup and Reference function: Vlookup()

$D$5:$H$5 Range Name

Lookup and Reference function: Vlookup()


Switching Data Columns to Rows and vice
Right-click and choose
versa (Transpose)
a
1

Copy

a Transpose
2

button

Lookup and Reference function: Vlookup()


Switching Data Columns to Rows and vice
versa (Transpose)

Original
data
Transposed
data

Anda mungkin juga menyukai