Excel Formulas
Excel Formulas
String Functions
Page 1 of 10
lOMoARcPSD| 15848121
Page 2 of 10
lOMoARcPSD| 15848121
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| 15848121
Page 4 of 10
lOMoARcPSD| 15848121
=DATEDIF(Start_date,End
_date,"Y")
Page 5 of 10
lOMoARcPSD| 15848121
Page 6 of 10
lOMoARcPSD| 15848121
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| 15848121
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| 15848121
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| 15848121
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