COMPO02 CHAPTER 7
COMPO02 CHAPTER 7
Objectives:
a.) Employ text functions to manipulate character. strings.
b.) Employ date and time functions to analyze data and calculate
due dates.
c.) Employ various formulas and functions to analyze data and
solve business problems.
TEXT FUNCTIONS
Microsoft Excel is all about numbers, and in your worksheets, you are likely to deal with numbers most of the
time. However, there are situations when you need to convert numbers to text, and it is where the TEXT
function steps in.
The functions have been grouped by category, to help you to find the function you need. Each function link
provides a full description of the function, with examples of use and common errors.
Note that some of the Excel text functions listed below are new to Excel 2013 or Excel 2016, so are not
available in earlier versions of Excel.
Functions to Remove Extra Characters
• CLEAN Removes all non-printable characters from a supplied text string
• TRIM Removes duplicate spaces, and spaces at the start and end of a text string
Information Functions
• LEN Returns the length of a supplied text string
Page 1
MODULE SPREADSHEET – COMPO02
• EXACT Tests if two supplied text strings are exactly the same and if so, returns TRUE; Otherwise,
returns FALSE. (case-sensitive)
CLEAN FUNCTION
The function is designed to remove the non-printable characters, represented by numbers 0 to 31 of the 7-
bit ASCII code, which are often found at the start of data that has been imported into Excel from other
applications.
The syntax of the Clean function is:
CLEAN( text )
where the text argument is the text string that you want to remove the non-printable characters from.
The following spreadsheet shows the Excel Clean function applied to four different text strings.
All four of the above examples give the same result, which is the string, "clean text"
TRIM FUNCTION
The syntax of the function is:
TRIM( text )
where the text argument is the text string that you want to remove the extra spaces from.
Trim Function Examples
The following spreadsheet shows the Trim function applied to four different text strings.
In all four of the above cases, the result is the string "trimmed text"
- with no spaces at the start or end and just one space in the middle.
LOWER FUNCTION
The syntax of the function is:
LOWER( text )
Where the text argument is the original text string, that you want to convert to lower case.
Page 2
MODULE SPREADSHEET – COMPO02
PROPER FUNCTION
The syntax of the function is:
PROPER( text )
Where the text argument is the original text string, that you want to convert to proper case.
Note: as well as the first letter of every word, letters following numbers or other punctuation are converted to
upper case by the Excel Proper function. This may be in places that you might not expect. For example, the
function converts the "s" in the text string "Bob's Boat" to upper case (i.e. "Bob'S Boat").
Proper Function Examples
In the following spreadsheet, the Excel Proper function is used to convert four text strings to proper case:
UPPER FUNCTION
The syntax of the function is:
UPPER( text )
Where the text argument is the original text string, that you want to convert to upper case.
Upper Function Examples
Column B of the following spreadsheet shows the Excel Upper function, used to convert four text strings to
upper case:
Page 3
MODULE SPREADSHEET – COMPO02
TEXT FUNCTION
The syntax of the function is:
TEXT( value, format_text )
Where the function arguments are:
value - A numeric value, that you want to be converted into text.
format_text - A text string that defines the formatting that you want to be applied to the supplied
value.
VALUE FUNCTION
The syntax of the function is:
VALUE( text )
where the text argument is a text string that can be translated into a number. This may be presented in any
of the numeric, date or time formats that are recognized by Excel.
Value Function Examples
Page 4
MODULE SPREADSHEET – COMPO02
The following spreadsheet shows five examples of the Value function, used to convert five different text string
representations of numbers into numeric values.
CONCAT FUNCTION
The syntax of the function is:
CONCAT( text1, [text2], ... )
where the text arguments are one or more text strings (or arrays of text strings), that you want to join together.
Notes:
The Concat function can handle up to 254 text arguments.
The result of the Concat function must not exceed 32,767 characters.
Each of the supplied text arguments can be an array of text strings/values or a single text string/value.
The Concat function was first introduced in Excel 2019 and so is not available in earlier versions of Excel. If
you have an earlier version of Excel, use the Concatenate function instead.
Concat Function Examples
Example 1 - Concatenating Simple Text
Column D of the following spreadsheet shows two simple examples of the Concat function.
Page 5
MODULE SPREADSHEET – COMPO02
CONCATENATE FUNCTION
The syntax of the function is:
CONCATENATE( text1, [text2], ... )
where the text arguments are a set of one or more text strings or other values that you want to join together.
Note that:
In current versions of Excel (Excel 2007 and later), you can supply up to 255 text arguments to the
Concatenate function, but in Excel 2003, the function can only accept up to 30 text arguments.
In Excel 2019, the Concatenate function has been replaced by the Concat function. However, the
Concatenate function is still available in Excel 2019, to ensure compatibility with earlier versions of Excel.
Concatenate Function Examples
The Concatenate function is used in column C of the following example spreadsheet, to join together the text
strings in columns A and B.
LEFT FUNCTION
The syntax of the function is:
LEFT( text, [num_chars] )
Page 6
MODULE SPREADSHEET – COMPO02
MID FUNCTION
The syntax of the function is:
MID( text, start_num, num_chars )
RIGHT FUNCTION
The syntax of the function is:
RIGHT( text, [num_chars] )
LEN FUNCTION
The syntax of the function is:
LEN( text )
Page 7
MODULE SPREADSHEET – COMPO02
EXACT FUNCTION
The syntax of the Exact function is:
Page 8
MODULE SPREADSHEET – COMPO02
DATE FUNCTION
The syntax of the function is:
DATE( year, month, day )
where the year, month and day arguments are integers representing the year, month and day of the required
date.
Page 9
MODULE SPREADSHEET – COMPO02
TIME FUNCTION
The syntax of the Time function is:
TIME( hour, minute, second )
where the hour, minute and second arguments are integer values representing the hour, minute and second
parts of the required time.
If the resulting time is negative (e.g. if the supplied hour is < 0), the Time function returns the #NUM! error.
DATEVALUE FUNCTION
The syntax of the Datevalue function is:
DATEVALUE( date_text )
where the date_text argument is a text string representing a date.
Datevalue Function Examples
Page 10
MODULE SPREADSHEET – COMPO02
In the following spreadsheet, the Excel Datevalue function is used to return a date serial number for five
different text representations of dates:
TIMEVALUE FUNCTION
The syntax of the Timevalue function is:
TIMEVALUE( time_text )
where the time_text argument is a text string representing a time. Within this text string, the hours, minutes
and seconds should be separated by colons.
Page 11
MODULE SPREADSHEET – COMPO02
TODAY FUNCTION
the syntax of the function is simply:
TODAY()
HOUR FUNCTION
The syntax of the function is:
HOUR( serial_number )
MINUTE FUNCTION
The syntax of the function is:
MINUTE( serial_number )
Minute Function Examples
Four examples of the Excel Minute function are shown in column B of the following spreadsheet.
Page 12
MODULE SPREADSHEET – COMPO02
SECOND FUNCTION
The syntax of the function is:
SECOND( serial_number )
Second Function Examples
Four examples of the Excel Second function are shown in column B of the following spreadsheet.
DAY FUNCTION
The syntax of the function is:
DAY( serial_number )
Day Function Examples
Column B of the following spreadsheet shows the Excel Day function, used to extract the day from three
different dates.
MONTH FUNCTION
The syntax of the function is:
MONTH( serial_number )
YEAR FUNCTION
The syntax of the function is:
YEAR( serial_number )
Page 13
MODULE SPREADSHEET – COMPO02
WEEKNUM FUNCTION
The syntax of the function is:
WEEKNUM( serial_number, [return_type] )
WEEKDAY FUNCTION
The syntax of the function is:
WEEKDAY( serial_number, [return_type] )
Page 14
MODULE SPREADSHEET – COMPO02
EOMONTH FUNCTION
The syntax of the function is:
EOMONTH( start_date, months )
WORKDAY FUNCTION
The syntax of the function is:
WORKDAY( start_date, days, [holidays] )
DAYS FUNCTION
The syntax of the function is:
DAYS( end_date, start_date )
Page 15
MODULE SPREADSHEET – COMPO02
DAYS360 FUNCTION
The syntax of the function is:
DAYS360( start_date, end_date, [method] )
EDATE FUNCTION
The syntax of the function is:
EDATE( start_date, months )
Page 16
MODULE SPREADSHEET – COMPO02
• #VALUE! Occurs if one of the variables in your formula is of the wrong type (e.g. text value when a
numeric value is expected).
• #REF! Arises when a formula contains an invalid cell reference.
• #NAME? Occurs if Excel does not recognize a formula name or does not recognize text within a
formula.
• #NUM! Occurs when Excel encounters an invalid number.
• #N/A Indicates that a value is not available to a formula.
•
For more knowledge about this chapter, please check the link provided;
(178) How to use the TEXT Function in Excel - YouTube
(178) 25 Date and Time Functions in Excel You Need to Know - YouTube
REFERENCES
https://www.excel-easy.com/
Page 17