Zoho Sheet CODE Function: Syntax, Examples and Troubleshooting
Find the numeric code of the first character of a string and diagnose unexpected leading characters.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Zoho Sheet. How formula examples are checked
Zoho Sheet CODE Function: Syntax and Examples
Quick answer: =CODE("Zoho") returns 90, the numeric code for its first character Z. CODE examines only the first character, not all letters in a string, so it is particularly useful for diagnosing unexpected prefixes or leading spaces.
When CODE is useful
An imported identifier may start with a space, a punctuation symbol, or the wrong prefix. CODE gives you a numeric first-character indicator. Use it for lightweight checks on known ASCII data such as standard uppercase AβZ, but do not treat it as a complete Unicode validator or a data-cleaning function.
Exact Zoho syntax and argument
=CODE(text)
| Argument | Required? | Meaning |
|---|---|---|
text |
Yes | Text literal or a reference to a cell containing text. CODE reads its first character. |
Zoho says CODE returns a numeric character code in the 0β255 range. Its own examples include =CODE("%") β 37, =CODE("e") β 101, and =CODE("Zoho") β 90. These examples do not establish what CODE returns for every Unicode character, an empty string or the first character of an unformatted numeric value. Those cases remain native-test items.
Version, platform and locale scope
The syntax below is taken from Zoho Sheet’s current public English online function reference checked October 11, 2026. That reference does not identify the first Zoho release supporting this function or prove identical behaviour across historical releases, desktop wrappers, iOS, Android, or account configurations. No such first-supported version is claimed here. The published Zoho examples use semicolons (;) between arguments; syntax displayed by a localized application should be checked in its formula helper rather than copying separators from Excel. Zoho documents spreadsheet locale controls for number, date, currency, and decimal formats. Do not assume text that looks like a number will parse identically under all locales. Zoho locale settings.
Reproducible practice worksheet
Use a new Zoho Sheet spreadsheet. Create these six column headings in row 1, then enter the eight example rows. Select column E as text before entering values, because these are intentionally imported-looking numeric strings; a CSV import may otherwise turn them into numbers. Keep order identifiers in A as text. If importing the included CSV, inspect column types afterward and correct them before comparing formulas. The examples use fictitious records only.
| Row | A β Order_ID | B β First_Name | C β Last_Name | D β Quantity | E β Price_Text | F β Score |
|---|---|---|---|---|---|---|
| 2 | ORD-001 | Ada | Ng | 3 | 12 (text) |
4 |
| 3 | ORD-002 | Ben | Li | 2 | 7 (text) |
2 |
| 4 | ORD-003 | Cara | Moss | 5 | 0 (text) |
5 |
| 5 | ORD-004 | Dan | Ives | 1 | 19 (text) |
3 |
| 6 | ORD-005 | Eva | Chen | 4 | 6 (text) |
1 |
| 7 | ORD-006 | Finn | Yu | 2 | 14 (text) |
4 |
| 8 | ORD-007 | Gia | Ray | 6 | 3 (text) |
2 |
A formula such as =B2 references the first data row, not the header. Enter examples in blank cells, or create a separate Results sheet and select the sample cells to form explicit references. When copying a formula down, check the references advance to the correct rows. Set result cells to General where you want to see the returned value without extra display formatting.
Stepwise formulas and expected results
- Enter
=CODE("Zoho")in a free cell; expected 90 because the first character isZ, noto. - Enter
=CODE("%"); expected 37. - Enter
=CODE("e"); expected 101. - Enter
=CODE(B2); since B2 is Ada, expected 65 forA. - Enter
=CODE(B3); since B3 is Ben, expected 66 forB. - Enter
=CODE("Ada"); expected 65. A complete name does not change the fact that CODE returns only the first character’s code.
Advanced application: flag a known initial
Suppose a temporary import quality check should label records beginning with an ASCII uppercase A. Place this formula in a helper cell:
=IF(CODE(B2)=65;"A-initial";"Other")
For Ada (B2) the expected result is A-initial; changing the reference to B3 (Ben) gives Other. This is a narrow ASCII check: it is not a general case-insensitive comparison, and it should not be used to validate real people’s names. A value with an unwanted leading space will be classified differently; check the original source rather than silently trimming it unless that transformation is appropriate.
For a reversible sanity check within common ASCII: =CODE(CHAR(65)) is expected to yield 65. Avoid generalizing this round trip to undefined or extended character mappings.
Errors, limitations and troubleshooting
| Problem | Diagnostic reasoning | Suggested action |
|---|---|---|
| Initial not what you expected | Leading space or punctuation may be the actual first character | Inspect the cell and compare with a CLEAN/TRIM transformation in a separate cell if appropriate. |
#NAME! |
Formula name typo or invalid expression | Check spelling of CODE and references. |
#REF! |
Deleted or displaced source cell | Restore or reselect a valid source. |
#VALUE! or unexpected value |
Input may not be usable text | Test a known ASCII literal such as "A", then examine the source data type. |
| Code differs from another application | Character-set or platform assumptions | Restrict examples to common ASCII and test target environments. |
| You need to check the second character | CODE only reads the first character | Extract a different character first using a separately tested text function such as MID. |
Zoho documents the return code range of 0β255; this is not proof that every possible encoded character or emoji is representable. An empty text argument, multibyte Unicode, surrogate pairs and locale-specific behavior were not natively tested for this guide.
Cross-software compatibility
Excel’s CODE function also returns the code for the first character, but Microsoft notes that the underlying character set is the one used by the computer. This is a reason to be cautious with non-ASCII character codes during imports, especially when comparing Excel on different platforms with cloud spreadsheets. A familiar ASCII check (CODE("A") β 65) is appropriate for validating a straightforward example; matching symbols above 127 requires direct application testing. Google Sheets compatibility is not assumed for unsupported code ranges.
Quick questions
Does CODE convert all of Zoho into four numbers? No, it examines the first character and returns a single code.
What if a name starts with a space? The first character is then the space; confirm whether the space should be removed before applying CODE.
Can CODE compare names? It cannot compare entire strings. Use a comparison function for that purpose; CODE is a narrow first-character diagnostic.
Related function guides
- 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.
Official reference and verification
Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in Zoho Sheet.
- No genuine Zoho Sheet screenshots are included; this guide does not use mock application images.