You are on page 1of 12

Basic Formulas

Excel for Traffickers


VLOOKUP
Purpose
Lookup a value in a table by matching on the first column

Return value
The matched value from a table.

Syntax
=VLOOKUP (value, table, col_index, [range_lookup])

Arguments
value- The value to look for in the first column of a table.
table- The table from which to retrieve a value.
col_index- The column in the table from which to retrieve a value.
range_lookup- [optional] TRUE = approximate match (default). FALSE = exact match.
COUNTIF
Purpose
Count cells that match criteria

Return value
A number representing cells counted.

Syntax
=COUNTIF (range, criteria)

Arguments
range- The range of cells to count.
criteria- The criteria that controls which cells should be counted.
EXACT
Purpose
Compare two text strings

Return value
A boolean value (TRUE or FALSE)

Syntax
=EXACT (text1, text2)

Arguments
text1- The first text string to compare.
text2- The second text string to compare.
CONCATENATE
Purpose
Join text together

Return value
Text joined together.

Syntax
=CONCATENATE (text1, text2, [text3], ...)

Arguments
text1- The first text value to join together.
text2- The second text value to join together.
text3- [optional] The third text value to join together.
LOGICAL IF
TheIF functionchecks whether a condition is met, and
returns one value if TRUE and another value if FALSE.
Excel logical functions - Overview
The following table provides a short summary of what each logical function does to help you choose
the right formula for a specific task:
LOGICAL AND
TheAND Functionreturns TRUE if all conditions are true and returns FALSE if any of the conditions are false.

Return value
TRUE or FALSE.

Syntax
AND(logical1, [logical2], ...)

Arguments
logical1- The first text value to join together.
logical2- The second text value to join together.

Example:
The AND function returns FALSE because the value in cell B2 is not higher than 5. As a result the IF function returns
Incorrect.
LOGICAL OR
TheOR Functionreturns TRUE if all conditions are true and returns FALSE if any of the conditions are false.

Return value
TRUE or FALSE.

Syntax
OR(logical1, [logical2], ...)

Arguments
logical1- The first text value to join together.
logical2- The second text value to join together.

Example:
The OR function returns FALSE because the value in cell B2 is not higher than 5. As a result the IF function returns
Incorrect.
LOGICAL OR and AND samples
=AND(OR(Cond1, Cond2), Cond3)
=AND(OR(Cond1, Cond2), OR(Cond3, Cond4)
=OR(AND(Cond1, Cond2), Cond3)
=OR(AND(Cond1,Cond2), AND(Cond3,Cond4))

For example, if you wanted to know what


consignments of bananas and oranges are
sold out, i.e. "In stock" number (column B)
is equal to the "Sold" number (column C),
the following OR/AND formula could
quickly show this to you:

=OR(AND(A2="bananas", B2=C2),
AND(A2="oranges", B2=C2))
LOGICAL AND, OR and IF
Formula to check if X is between Y and
Z, inclusive:
=IF(AND(A2>=B2,A2<=C2),"Yes",
"No")

Formula to check if X is between Y and


Z, not inclusive:
=IF(AND(A2>B2, A2<C2),"Yes", "No")
LOGICAL XOR
TheOR Functionreturns TRUE if all conditions are true and returns FALSE if any of the conditions are false.

Return value
TRUE or FALSE.

Syntax
OR(logical1, [logical2], ...)

Arguments
logical1- The first text value to join together.
logical2- The second text value to join together.

Example:
The OR function returns FALSE because the value in cell B2 is not higher than 5. As a result the IF function returns
Incorrect.

You might also like