Excel Worksheet - Session 6 - Section A

You might also like

Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 20

Function Syntax

LEFT LEFT (text, [num_chars])


RIGHT RIGHT (text, [num_chars])
MID MID (text, start_num, num_chars)

TRIM TRIM(text)
LEN LEN(text)

FIND FIND (find_text, within_text, [start_num])


SEARCH SEARCH (find_text, within_text, [start_num])

REPT REPT (text, number_times)

CONCATENATE CONCATENATE (text1, text2, [text3], ...)


CONCAT CONCAT (text1, [text2], ...)
TEXTJOIN (delimiter, ignore_empty, text1,
TEXTJOIN
[text2], ...)

REPLACE (old_text, start_num, num_chars,


REPLACE
new_text)
SUBSTITUTE (text, old_text, new_text,
SUBSTITUTE
[instance])

VALUE VALUE(text)

UPPER UPPER(text)
LOWER LOWER(text)
PROPER PROPER(text)

CHAR CHAR (number)

CODE CODE(text)

CLEAN CLEAN (text)

EXACT EXACT (text1, text2)


TEXT TEXT (value, format_text)

sdwsf
Details

The LEFT function extracts a given number of characters from the left side of a supplied text string.
The RIGHT function extracts a given number of characters from the right side of a supplied text string.
The MID function extracts a given number of characters from the middle of a supplied text string.

The TRIM function strips extra spaces from text, leaving only a single space between words, and removing any
leading or trailing space.
The LEN function returns the number of characters in a given text string.

The FIND function returns the position (as a number) of one text string inside another.
The SEARCH function returns the position (as a number) of one text string inside another.

The REPT function repeats characters a specified number of times.

The CONCATENATE function concatenates (joins) up to 30 values together and returns the result as text.
The CONCAT function concatenates (joins) values supplied as references or constants upto 255 in total.
The TEXTJOIN function concatenates multiple values together with or without a delimiter.

The REPLACE function replaces characters in a text string by position.

The SUBSTITUTE function can replace text by matching.

The VALUE function converts input that appears in a recognized format (i.e. a number, date, or time format)
into a numeric value.

The UPPER function converts a text string to all uppercase letters.


The LOWER function converts a text string to all lowercase letters.
The PROPER function capitalizes each word in a given text string

The Excel CHAR function returns a character when given a valid character code.

Returns a numeric code (ASCII decimal notation) for the first character in a text string

The CLEAN function takes a text string and returns text that has been "cleaned" of line breaks and other non-printable
characters.
The EXACT function compares two text strings, taking into account upper and lower case characters, and returns TRUE
if they are the same, and FALSE if not.
The TEXT function returns a number formatted as text, using the number format provided.
Comments

LEN counts the number of characters in text, including space and punctuation.

Case sensitive, does not support wildcard characters


Not case sensitive, supports wildcard characters

Although REPT can repeat numbers as well as text, the result from REPT is always a text value.

Inputs are to be selected one-by-one as the function doesn’t support ranges.


It can merge all strings from a given range. It automatically ignores empty cells.

It can merge all strings from a given range. It can optionally ignore empty cells.

Useful when the location of the text to be replaced is known or can be easily determined.

Useful when you want to replace text based on matching, not position.

Normally not needed as Excel automatically converts these inputs to numeric values in the backend

Numbers, punctuation, and spaces are not affected

It only understands numbers 0-255 and is useful when you want to specify characters in formulas or
functions that are awkward or impossible to type directly. For example, CHAR(10) returns a line break.

Removes the first 32 (non-printable) characters in the 7-bit ASCII code (values 0 through 31) from
text.
https://en.wikipedia.org/wiki/ASCII
EXACT is case-sensitive
The output from TEXT is always a text string.
q e e r qeer
dw sd f dwsdf
dwksdkkf

as as 1
First Name Reggie
Last Name Miller
asd
Full Name Reggie Miller
Reggie Miller
Reggie Miller
Reggie Miller asd

Full Name with 3 Additional Spaces Reggie Miller

Left 4 letters Regg


Right 4 letters ller
Trim spaces Reggie Miller
Number of characters 16
Number of characters in trimmed result 13

Trimmed Result as the Input Reggie Miller


5 characters starting at space 2 eggie
Find first space 7
Find first r ( case sensitive) 13
Find first r (not case sensitive) 1
Replace gg with nn Rennie Miller
Rennie Miller
Change to lower case reggie miller
Change to Upper case REGGIE MILLER
Change to Proper case Reggie Miller

New Input I love MS Office!


Replace all spaces by * I*love*MS*Office!
Replace only third space by * I love MS*Office!
Without using any function Reggie Miller asd
Using Concatenate Reggie Miller asd
Using Concat ReggieMillerasd
Using Textjoin Reggie Miller asd Reggie?\Miller?\asd

Reggie Miller
Reggie Miller asd

Regg
asd

17

find
find 1 13
search 1
substitute RennieMiller
replace
lower reggie miller
upper
proper Reggie Miller regg fff Regg Fff

I*love*MS*Office! I love MS Office!


#NAME?
Column B in the table provided below contains a product description, a product ID, and a product price. How ca
We know for certain that the p

Product Details
32592100AFES CONTROLLERPENTIUM/100,(2)1GB H 304.00
32592100JCP9 DESKTOP UNIT 225.00
325927008990 DESKTOP WINDOWS NT 4.0 SERVER 232.00
325926008990 DESKTOP WINDOWS NT 4.0 WKST 232.00
325921008990 DESKTOP, DOS OS 232.00
325922008990 DESKTOP, WINDOWS DESKTOP OS 232.00
325925008990 DESKTOP, WINDOWS NT OS 232.00
325930008990 MINITOWER, NO OS 232.00
32593000KEYY MINI TOWER 232.00

Trimmed details
32592100AFES CONTROLLERPENTIUM/100,(2)1GB H 304.00
32592100JCP9 DESKTOP UNIT 225.00
325927008990 DESKTOP WINDOWS NT 4.0 SERVER 232.00
325926008990 DESKTOP WINDOWS NT 4.0 WKST 232.00
325921008990 DESKTOP, DOS OS 232.00
325922008990 DESKTOP, WINDOWS DESKTOP OS 232.00
325925008990 DESKTOP, WINDOWS NT OS 232.00
325930008990 MINITOWER, NO OS 232.00
32593000KEYY MINI TOWER 232.00
description, a product ID, and a product price. How can one put all the product descriptions in column D, all the product IDs in column
We know for certain that the price detail would have 6 positions

Trimmed Details
32592100AFES CONTROLLERPENTIUM/100,(2)1GB H 304.00
32592100JCP9 DESKTOP UNIT 225.00
325927008990 DESKTOP WINDOWS NT 4.0 SERVER 232.00
325926008990 DESKTOP WINDOWS NT 4.0 WKST 232.00
325921008990 DESKTOP, DOS OS 232.00
325922008990 DESKTOP, WINDOWS DESKTOP OS 232.00
325925008990 DESKTOP, WINDOWS NT OS 232.00
325930008990 MINITOWER, NO OS 232.00
32593000KEYY MINI TOWER 232.00

32592100AFES CONTROLLERPENTIUM/100,(2)1GB H 304.00

MID(text_input,start_num,char_num)

start_num
position of the first space + 1

char_num
total length - id length - price length - 2
l the product descriptions in column D, all the product IDs in column E, and all the prices in column F?
ould have 6 positions

Product Description Product ID Price


CONTROLLERPENTIUM/100,(2)1GB 32592100AFES 304.00
DESKTOP UNI 32592100JCP9 225.00
DESKTOP WINDOWS NT 4.0 SERVE 325927008990 232.00
DESKTOP WINDOWS NT 4.0 WKS 325926008990 232.00
DESKTOP, DOS O 325921008990 232.00
DESKTOP, WINDOWS DESKTOP O 325922008990 232.00
DESKTOP, WINDOWS NT O 325925008990 232.00
MINITOWER, NO O 325930008990 232.00
MINI TOWE 32593000KEYY 232.00

Description Product ID
CONTROLLERPENTIUM/100,(2)1GB H 32592100AFES
DESKTOP UNIT 32592100JCP9
DESKTOP WINDOWS NT 4.0 SERVER 325927008990
DESKTOP WINDOWS NT 4.0 WKST 325926008990
DESKTOP, DOS OS 325921008990
DESKTOP, WINDOWS DESKTOP OS 325922008990
DESKTOP, WINDOWS NT OS 325925008990
MINITOWER, NO OS 325930008990
MINI TOWER 32593000KEYY
Column B contains information about the style, color, and size for a variety of shirts. For example, the first shi
between the colon and the hyphen). Its color is 65, and its size is L. Use text functions to extract the style

Item Style Colour


100's:100-65L 100 65
100's:100-65XL 100 65
100's:100-65XXL 100 65
100's:100-06M 100 06
100's:100-06L 100 06
125's:125-06M 125 06
125's:125-06L 125 06
125's:125-06XL 125 06
125's:125-06XXL 125 06
125's:125-05M 125 05
125's:125-05L 125 05
125's:125-05XL 125 05
125's:125-05XXL 125 05
. For example, the first shirt is style 100 (indicated by digits
nctions to extract the style, color, and size of each shirt.
concatenate for joining have to select one at a ti
concat select all together
Size textjoin join all together with deli
L L L L
XL XL concatenate
XL ********for
XL joining ****have to select one at a time****
XXL XXL XXL XXL
M M M M
L L L L
M M M M
L L L L
XL XL XL XL
XXL XXL XXL XXL
M M M M
L L L L
XL XL XL XL
XXL XXL XXL XXL
have to select one at a time
select all together
join all together with delimiter

to select one at a time********


Column B contains the names of several movies followed by the number of copies of the movie DVD purchase
movie from this data.

Movie Details
Seabiscuit 40 Seabiscuit 40 Seabiscuit
Laura Croft Tombraider 12 Laura Croft Tombraider 12 Laura
Raiders of the Lost Ark 36 Raiders of the Lost Ark 36 Raiders
Annie Hall 5 Annie Hall 5 Annie
Manhattan 4 Manhattan 4 Manhattan
Star Wars 112 Star Wars 112 Star
How to Deal 128 How to Deal 128 How
The Matrix Reloaded 1 The Matrix Reloaded 1 The
Johnny English 1040 Johnny English 1040 Johnny
Rosemary's Baby 12 Rosemary's Baby 12 Rosemary's
High Noon 1002 High Noon 1002 High

Seabiscuit 40 1 Seabiscuit*40
Laura Croft Tombraider 12 3 Laura Croft Tombraider*12
Raiders of the Lost Ark 36 5 Raiders of the Lost Ark*36
Annie Hall 5 2 Annie Hall*5
Manhattan 4 1 Manhattan*4
Star Wars 112 2 Star Wars*112
How to Deal 128 3 How to Deal*128
The Matrix Reloaded 1 3 The Matrix Reloaded*1
Johnny English 1040 2 Johnny English*1040
Rosemary's Baby 12 2 Rosemary's Baby*12
High Noon 1002 2 High Noon*1002
of copies of the movie DVD purchased by a local video store. Extract the title of each
e from this data.

No of spaces
Seabiscuit 40 1 Seabiscuit*40 Seabiscuit
Laura Croft Tombraider 12 3 Laura Croft Tombraider*12 Laura Croft Tombraider
Raiders of the Lost Ark 36 7 Raiders of the Lost Ark 36 #VALUE!
Annie Hall 5 2 Annie Hall*5 Annie Hall
Manhattan 4 1 Manhattan*4 Manhattan
Star Wars 112 2 Star Wars*112 Star Wars
How to Deal 128 3 How to Deal*128 How to Deal
The Matrix Reloaded 1 3 The Matrix Reloaded*1 The Matrix Reloaded
Johnny English 1040 2 Johnny English*1040 Johnny English
Rosemary's Baby 12 2 Rosemary's Baby*12 Rosemary's Baby
High Noon 1002 2 High Noon*1002 High Noon

Seabiscuit
Laura Croft Tombraider
Raiders of the Lost Ark
Annie Hall
Manhattan
Star Wars
How to Deal
The Matrix Reloaded
Johnny English
Rosemary's Baby
High Noon
find case sensitive
search not case sensitive
The table below gives the number of minutes played by five-player combinations (lineups). (Lineup 1
played 10.4 minutes, and so on.) Use text functions to put this data into a form suitable for numerical
calculations; for example, transform 10.4m into the number 10.4.

Lineups Time played Time Played (in Numericals)


1 10.4m 10.4
2 3.1m 3.1
3 .21m 0.21
4 12.43m 12.43
5 5.13m 5.13

6.254 6.254
(lineups). (Lineup 1
uitable for numerical
4.

10.4
3.1
21
12.43
5.13

52.06
Function Syntax

TODAY TODAY()

DAY DAY(date)
MONTH MONTH(date)
YEAR YEAR(date)

WEEKDAY WEEKDAY(date, [return_type])

DATE DATE(year,month,day

DATEDIF DATEDIF (start_date, end_date, unit)

DATEVALUE DATEVALUE (date_text)


WORKDAY WORKDAY (start_date, days, [holidays])
WORKDAY.INTL (start_date, days, [weekend],
WORKDAY.INTL
[holidays])
NETWORKDAYS (start_date, end_date,
NETWORKDAYS
[holidays])
NETWORKDAYS.I NETWORKDAYS.INTL (start_date, end_date,
NTL [weekend], [holidays])
Details

The TODAY function returns the current date, and will continually update each time the worksheet is updated

The DAY function returns the day value in a given date as a number between 1 to 31 from a given date.
The MONTH function extracts the month from a given date as a number between 1 to 12
The YEAR function extracts the year from a given date as a 4-digit number

The WEEKDAY function takes a date and returns a number between 1-7 representing the day of the week

The DATE function creates a date using individual year, month, and day arguments.

The DATEDIF function can calculate the time between a start_date and an end_date in years, months, or days.

Converts a date in the form of text to a serial number.


The Excel WORKDAY function takes a date and returns the nearest working day n days in the future or past.
Unlike the WORKDAY function, WORKDAY.INTL allows you to customize which days are considered weekends
(non-working days)
The NETWORKDAYS function returns the number of working days between two dates, automatically excluding
weekends (Saturday and Sunday) and optionally excluding holidays provided as a list of dates.
NETWORKDAYS.INTL provides a way to specify which days of the week are considered weekends.
Comments

Use F9 to force the worksheet to recalculate and update the value.

Return_type is an optional numeric code that controls which day of the week is considered the first
day. By default, WEEKDAY returns 1 for Sunday and 7 for Saturday. 1 for Sunday, 2 for Monday, etc.

unit list --> "y" Difference in complete years, "m" Difference in complete months, "d" Difference in
days, "md" Difference in days, ignoring months and years, "ym" Difference in months, ignoring
years, "yd" Difference in days, ignoring years

Holidays should be provided as a range that contains valid Excel dates. If holidays are not provided,
WORKDAY will treat only Saturdays and Sundays as non-working days.
1 or omitted Saturday, Sunday; 2 Sunday, Monday; 3 Monday, Tuesday, etc.

You might also like