BeginnerText Functions4 min10 points

Strip stray spaces from item codes with TRIM

The situation

Harbor Supply's new supplier sends item codes with spaces around them — a space before, two after, sometimes both. They look identical on screen, but a lookup against the product master fails on every padded one and the receiving team has been retyping them by hand. The codes need cleaning before anything else can use them.

A1
fx
Strip stray spaces from item codes with TRIM — question sheet. Use the arrow keys to move between cells, Enter or F2 to edit, Escape to cancel, Control D to fill down from the cell above, and Control C and Control V to copy and paste.
Row numberABCDE
1Raw codeClean code
2 HSC-04182
3HSC-77213
4 HSC-11904
5HSC-33027
6

Functions in this exercise

  • TRIM — Removes the spaces before and after text, and collapses repeated spaces inside it. Syntax and example

Who this is for