Contact

Zoho Sheet CODE Function: Syntax, Examples and Troubleshooting

Text Beginner Zoho Sheet

Find the numeric code of the first character of a string and diagnose unexpected leading characters.

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

=CODE("Zoho") returns 90, the code for the first character Z. CODE reads one initial character; it does not convert the whole string into a list of codes or compare complete names.

Availability and version history

  • Introduced: The original introduction release and date are not established by the checked 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 CODE entry. Explicit string and arithmetic examples were independently calculated; no native Zoho Sheet execution was performed.

Syntax and character-set scope

CODE(text)

The official CODE entry describes a return range of 0–255. Its examples give % → 37, e → 101 and Zoho → 90. Empty text, numeric coercion and arbitrary Unicode mappings are not defined by those three examples.

The remaining basic printable codes below are independently checked against the ASCII table. This limits the model to familiar ASCII characters rather than assuming that every extended symbol behaves identically across platforms.

Rebuild the original seven records

Create InitialCodes, reserving A1:L10. Enter the seven original records below in A2:F8, with the six headings in A1:F1. A, B, C and E contain text; D and F contain numbers. To make E’s type explicit, enter E2:E8 as ="12", ="7", ="0", ="19", ="6", ="14" and ="3". Keep result cells in General format. These fictitious records are fully supplied here; no separate download is required.

Row A: Order_ID B: First_Name C: Last_Name D: Quantity E: Price_Text F: Score
2 ORD-001 Ada Ng 3 12 4
3 ORD-002 Ben Li 2 7 2
4 ORD-003 Cara Moss 5 0 5
5 ORD-004 Dan Ives 1 19 3
6 ORD-005 Eva Chen 4 6 1
7 ORD-006 Finn Yu 2 14 4
8 ORD-007 Gia Ray 6 3 2

Enter G2:J2 and fill through row 8:

G2: =CODE(B2)
H2: =IF(G2=65;"A-initial";"Other")
I2: =CHAR(G2)
J2: =LEN(B2)
Row G: First-character code H: Explicit policy I: First character J: Name length
2 65 A-initial A 3
3 66 Other B 3
4 67 Other C 4
5 68 Other D 3
6 69 Other E 3
7 70 Other F 4
8 71 Other G 3

The policy checks uppercase ASCII A only. It is not a rule for validating names, case-insensitive matching or deciding whether two people are the same.

Keep the original literal cases in L2:L8: =CODE("Zoho"), =CODE("%"), =CODE("e"), =CODE(B2), =CODE(B3), =CODE("Ada") and =CODE(CHAR(65)). Their expected outputs are 90,37,101,65,66,65,65.

Duplicate InitialCodes as ChangedInitial and change only B2 from Ada to Zoe. G2 becomes 90, H2 Other, I2 Z, and J2 remains 3. L5 changes to 90 because it references B2; L7 stays 65 because it contains literal Ada. The other records remain unchanged.

A leading space and a matching initial mean different things

Create InitialPolicy, with A1:G6. Enter A2:A6 using formulas ="Ada", ="Alan", ="ada", =" Ada" and ="Ada " so the two space cases are unambiguous. Enter B2:G2 and fill through row 6:

B2: =CODE(A2)
C2: =B2=65
D2: =EXACT(A2;"Ada")
E2: =LEN(A2)
F2: =TRIM(A2)
G2: =EXACT(F2;"Ada")
Row B C D E F G
2 65 TRUE TRUE 3 Ada TRUE
3 65 TRUE FALSE 4 Alan FALSE
4 97 FALSE FALSE 3 ada FALSE
5 32 FALSE FALSE 4 Ada TRUE
6 65 TRUE FALSE 4 Ada TRUE

Alan and Ada have the same first-character code but differ as whole strings. A trailing space leaves that first code unchanged, while a leading space becomes the first character. TRIM is a separate cleanup policy; F preserves the original A values for comparison. EXACT then checks the whole cleaned text.

Advanced: inspect each position explicitly

Create CodePositions, reserving A1:F8. Enter AZ-104 in A2. Enter positions 1,2,3,4,5,6 in B2:B7. Put C2:F2 below and fill through row 7:

C2: =MID($A$2;B2;1)
D2: =CODE(C2)
E2: =CHAR(D2)
F2: =EXACT(C2;E2)

C and E should be A,Z,-,1,0,4. D should be 65,90,45,49,48,52, and F TRUE throughout. MID selects a one-character string before CODE reads its first character. The zero in position 5 is text, with code 48; it is not numeric code 0.

Duplicate CodePositions as ChangedCode and change A2 to AZ-204. Only the fourth-position result, worksheet row 5, changes: C5/E5 become text 2, D5 becomes 50, and F5 stays TRUE. This is a position-by-position check, not a checksum or proof of authenticity.

Boundaries and Excel comparison

All selected strings are nonempty. The reference does not establish the exact empty-string result, extended-code mapping, surrogate behavior or imported numeric conversion. If an actual input fails, inspect its type and first character before substituting a fallback code.

Excel’s CODE reference explicitly ties its result to the computer’s character set. Matching the selected ASCII examples does not prove cross-software equality for codes above 127. CHAR is the reverse-direction helper for these specific inputs, not an interchangeable alias or a guarantee of arbitrary Unicode round trips.

The one-argument CODE call needs no separator. Its nested multi-argument helpers follow Zoho’s semicolon notation; use the local formula editor’s syntax when required.

  • CONCATENATE — join several text values.
  • REPT — repeat text without building a string manually.
  • CHAR — get a character from its numeric code.
  • CODE — inspect the first character’s code.
  • VALUE — convert text representing a number into a numeric result.
  • LEFT, LEN, TEXTJOIN, and TRIM — related text tools under review.