CODE
Supported, behaves as documentedCategory: Text · Last tested 2026-07-04
Support matrix
| Engine | Documented | Live-tested | Verdict |
|---|---|---|---|
| Excel | Yes | Not yet | n/a |
| Google Sheets | Yes | Not yet | n/a |
| LibreOffice Calc | Yes | Yes (24.2.7.2, 2026-07-04) | Supported, behaves as documented |
Executed test cases
LibreOffice Calc 24.2.7.2 (tested 2026-07-04)
| Formula | Description | Result | Expected | Verdict |
|---|---|---|---|---|
| =CODE("A") | Basic character-to-code lookup | 65 | 65 | Matched |
| =CODE("!") | Microsoft's own documented example | 33 | 33 Source: https://support.microsoft.com/en-us/office/code-function-c32b692b-2ed0-4a04-bdd9-75640144b928 |
Matched |
| =CODE("Apple") | CODE only looks at the first character of a multi-character string | 65 | 65 Microsoft docs: CODE "Returns a numeric code for the first character in a text string." Source: https://support.microsoft.com/en-us/office/code-function-c32b692b-2ed0-4a04-bdd9-75640144b928 |
Matched |
| =CODE(CHAR(97)) | CODE and CHAR are exact inverses of each other for values 1-255 | 97 | 97 | Matched |
Docs & syntax
- Excel: official documentation
- Google Sheets: official documentation
- LibreOffice Calc: official documentation