Course 6 Text Functions
Course 6 Text Functions
Module : Informatique4
Course N° 6
Text functions
A text function is a function that has an alphanumeric value as a parameter or that
returns an alphanumeric value or both at the same time.
In practice, these text functions are applied to codes (exp: bank code, vehicle number,
bar code of a merchandise, etc.)
Please note: an alphanumeric code does not necessarily contain letters, for example:
0014536
1- The CONCATENATE function
Allows you to assemble several character chains to form only one.
Syntax: =CONCATENATE (text1; text2; ...) but also =Ref_cellule&Ref_cellule& …
The & sign is then called a concatenation operator.
Important: when merging cell contents, you must always think about space. This
must then appear between quotation marks.
Application :
A B
1 Nom Prénom
2 Youcefi Mohammed
… …
The formulas for Concatenate:
Possible formulas To insert a space To insert a comma
= CONCATENATE(A2;B2) = CONCATENATE(A2;" ";B2) = CONCATENATE(A2;" , " ;B2)
= A2&B2 = A2&" "&B2 = A2&" , "&B2
YoucefiMohammed Youcefi Mohammed Youcefi , Mohammed
Allows you to extract one or more characters from the middle of a text.
Syntax: MID (text; start_num; char_nbr)
•text: Represents the text containing the characters to extract.
•start_num: Represents the position in the text of the first character to extract.
•nbr_char: The number of characters to extract.
Example: Consider an array containing several character strings. Each character
string is built on an identical format. The goal is to extract the identifier indicated in
this character string. This information is located at the 31st character and consists of
four digits (Example for line 3: The identifier is 1587)
important: A space is considered a character.
code
Page : 2 / 4
6.The LEN function
Preview :
7. Text function
Converts a numeric value(number, date, time..) to text using a number format.
Syntax: =TEXT(value; text_format)
value: represents a numeric value, a
formula whose result is a numeric value, or
a reference to a cell containing a numeric
value.
text_format: is a numeric format in the
form of a text chain enclosed in quotation
marks.
Example :
8. REPT function
The REPT( ) function is used to repeat text or the contents of a cell a certain number of times.
Syntax: =REPT(text;Nbtimes)
• text: represents the text to repeat.
• Nbtimes: is a positive number indicating the number of repetitions.
So, REPT("A";5) returns the result AAAAA, or if the content of cell C2 is the
character A, REPT(C2;3) returns AAA.
Example
Page : 3 / 4
In this example we have codes in column C that must be completed with zero (0) so
that the complete code is 9 characters long:
TRADUCTION :
ENGLISH FRENCH
CONCATENATE CONCATENER
Left GAUCHE
Right DROITE
Upper MAGISCULE
Lower MINISCULE
PROPER NOMPROPRE
MID STXT
LEN NBCAR
Text TEXTE
REPT REPT
Page : 4 / 4