← All functions

CODE

Supported, behaves as documented

Category: Text · Last tested 2026-08-06

Real, executed compatibility results for the CODE function across Microsoft Excel, Google Sheets, and LibreOffice Calc — verified by actually running it. Syntax and links to each vendor’s official documentation are below.

Support matrix

EngineDocumentedLive-testedVerdict
Excel Yes Not yet n/a
Google Sheets Yes Not yet n/a
LibreOffice Calc Yes Yes (25.8.7.3, 2026-08-06) Supported, behaves as documented

LibreOffice version history

We executed the same test cases under each LibreOffice release to show exactly when CODE’s support changed — not documentation claims, real results.

LibreOffice versionVerdictTested
24.2.0.3 Supported, behaves as documented 2026-07-19
24.8.7.2 Supported, behaves as documented 2026-07-19
25.2.0.3 Supported, behaves as documented 2026-07-24
25.8.7.3 Supported, behaves as documented 2026-08-06

Executed test cases

LibreOffice Calc 25.8.7.3 (tested 2026-08-06)

FormulaDescriptionResultExpectedVerdict
=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

Compared against other functions