Excel Formulas & Functions: Learn With Basic Examples: Tutorials Data
Excel Formulas & Functions: Learn With Basic Examples: Tutorials Data
Basic EXAMPLES
Formulas and functions are the building blocks of working with numeric data in
Excel. This lecture introduces you to formulas and functions.
Tutorials Data
For this tutorial, we will work with the following datasets.
=A2 * D2 / 2
HERE,
"=" tells
Excel that this is a formula, and it should evaluate it.
"A2" * D2" makes reference to cell addresses A2 and D2 then multiplies the
values found in these cell addresses.
"/" is the division arithmetic operator
"2" is a discrete value
=C4*D4
HERE,
= E4 + E5 + E6 + E7 + E8
=SUM (E4:E8)
As you can see from the above function used to get the sum of a range of cells, it is
much more efficient to use a function to get the sum than using the formula which will
have to reference a lot of cells.
Common functions
Let's look at some of the most used functions in ms excel formulas. We will start with
statistical functions.
CATEGOR
S/N FUNCTION DESCRIPTION USAGE
Y
01 SUM Math & Trig
Adds all the values in a range of cells =SUM(E4:E8)
02 MIN Statistical
Finds the minimum value in a range of cells =MIN(E4:E8)
03 MAX Statistical
Finds the maximum value in a range of cells =MAX(E4:E8)
04 AVERAGE Statistical
Calculates the average value in a range of cells =AVERAGE(E4:E8)
05 COUNT Statistical
Counts the number of cells in a range of cells =COUNT(E4:E8)
06 LEN Text Returns the number of characters in a string text =LEN(B7)
Adds all the values in a range of cells that meet
07 SUMIF Math & Trig a specified criteria. =SUMIF(range,criteria, =SUMIF(D4:D8,">=1000",C4:C8)
[sum_range])
Calculates the average value in a range of cells
AVERAGEI
08 Statistical that meet the specified criteria. =AVERAGEIF(F4:F8,"Yes",E4:E8)
F
=AVERAGEIF(range,criteria,[average_range])
09 DAYS Date & Time Returns the number of days between two dates =DAYS(D4,C4)
10 NOW Date & Time Returns the current system date and time =NOW()
Numeric Functions
As the name suggests, these functions operate on numeric data. The following table
shows some of the common numeric functions.
S/ CATEGOR
FUNCTION DESCRIPTION USAGE
N Y
Returns True if the supplied value is numeric and False if it
1 ISNUMBER Information =ISNUMBER(A3)
is not numeric
2 RAND Math & Trig Generates a random number between 0 and 1 =RAND()
Rounds off a decimal value to the specified number of
3 ROUND Math & Trig =ROUND(3.14455
decimal points
Returns the number in the middle of the set of given
4 MEDIAN Statistical =MEDIAN(3,4,5,2
numbers
5 PI Math & Trig Returns the value of Math Function PI(π) =PI()
Returns the result of a number raised to a
6 POWER Math & Trig =POWER(2,4)
power. POWER( number, power )
7 MOD Math & Trig Returns the Remainder when you divide two numbers =MOD(10,3)
8 ROMAN Math & Trig Converts a number to roman numerals =ROMAN(1984)
String functions
These basic excel functions are used to manipulate text data. The following table
shows some of the common string functions.
S/ CATEGOR
FUNCTION DESCRIPTION USAGE
N Y
1 DATE Date & Time Returns the number that represents the date in excel =DATE(2015,2,4)
S/ CATEGOR
FUNCTION DESCRIPTION USAGE
N Y
code
2 DAYS Date & Time Find the number of days between two dates =DAYS(D6,C6)
3 MONTH Date & Time Returns the month from a date value =MONTH("4/2/2015")
4 MINUTE Date & Time Returns the minutes from a time value =MINUTE("12:31")
5 YEAR Date & Time Returns the year from a date value =YEAR("04/02/2015")
LOOKUP function
The Microsoft Excel LOOKUP function returns a value from a range (one row or one
column) or from an array.
The LOOKUP function is a built-in function in Excel that is categorized as
a Lookup/Reference Function. It can be used as a worksheet function (WS) in Excel.
As a worksheet function, the LOOKUP function can be entered as part of a formula in
a cell of a worksheet.
LOOKUP Function (Syntax)
In Syntax #1, the LOOKUP function searches for value in the lookup_range and
returns the value in the result_range that is in the same position.
The syntax for the LOOKUP function in Microsoft Excel is:
Parameters or Arguments
value
The value to search for in the lookup_range.
lookup_range
A single row or single column of data that is sorted in ascending order. The
LOOKUP function searches for value in this range.
result_range
Optional. It is a single row or single column of data that is the same size as
the lookup_range. The LOOKUP function searches for the value in
the lookup_range and returns the value from the same position in
the result_range. If this parameter is omitted, it will return the first column of
data.
Returns
The LOOKUP function returns any datatype such as a string, numeric, date,
etc.
If the LOOKUP function can not find an exact match, it chooses the largest
value in the lookup_range that is less than or equal to the value.
If the value is smaller than all of the values in the lookup_range, then the
LOOKUP function will return #N/A.
If the values in the LOOKUP_range are not sorted in ascending order, the
LOOKUP function will return the incorrect value.
VLOOKUP function
The VLOOKUP function is used to perform a vertical look up in the left most column
and return a value in the same row from a column that you specify. Let's explain this
in a layman's language. The home supplies budget has a serial number column that
uniquely identifies each item in the budget. Suppose you have the item serial number,
and you would like to know the item description, you can use the VLOOKUP
function. Here is how the VLOOKUP function would work.
HERE,
Summary
Excel allows you to manipulate the data using formulas and/or functions. Functions
are generally more productive compared to writing formulas. Functions are also more
accurate compared to formulas because the margin of making mistakes is very
minimum.