☰ Contents · Computing

Text and logical functions

Lessons 9–10 · 2 lessons · N. I. Taylaqov (general editor), A. B. Akhmedov, M. D. Pardayeva, A. A. Abdug‘aniyev, U. M. Mirsanov. Informatics and Information Technologies, Grade 10, 1st edition. “Extremum-Press”, Tashkent, 2017
9

Text functions

Textbook: pp. 25–26
GoalWorks with text using the text functions LEN, &, CONCATENATE, REPT, REPLACE, TEXT and VALUE.
New words
text string: characters in quotation marks, for example "Ali" · matn satriconcatenation: the & operator joins pieces of text into one · birlashtirish (&)LEN: counts the characters in a text, spaces included · LENVALUE: converts a text that looks like a number into a real number · VALUE
Explanation

In Excel text takes part in formulas just like numbers: a text string is put in double quotation marks. LEN(text) counts the characters, and spaces count too. To join texts the & operator is used: =A1&" "&B1; CONCATENATE(text1, text2, …) does the same, and newer Excel also has CONCAT and TEXTJOIN. REPT(text, n) repeats a text n times. REPLACE(old_text, start, number_of_characters, new_text) replaces the given part of a string. TEXT(value, format) turns a number into text in the given form, for example TEXT(7,"000") = “007”; VALUE(text) turns a text that looks like a number back into a number. A number stored as text is ignored by the SUM function, which is why VALUE is useful. When you practise with lists, use invented names: do not put the personal data of real people into shared tables.

Worked examples
A1 holds “Aziza” and B1 holds “Karimova”. =A1&" "&B1 gives “Aziza Karimova”, while =CONCATENATE(B1,", ",A1) gives “Karimova, Aziza”. A space is also text, so it must be written inside quotation marks.
=LEN("Informatika") = 11; =REPT("*",5) = “*****”; =REPLACE("Tashkent-5",10,1,"7") = “Tashkent-7” (the 10th character was replaced); =TEXT(7,"000") = “007”; =VALUE("45")+5 = 50.
Class activity

“The text builder”: each pair writes an invented surname, first name and class in three cells and builds an entry such as “Surname I., class” with one formula; a neighbouring pair checks the result.

Practice
1
What is the result of =LEN("Informatika")?
2
What text does =REPT("ab",3) give?
3
A2 holds a first name and B2 a surname. Write a formula that joins them as “Surname Name” with a space.
4
Why is VALUE needed for the number 45 stored as text?