Excel functions
Excel functions
String Functions
=B2&C2 Joins two cell contents where value
RituAfana
=CONCATENATE(B2,C2) returned with no space in between
=B2&” “&C2 To add a space between two
Ritu Afana
=CONCATENATE(B2,” “,C2) strings
=C2&”, “&B2
Add a space and a comma between
=CONCATENATE(C2,”, Afana, Ritu
two strings
“,B2)
=LEFT(A2,1)(Eg:SCHOOL) Extracts left most character from
S
the string
=LEFT(A2,2) Extracts two characters from the
SC
left
=LEFT(A2,4) Extracts four characters from the
SCHO
left.
=RIGHT(A2,1) Extracts right most character from
L
the string.
=RIGHT(A2,2) Extracts the right two characters
OL
from the string
=RIGHT(A2,4) Extracts the right four characters
HOOL
from the string
=MID(A2,3,1) Extracts the third character from
H
the string
=MID(A2,3,4) Extracts four characters from the
HOOL string starting at the third
character
=MID(A2,5,2) Extracts two characters from the
OL
string starting at the fifth character
=LEN(A2) Counts the number of characters in
the cell.
The LEN function simply counts all
characters that appear in a cell. All
6
characters are counted, including
space characters. Numbers are also
counted in their raw form (i.e.
number formatting is not included)
FIND(find_text, FIND locate one text string within a
within_text, [start_num]) second text string, and return the
number of the starting position of
the first text string from the first
=FIND("M",”Miriam”) character of the second text string.
It is case sensitive and don't allow
wildcard characters. If find_text is
"" (empty text), FIND matches the
first character in the search string
=EXACT(text1, text2) Word word Compares two text strings and
returns TRUE if they are exactly the
Page 1 of 10
lOMoARcPSD|51275989
Page 2 of 10
lOMoARcPSD|51275989
Math Functions
=INT(number) =INT(8.9) = 8 Rounds a number down to the
=INT(-8.9) = 9 nearest integer.
(Rounds -8.9 down. Rounding a
negative number down rounds
it away from 0)
=MOD(number, =MOD(3, 2) = 1 (Remainder of Returns the remainder after
divisor) 3/2) number is divided by divisor. The
result has the same sign as
divisor.
=RAND() =RAND()*100 RAND returns an evenly
distributed random real number
A random number greater than greater than or equal to 0 and
or equal to 0 and less than 100 less than 1. A new random real
number is returned every time
the worksheet is calculated.
To generate a random real
number between a and b, use:
=RAND()*(b-a)+a
Page 3 of 10
lOMoARcPSD|51275989
Page 4 of 10
lOMoARcPSD|51275989
=DATEDIF(Start_date,End
_date,"Y")
Page 5 of 10
lOMoARcPSD|51275989
Page 6 of 10
lOMoARcPSD|51275989
Logical Functions
=AND(condition1,condition2,…) =AND(A2>1,A2<100) Use the AND function,
(Displays TRUE if A2 is one of the logical
greater than 1 AND less functions, to
than 100, otherwise it determine if all
displays FALSE.) conditions in a test are
TRUE.
=OR(condition1,condition2,…) =OR(A2>1,A2<100) to determine if any
(Displays TRUE if A2 is conditions in a test are
greater than 1 OR less TRUE.
Page 7 of 10
lOMoARcPSD|51275989
LOOKUP FUNCTIONS
=LOOKUP(lookup_value, =LOOKUP(4.19, A2:A6, B2:B6) LOOKUP looks in a
lookup_vector, (Looks up 4.19 in column A, and one-row or one-
[result_vector]) returns the value from column B column range
that is in the same row.) (known as a vector)
for a value and
returns a value
from the same
position in a second
one-row or one-
column range.
=VLOOKUP (value, table, =VLOOKUP(C5,$G$5:$H$10,2,TRUE) Use VLOOKUP, one
col_index, of the lookup and
[range_lookup]) reference functions,
when you need to
find things in a
table or a range by
row. VLOOKUP only
looks right.
VLOOKUP retrieves
data based on
Page 8 of 10
lOMoARcPSD|51275989
column number.
your data must be
sorted in ascending
order by lookup
value when you use
approximate match
mode with
VLOOKUP.
=HLOOKUP( lookup_valu ==HLOOKUP("Axles", A1:C4, 2, The Excel Hlookup
e, table_array, TRUE) function 'looks up' a
row_index_num, (Looks up "Axles" in row 1, and given value in the
[range_lookup] ) returns the value from row 2 that's top row of a data
in the same column (column A).) array (or table), and
returns the
corresponding
value from another
row of the array.
In text-related
Hlookups, when the
[match_type]
argument is set to
0, the lookup_value
can contain the
following wildcard
characters:
? - matches any
single character
* - matches any
sequence of
characters
=MATCH( lookup_value, =MATCH( "aaaa", A1:A5, 0 ) The Excel Match
lookup_array, (Returns the position of “aaaa” in function looks up a
[match_type] ) A1:A5) value in an array,
and returns the
position of the
value within the
array.
=INDEX( array, row_num, =INDEX(A2:B3,2,2) The Excel Index
[col_num] ) (Value at the intersection of the function returns a
second row and second column in reference to a cell
the range A2:B3.) that lies in a
specified row and
column of a range
Page 9 of 10
lOMoARcPSD|51275989
of cells.
If you get an error from the Excel Index function this is likely to be one of the following:
Common Errors
#REF! -
Occurs if either:
The supplied row_num argument is greater than the number of rows in the supplied range;
The supplied [col_num] argument is greater than the number of columns in the supplied range;
The supplied [area_num] argument is greater than the number of areas in the supplied range.
#VALUE! - Occurs if any of the supplied row_num, [col_num] or [area_num]
arguments are non-numeric.
#N/A -
Occurs if the Hlookup function fails to find a match to the supplied lookup_value
The cause of this will generally depend on the value of the supplied [range_lookup]:
if [range_lookup] = TRUE
(or is omitted) - the #N/A error is likely to be because the smallest value in the lookup
row is greater than the supplied lookup_value.
if [range_lookup] = FALSE -
the #N/A error is likely to be because an exact match to the lookup_value is not found in the
lookup row.
If you believe an exact match should have been found by the Hlookup function, see the Failure to
Match Values page for details on how to diagnose and resolve this problem.
Page 10 of 10