TRIM in Zoho Sheet: text-cleaning and order ID examples
Normalize ordinary extra spaces around and inside imported customer names.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
=TRIM(B2) turns two leading spaces, East Depot and two trailing spaces into East Depot. Zoho’s TRIM removes extra spaces while retaining single spaces between words. Keep a helper column so the original text and the transformation remain visible.
Availability and version history
- Introduced: The original introduction release and date are not established by the checked official sources.
- Availability: Documented in Zoho Sheet’s current rolling web-service help; no final supported-version endpoint is established.
- Scope: English-language web documentation. Historical releases, mobile and offline-client parity remain separately unverified.
- Checked: October 14, 2026, against the official TRIM entry. Explicit text examples were independently calculated; no native Zoho Sheet execution was performed.
Syntax and the ordinary-space model
TRIM(text)
The official entry takes one text argument and describes retaining single spaces between words. Its literal example trims the padding around Hello!. These exercises use ordinary spaces; the short description does not define every Unicode whitespace class.
Enter the original eight order records
Create Orders, reserving A1:L12. Enter the field names in A1:C1 and the complete original data below in A2:C9. All three columns contain text. Each ␠ represents one ordinary space; type an actual space, not that visible symbol. No separate download is required.
| Row | A: Order_ID | B: Customer_Raw | C: Status |
|---|---|---|---|
| 2 | CA-2026-0041 | ␠␠East Depot␠␠ | Open |
| 3 | US-2026-0087 | West Market | Closed |
| 4 | CA-2026-0129 | ␠␠North Hub␠ | Open |
| 5 | GB-2026-1042 | South Shop | Hold |
| 6 | CA-2026-0205 | East Depot | Closed |
| 7 | US-2026-0130 | ␠␠West Market␠␠ | Open |
| 8 | CA-2026-0420 | Central Store | Hold |
| 9 | GB-2026-0011 | North Hub | Closed |
The first customer has two spaces at each edge. B4 has two leading spaces and one trailing space. Keep A:C unchanged while adding results to separate columns.
Fill a clean-name column and keep the original summary cells
Put Cleaned name in D1, Raw length in E1, Cleaned length in G1, Removed spaces in H1 and Unchanged in I1. Leave F for the separate original summary examples.
Enter D2 =TRIM(B2), E2 =LEN(B2), G2 =LEN(D2), H2 =E2-G2 and I2 =EXACT(B2;D2). Fill each formula separately down through row 9; do not fill a rectangular block over F.
| Row | D | E | G | H | I |
|---|---|---|---|---|---|
| 2 | East Depot | 14 | 10 | 4 | FALSE |
| 3 | West Market | 11 | 11 | 0 | TRUE |
| 4 | North Hub | 12 | 9 | 3 | FALSE |
| 5 | South Shop | 10 | 10 | 0 | TRUE |
| 6 | East Depot | 10 | 10 | 0 | TRUE |
| 7 | West Market | 15 | 11 | 4 | FALSE |
| 8 | Central Store | 13 | 13 | 0 | TRUE |
| 9 | North Hub | 9 | 9 | 0 | TRUE |
LEN exposes changes that may be hard to see. EXACT compares the original and cleaned text, rather than merely comparing their displayed width.
Enter the original summary and literal checks in these separate cells:
| Cell | Formula | Expected result |
|---|---|---|
| F2 | =COUNTIF(D2:D9;"East Depot") |
2 |
| F3 | =IF(TRIM(B2)="East Depot";"Match";"Different") |
Match |
| F4 | =TRIM(" West Market ") |
West Market |
| F5 | =TRIM(" Hello! ") |
Hello! |
COUNTIF counts the two normalized East Depot entries. Matching display names are not sufficient evidence that two orders belong to the same person; retain the order IDs and any appropriate business key.
Advanced: distinguish removable padding from meaningful separation
Create SpacingPolicy, reserving A1:F8. Put Original, Trimmed, Raw length, Trimmed length, Removed and Unchanged in A1:F1. Enter these explicit formulas in A2:A5:
- A2:
=" East Depot " - A3:
="East Depot" - A4:
="EastDepot" - A5:
=" "
Enter B2 =TRIM(A2), C2 =LEN(A2), D2 =LEN(B2), E2 =C2-D2 and F2 =EXACT(A2;B2). Fill B2:F2 through row 5.
| Row | B | C | D | E | F |
|---|---|---|---|---|---|
| 2 | East Depot | 13 | 10 | 3 | FALSE |
| 3 | East Depot | 10 | 10 | 0 | TRUE |
| 4 | EastDepot | 9 | 9 | 0 | TRUE |
| 5 | empty text | 3 | 0 | 3 | FALSE |
TRIM compresses extra separators but does not insert the missing separator in EastDepot. B7 =EXACT(B2;B3) is TRUE, while C7 =EXACT(B3;B4) is FALSE. D7 =EXACT(A2;A3) is FALSE because the two original strings differ.
The zero-length result in B5 is a formula result, not a physically cleared cell. A later blank-counting rule may need to distinguish those states.
Case changes belong to the comparison policy
Copy SpacingPolicy as CasePolicy and change only A3 to east depot. B3 remains lowercase east depot: TRIM has not capitalized it. B7 becomes FALSE, C7 remains FALSE and D7 remains FALSE.
Put =COUNTIF(B2:B4;"East Depot") in E7 for the expected result 2. Zoho’s COUNTIF reference explicitly makes that comparison case-insensitive. The count therefore includes East Depot and east depot, while EXACT still distinguishes them. Attribute the matching rule to the function performing the comparison, not to TRIM.
Internal spaces may be meaningful in fixed-width records, identifiers or other structured fields. Do not apply this cleanup blindly. CLEAN removes a different documented class of ASCII controls; it is not a universal replacement for a whitespace policy.
Errors, imports and text boundaries
Use straight quotation marks around formula literals and Zoho’s documented semicolon separator in multi-argument formulas. The one-argument function itself needs no separator. A copied formula must still point to the intended source row.
The entry’s shared error table includes generic name, reference and argument-type messages. It does not establish an exact result for every blank, numeric, date, array or error input. These exercises use explicit ASCII strings; Unicode normalization, emoji counting, unusual whitespace and cross-client import behavior remain separately unverified. Isolate a mismatch with the direct literal example before changing the underlying records.