The book: files and exercises · Lesson 10 of 24

Lesson 10 exercises: text functions

Four exercises on text functions with the item list in lesson10.xlsx: remove extra spaces, fix the capitals, count characters, pull the year out of a code and build a label. Type the formula in the fx bar and the sheet checks it right away.

Lesson 10. Text functions: clean up names, remove spaces, join and split text

Use the file lesson10.xlsx, Exercises sheet.

Files: lesson10.xlsx · solutions: lesson10-solutions.xlsx.

In the exercises with a sheet, type the formula in the fx bar and click Check: the sheet works it out the way Excel does, with commas between the arguments (semicolons work too), and also tries it with other data, to see whether it still works when the data changes. In the other exercises, you work in Excel with the lesson's file and type the result here.

At the end of the page you'll find the lesson's Bonus challenge: one more exercise, whose answer isn't in the book. You check it only here.

Exercise 1

In C4, type a formula that removes the extra spaces from the description in B4 and capitalizes the first letter of each word. Copy it down to C9. What does C5 show?
In cell C4 (the check copies the formula down to C9, like the fill handle)
fx
What does C5 show?
Show the answer

=PROPER(TRIM(B4)); C5 shows Oak Table.

Exercise 2

In two empty cells, calculate the length of B4 and of C4. How many characters did the formula remove, and why?
In F4, the length of B4
fx
In F5, the length of C4
fx
How many characters did the formula remove?
Why?
Show the answer

=LEN(B4) = 19, =LEN(C4) = 15: the formula removed 4 spaces, the 2 at the start and 2 of the 3 between "ergonomic" and "chair."

Exercise 3

The item code looks like CHR-2025-014: category, year, number. Pull out the year in D4 and copy it down to D9. Which item is from 2023?
In cell D4 (the check copies the formula down to D9, like the fill handle)
fx
Which item is from 2023?
Show the answer

=MID(A4,5,4) (here the category has 3 letters, so the year starts at character 5): the item from 2023 is the bookcase (BKC-2023-051).

Exercise 4

In E4, build a label of the form "Clean description (Code)", with the description from column C, a space, and the code in parentheses. Copy it down to E9. What does E8 show?
In cell E4 (the check copies the formula down to E9, like the fill handle)
fx
What does E8 show?
Show the answer

=C4&" ("&A4&")" or =CONCAT(C4," (",A4,")"); E8 shows Braided Rug (RUG-2025-120).

Bonus challenge

The answer isn't in the book: you check it only here.

Exercises sheet: the store wants a short code without the year: CHR-2025-014 becomes CHR014. In G4, type a formula that builds it from the code in A4, and copy it down to G9. What is the short code of the sofa?
In cell G4 (the check copies the formula down to G9, like the fill handle)
fx
What is the short code of the sofa?
Show the answer

=LEFT(A4,3)&RIGHT(A4,3), copied down to G9 (or =CONCAT(LEFT(A4,3),RIGHT(A4,3))). LEFT takes the 3 letters of the category, RIGHT takes the last 3 digits, and & joins them. The sofa, SOF-2024-033, becomes SOF033. Watch out for RIGHT(A4,4): it takes the hyphen too and gives SOF-033.