Contact

CODE in Collabora Office: Inspect the First Character Without Mistaking It for a Whole-Text Test

Text Intermediate Collabora Office Calc

Use Collabora CODE to diagnose a leading space or case difference, with character-table cautions and complete helper-column examples.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: CODE returns the code of the first character in a text string. =CODE("Hieronymus") returns 72, while =CODE("hieroglyphic") returns 104 in Collabora’s examples. The different initial case changes the code.

Availability and version history

  • Introduced: original Collabora release and launch date are not established by the sources reviewed.
  • Availability: documented in Collabora Office 26.04 help, scoped to the desktop-help release.
  • Platform scope: online and mobile deployments are not inferred from desktop documentation.
  • Checked: October 14, 2026. Direct function documentation and independently modeled text controls; no native Collabora test was performed.

Syntax and scope

=CODE(text)

Supply quoted literal text or a reference to a text cell. Only the first character is inspected; the rest of the string does not become a checksum. The result uses the current character table, and the vendor warns that codes above 127 may vary with the system mapping.

Examples use English names and semicolon separators in nested formulas. Their ordinary Latin-character expectations do not certify every script, Unicode sequence or extended code page.

Example 1: separate first-character identity from full identity

Enter these strings as text in A2:A5: Gate, Grove, gate, and ** Gate** with one leading ordinary space. Fill =CODE(A2) down in B2:B5.

Expected codes: 71, 71, 103, 32. Gate and Grove share a first letter, so their CODE results match despite the different words. The final input begins with a space; its first visible letter is not the first stored character.

For a full case-sensitive text comparison, use EXACT. Equal CODE outputs prove much less than equal strings.

Example 2: locate a leading-space import problem

Construct the source rather than relying on a pasted invisible prefix:

=CHAR(32)&"Lot-7"

If that formula is in D2, =CODE(D2) is expected to give 32, and =LEN(D2) gives 6. The five-character label has gained one leading space. CHAR makes the input reproducible without assuming that a web editor preserves leading whitespace.

Now =CODE(MID(D2;2;1)) is expected to give 76, the code for L in the same mapping. This targets the second character explicitly; CODE alone would continue to inspect the space.

Advanced example: audit every position of a short label

Use the literal source Ab-7 in H2. Put positions 1, 2, 3, 4 in J2:J5. In K2 enter and fill down:

=CODE(MID($H$2;J2;1))

Expected sequence: 65, 98, 45, 55. MID extracts one character at each selected position before CODE classifies it. Every position is inside the known string; no empty extraction is used.

A separate =CHAR(K2) filled down reconstructs the four characters A, b, -, 7 under the same table. Keep the position column in order if you later combine them. The test is an inspection tool, not encryption or a unique representation independent of the character table.

Advanced check: catch an insufficient validation rule

The first characters of A-17, A-18 and A-X9 all have expected code 65. A rule accepting a label merely because its CODE is 65 therefore accepts all three, including the one with a nonnumeric suffix.

Validate the rest of an identifier separately according to its specification. Inspecting one prefix character cannot establish length, suffix format, uniqueness or whether a record exists.

Practical cautions

The dedicated help does not establish the empty-string error, arbitrary nontext coercion or every extended character mapping. This guide deliberately uses nonempty ordinary text and known positions. Avoid claiming that CODE always equals a Unicode scalar value, a UTF-8 byte or a locale-independent file encoding identifier. Those are different concepts and require their own evidence.

References and verification

The dedicated Collabora function page was reviewed. Expected outputs are independently modeled text controls, not captured results from the application. Extended-character, coercion and deployment-specific behavior retain the limits stated above.