0% found this document useful (0 votes)
11 views17 pages

COMPO02 CHAPTER 7

This document provides an overview of various Excel functions related to text manipulation and date/time analysis, including functions like CLEAN, TRIM, LOWER, and DATE. It outlines the syntax and usage of each function, along with examples to illustrate their application. Additionally, it highlights common Excel formula errors and provides references for further learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views17 pages

COMPO02 CHAPTER 7

This document provides an overview of various Excel functions related to text manipulation and date/time analysis, including functions like CLEAN, TRIM, LOWER, and DATE. It outlines the syntax and usage of each function, along with examples to illustrate their application. Additionally, it highlights common Excel formula errors and provides references for further learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

MODULE SPREADSHEET – COMPO02

CHAPTER 7: Excel Functions 3

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

Functions to Convert Between Upper & Lower Case


• LOWER Converts all characters in a supplied text string to lower case
• PROPER Converts all characters in a supplied text string to proper case (i.e. letters that do not
follow another letter are upper case and all other characters are lower case)
• UPPER Converts all characters in a supplied text string to upper case

Functions to Convert Excel Data Types


• TEXT Converts a supplied value into text, using a user-specified format
• VALUE Converts a text string into a numeric value

Cutting Up & Piecing Together Text Strings


• CONCAT Joins together two or more text strings (New in Excel 2019 - replaces the Concatenate
function)
• CONCATENATE Joins together two or more text strings (Replaced by Concat function in Excel 2019)
• LEFT Returns a specified number of characters from the start of a supplied text string
• MID Returns a specified number of characters from the middle of a supplied text string
• RIGHT Returns a specified number of characters from the end of a supplied 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

Lower Function Examples


In the spreadsheet below, the Excel Lower function is used to convert four text strings to lower case:

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] )

Left Function Examples


Column B of the following spreadsheet shows three examples of the Excel Left function.

Page 6
MODULE SPREADSHEET – COMPO02

MID FUNCTION
The syntax of the function is:
MID( text, start_num, num_chars )

Mid Function Examples


Column B of the spreadsheet below shows three examples of the Excel Mid function.

RIGHT FUNCTION
The syntax of the function is:
RIGHT( text, [num_chars] )

Right Function Examples


Column B of the spreadsheet below shows three examples of the Excel Right function.

LEN FUNCTION
The syntax of the function is:
LEN( text )

Page 7
MODULE SPREADSHEET – COMPO02

Excel Len Function Examples


In the spreadsheet below, the Len function is used to return the length of three different text strings (one of
which is empty).

EXACT FUNCTION
The syntax of the Exact function is:

EXACT( text1, text2 )


Where the text1 and text2 arguments are the two text strings, numbers or logical values that you want to
compare for equality.

Exact Function Examples


In the following spreadsheet, the Excel Exact function is used to compare four different pairs of text strings.

DATE AND TIME FUNCTIONS


Microsoft Excel provides a ton of functions to work with dates and times. Each function performs a simple
operation and by combining several functions within one formula you can solve more complex and
challenging tasks.
Creating Dates & Times
• DATE Returns a date, from a user-supplied year, month and day
• TIME Returns a time, from a user-supplied hour, minute and second
• DATEVALUE Converts a text string showing a date, to an integer that represents the date in Excel's date-
time code
• TIMEVALUE Converts a text string showing a time, to a decimal that represents the time in Excel

Page 8
MODULE SPREADSHEET – COMPO02

Current Date & Time


• NOW Returns the current date & time
• TODAY Returns today's date

Extracting The Components of a Time


• HOUR Returns the hour part of a user-supplied time
• MINUTE Returns the minute part of a user-supplied time
• SECOND Returns the seconds part of a user-supplied time

Extracting The Components of a Date


• DAY Returns the day (of the month) from a user-supplied date
• MONTH Returns the month from a user-supplied date
• YEAR Returns the year from a user-supplied date
• WEEKNUM Returns an integer representing the week number (from 1 to 53) of the year from a user-
supplied date
• WEEKDAY Returns an integer representing the day of the week for a supplied date

Performing Calculations with Dates


• EDATE Returns a date that is the specified number of months before or after an initial supplied start
date
• EOMONTH Returns a date that is the last day of the month which is a specified number of months
before or after an initial supplied start date
• WORKDAY Returns a date that is a supplied number of working days (excluding weekends & holidays)
ahead of a given start date
• DAYS Calculates the number of days between 2 dates (New in Excel 2013)
• DAYS360 Calculates the number of days between 2 dates, based on a 360-day year (12 x 30 months)

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

Date Function Examples


Column D of the following spreadsheet shows the Date function applied to different sets of values.

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.

Time Function Examples


Column E of the following spreadsheet shows three examples of the Excel Time function:

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.

Timevalue Function Examples


The following spreadsheet shows the Excel Timevalue function used to convert text representations of times
into decimal values that can be understood as times in Excel.
NOW FUNCTION
the function syntax is:
NOW()
The NOW function updates every time your Excel worksheet is refreshed, and so any cells containing the
function will be continually changing.

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 )

Hour Function Examples


In column B of the following spreadsheet, the Excel Hour function is used to extract the hour from several
different supplied times.

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 )

TYPES OF EXCEL FORMULA ERROR


If Excel detects that your Excel Formula or Function contains an error, it will return an error message (e.g.
#VALUE!, #N/A).
The error message that you are presented with, provides information about the type and cause of the Excel
formula error. It can therefore assist you with identifying and fixing the problem.
• #NULL! Arises when you refer to an intersection of two ranges that do not intersect.
• #DIV/0! Occurs when a formula attempts to divide by zero.

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

You might also like