Excel Functions
After we open a CSV file, we should save it as Excel workbook.
Mathematical Functions
Sum function (Adds up all the
values in a range)
Sum if (Adds all the values in a The syntax for SUMIF is:
range that meet specific =SUMIF(range, criteria, [sum_range])
criteria)
Range: The range of cells to evaluate.
Criteria: The condition that defines which cells are to be
added.
Sum range :The actual cells to sum.
Sumifs(Adds values in a range he syntax for the SUMIFS function is:
based on multiple criteria) =SUMIFS(sum_range, criteria_range1, criteria1, ...)
Sum_range :The range of cells containing the values you
want to add.
Criteria_range :The range of cells containing the records
you want to check against the criteria.
Criteria: The criteria to determine whether the value is
added or not.
Always the range and sum_range MUST be absolute reference
Round (Round a number to a The syntax for the ROUND function is:
specified number of digits) =ROUND(number,num_digits)
Roundup (Round a number up The syntax for the ROUNDUP function is:
to a specified number of digits) =ROUNDUP(number,num_digits)
Rounddown(Round a number The syntax for the ROUNDDOWN function is:
1
Excel Functions
down to a specified number of =ROUNDDOWN(number,num_digits)
digits)
Product(number1,number2,…) Multiply numbers given as arguments
Power(number,power) Returns the result of a number raised to a power
e.g =POWER(2,3) 23
MOD(number,dvisor) Returns the remainder after number is divided by
divisor
Number is the number for which you want to find the
remainder.
Divisor is the number by which you want to divide
number.
Statistical functions
Count (Counts all the values in The syntax for the Count function is:
a range) =COUNT(value1, [value2], ...)
CountA (Counts all non-empty The syntax for the COUNTA function is:
cells in a range) =COUNTA(value1,value2,...)
Countblank(Counts all blank The syntax for the COUNTBLANK function is:
cells in a range) =COUNTBLANK(range)
Countif(Counts all the cells in a The syntax for COUNTIF is:
range that meet specific critera) =COUNTIF(range, criteria)
Range : The range of cells to evaluate.
Criteria:The condition that defines which cells are to be
counted.
Countifs (Counts all the cells in The syntax for the COUNTIFS function is:
a range that meet multiple =COUNTIFS(criteria_range1, criteria1, ...)
criteria)
Criteria_range: The range of cells you want to look for
items to count.
Criteria: The criteria to determine whether the cell is
counted or not.
Note: always range MUST be absolute reference
Average (Calculates the The syntax for the Average function is:
average number from a range =AVERAGE(number1, [number2], ...)
of values)
2
Excel Functions
Averageif (Calculates the The syntax for the AVERAGEIF function is:
average of a range of values =AVERAGEIF(range, criteria, [average_range])
that meet specific criteria)
Range: The range of cells you want to test.
Criteria: The criteria the records have to meet to be
included.
Average_range :The range of values to average.
SUBTOTAL (function that is SUBTOTAL syntax:
used in place of a number of =SUBTOTAL (TYPE OF TOTAL, RANGE OF CELLS)
others.) TYPE OF TOTAL
RANGE OF CELLS
Always Range and average_range must be absolute reference
Max (Finds the maximum value in a The syntax for the Max function is:
range) =MAX(number1, [number2], ...)
Min (Finds the minimum value in a The syntax for the Min function is:
range) =MIN(number1, [number2], ...)
MaxIFS(max_range, criteria_range1, Max range is: the actual range of cells in which
criteria1,..) the maximum value will be determined.
3
Excel Functions
MinIFS(min_range, criteria_range1, Min range is: the actual range of cells in which
criteria1,..) the minimum value will be determined.
String Functions
LEFT (displays a specified number of Syntax:
characters from the left-hand side of a =LEFT(Text,Number of characters required)
piece of text)
RIGHT (displays a specified number of Syntax:
characters from the right hand side of =RIGHT(Text,Number of characters required
a piece of text)
MID ( returns the characters from the = MID ( Text , Start_num , Num_chars )
middle of a text string, given a starting
position and length ) Text - the string containing the desired data.
Start_num - specifies the starting character
from the left of the string to be kept.
Num_chars - specifies the number of
characters to the right of the Start_num to be
retained.
SEARCH (Locates the position of a SEARCH( search_text, within_text, [start_num] )
character within a string)
search_text -The character or text string that
you wish to search for. (write it between “”)
NOT CASE SENSETIVE
within_text -The text string that is to be
searched
[start_num] -
An optional argument that specifies the position
of the character from which the search should
begin
Find(Locates the position of a Same as Search
character within a string)
CASE SENSETIVE
LEN (Returns the number of characters LEN(a string of text)
in a text string)
CONCATENATE ( Joins separate pieces CONCATENATE(text1, [text2], ...)
of text into one item)
&( Joins separate pieces of text into =text1&text2..&text4
one item)
4
Excel Functions
VALUE (converts a piece of text into =Value(text)
actual value)
TEXT (converts a value into text in a =TEXT(B14,format)
specific number format) Format is written between “ ”
Use the custom number formats found in
(Number) group in the (Home) tab
Refer to examples after the table
TEXTJOIN(Concatenates a list or range =textjoin(delimiter,ignore_empty,text1,…)
of text strings using a delimiter) Delimiter: separator
Ignore_empty: if (TRUE) default, ignores
empty cells
Upper(text) Converts a text string to all upper-case letters
Lower(text) Converts a text string to all lower-case letters
Proper(text) Capitalizes the first letter in a text string and any
other letters in text that follow any character
other than a letter. Converts all other letters to
lowercase letters.
Trim(text) Removes all spaces from a text string except for
single spaces between words
Lookup functions
Vlookup(Looks vertically down a Lookup value: The value to search for.
list to find a record and returns
information related to that record). Table array : The list of data to search for
=vlookup(lookup_value,table_array,co the value in. It looks for the value in the
l_index_num,[range_lookup]) leftmost column.
Col index num: The column number from
the left of the data to be returned.
range_lookup: Logical value that could be
true or false
Hlookup works in the same way as Lookup value: The value to search for.
Vlookup except that it searches for
a value in the top row of a table and Table array : The list of data to search for
returns a value from a specified the value in. It looks for the value in the
row. leftmost column.
=Hlookup(lookup_value,table_arra row index num: The row number from the
y,row_index_num,[range_lookup]) left of the data to be returned.
5
Excel Functions
range_lookup: Logical value that could be
true or false.
Index function MATCH(lookup_value, lookup_array,
match function [match_type])
Match Function: retrieves a number (which
represents the col or the row number)
Lookup array for match is always one dimension
Match type:
1 or omitted : finds the largest value that is less than
or equal to lookup value. (lookup array should be in
ascending order)
0: exact match
-1: finds the largest value that is greater than or
equal to lookup value.(lookup array should be in
descending order)
Index Function
=INDEX (array, row_num, [col_num])
Index function retrieves a value such as other
lookup functions.
The array should have the answer in it.
*If both row_num and col_num are supplied,
INDEX returns the value in the cell at the
intersection of row_num and col_num.
Date & Time Functions
DATE ( this function creates a real =date(year,month,day)
date by using three normal numbers
typed into separate cells)
The result is displayed in the
dd/mm/yy
But using format cells it can be
changed
DATEDIF (This function calculates =datedif(Firstdate,end-date,”interval”).
the difference between two dates)
Interval:
"Y" The number of complete years in the
period.
"M" The number of complete months in the
period.
"D" The number of total days in the period.
"MD"
“MD” The difference between the days in
6
Excel Functions
start_date and end_date. The months and
years of the dates are ignored.
“YM” The difference between the months in
start_date and end_date. The days and
years of the dates are ignored
TODAY (returns the current date =today()
formatted as date)
DAY( serial number) =DAY(A2) serial number is the date
MONTH( serial number ) =MONTH(A2)
YEAR( serial number ) =YEAR(A2)
WEEKDAY(serial_number, =WEEKDAY(A2)
[returntype])
Returns the day of the week
corresponding to a date. The day is
given as an integer, ranging from 1
(Sunday) to 7 (Saturday), by default
Note: we can subtract two dates and it will give the interval in days.
To find the difference in months we find difference in years multiplied by 12 then
add to it the difference in months.
Date value (date_text) Use DATEVALUE to convert a date
represented by text to a serial
number.
YEARFRAC(start_date,end_date,basis) YEARFRAC(start_date,end_date,basis)
Calculates the fraction of the year Start_date is a date that
represented by the number of whole days represents the start date.
between two dates
End_date is a date that
represents the end date.
Basis is the type of day count
basis to use.
=TIME(Hour,minute,second) =TIME(Hour,minute,second)
TIME(converts three separate numbers to an
7
Excel Functions
actual time)
=hour(serial number) =hour(A2)
serial number is the time
HOUR(Show the hour of the day based upon
a time or a number)
=MINUTE(A2) =MINUTE(A2)
MINUTE(Show the minute based upon a
time or number)
=SECOND(A2)
SECOND(Show the second based upon a
time or number)
=now() =now()
NOW(Shows the current date and time)
1 minute=60 seconds
1hour=60 minute= (60*60) seconds
Always add minutes with minutes, seconds with seconds
Never use inhomogeneous time units
To find a time interval subtract the start time from the finish time.
Logical Functions (Conditional)
IF(logical test, [value if true], [value if This is simple if statement with one condition
false]) to test
Nested IF The number of (IF) will be equal to the
number of conditions to test -1, since the last
IF traps 2 results.
IFS(Logical test 1, value if true1, The IFS function checks whether one or more
conditions are met, and returns a value that
…) corresponds to the first TRUE condition.
IFS can take the place of multiple nested IF
statements
much easier to read with multiple conditions.
If no TRUE conditions are found, this function
returns #N/A error.
You need to trap all cases (if false)
8
Excel Functions
IFERROR(value, value if error) Returns value if error if expression is an error, and the
value of the expression itself otherwise
Testing Data Types
ISTEXT(value) Checks whether a value is text and returns true or
false
ISNUMBER(value) Checks whether a value is number and returns true or
false
ISNONTEXT(value) Checks whether a value is not text (blank cells are not
text), and returns true or false
ISERROR(value) Checks whether a value is an error and returns true or
false
Convert numbers to different number systems
BIN2DEC(number) The number should be binary digits
DEC2BIN(number,[places]) Places is optional, if you specify it, it will add zeroes to
the left of the binary number representation.
=DEC2BIN(12,10) 0000001100
BIN2HEX(number,[places])
HEX2BIN(number,[places])
DEC2HEX(number,[places])
HEX2DEC(number) Notice that conversion to decimal places does
not need number of places
Code(text) returns a numeric code for the first character in a
given text string
e.g code(“A”) will result in 65
Char(number) returns the character with the given ASCII decimal
code.
Char(65) will result in A
Rank(number,ref,[order]) returns the statistical rank of a given value within
a supplied array of values
9
Excel Functions
Examples for custom number format using TEXT function:
Custom Number Formats
07/07/2013 dd/mm/yyyy
Thursday dddd
Thursday, Nov, 7, 2013 dddd, mmm, d, yyyy
9:57 AM h:mm AM/PM
This is the format that should be
15:00 hh:mm
enclosed by “ “ when used in TEXT
1.4 #.## function.
1.40 0.00
e.g:
1.4 0.0
35.75% 0.00% =TEXT(A2,”dddd, mmm, d, yyyy”)
35.8% 0.0%
Let A2 have 1/1/2021
13/15 ??/??
7/8 ?/? It will be formatted as:
$15.67 unit price $0.00" unit price"
Friday, Jan, 1, 2021
10
Excel Functions
Error Meaning Causes
Value
#DIV/0 Division by zero The division operation in your formula refers to a cell
that contains the value 0 or is blank.
#N/A No value available Especially generated when using lookup functions and
values are not found
#NAME? Excel doesn’t recognize a This error value appears when you incorrectly type the
name range name, refer to a deleted range name, or forget
to put quotation marks around a text string in a
formula.
#NULL! You specified an intersection It is usually the result of a typo where a space
of two cell ranges whose cells character is used instead of a comma (,) or colon (:)
don’t actually intersect between two cell references.
#NUM! Problem with a number in the when you've entered a numeric value using a data
formula type or a number format that's not supported in the
argument section of the formula
#REF! Invalid cell reference This error occurs when you delete a cell referred to in
the formula or if you paste cells over the ones referred
to in the formula.
#VALUE! Wrong type of argument in a This error is most often the result of specifying a
function or wrong type of mathematical operation with one or more cells that
operator contain text.
11
Excel Functions
Wild cards
Asterisk (*) - zero or more characters
Question mark (?) - any one character
Note: wildcards only work with text, not numbers.
Wild cards used with:
functions : such as:
countif(range,”*O*”) counts all names in range that contains an O.
Filtering
Original data:
Filtered using wild cards (Ends with a) *a
Do not use “” in filter window
Write the criteria according to (equal to)
Find/replace
12
Excel Functions
13
Excel Functions
Differences between a function and a formula
Similarities between formula and functions:
Both start with an equal sign
Both perform Calculations
Sample question from past paper (March 2018 p2)
14