DEC2HEX Function in ONLYOFFICE Spreadsheet Editor: Syntax, Examples and Troubleshooting
Learn DEC2HEX in ONLYOFFICE Spreadsheet Editor: convert decimal integers to hexadecimal digits, vendor syntax, reproducible spreadsheet examples, advanced uses, errors, version/locale caveats and official references.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
Quick answer
Represent a nonnegative decimal whole number using base-16 digits; the optional places argument pads shorter values with leading zeros. The formula is =DEC2HEX(number, [places]) according to the ONLYOFFICE DEC2HEX help article. All worked outputs below are mathematical expectations obtained independently; none is an observed result from a running copy of ONLYOFFICE.
What DEC2HEX does
Represent a nonnegative decimal whole number using base-16 digits; the optional places argument pads shorter values with leading zeros. Each hexadecimal position is worth a power of 16, counted from the right (1, 16, 256, …); letters A through F mean 10 through 15. The official function reference categorizes DEC2HEX as an engineering function.
This is a base conversion, not a change to a worksheet’s number formatting. Keep original values alongside their converted equivalents so readers can audit the conversion. The expected results are text-style base digits, not ordinary decimal numeric values. In the independent comparison, uppercase A–F is conventional for hexadecimal, but vendor output casing has not been natively checked.
Official syntax, argument order, types and defaults
=DEC2HEX(number, [places])
| Argument | Required? | Type/input | Default | Meaning and cautions |
|---|---|---|---|---|
number |
Required | Decimal numeric value / cell containing a number | — | This guide uses nonnegative whole numbers; the official help does not give a complete signed range. |
places |
Optional | Minimum number of hexadecimal digits displayed | Minimum number of digits when omitted | Use a positive whole-number width in the examples. |
The argument order is required number followed by optional places. The brackets around optional parameters in documentation are syntax notation; do not type square brackets into your worksheet. Exact source: ONLYOFFICE DEC2HEX function, checked 2026-10-13.
Use only small, nonnegative whole numbers in these examples; the official page does not establish the full signed input range. Decimal-base integers are not automatically binary or hexadecimal strings just because they contain digit characters. A quoted formula literal such as "1010" prevents loss of leading zeros in the expression; cell data may require Text formatting. Do not assume that text coercion, whitespace, lowercase input, signed encodings, or fractional inputs behave exactly like Excel or another editor.
Reproduce the worksheet step by step
- Open a blank spreadsheet in the editor you plan to support and create headers A1 = Use case, B1 = Input, C1 = Formula / result. Treat these columns as a self-contained audit worksheet.
- Enter B2:B17 as ordinary nonnegative integer values, not as quoted strings. For a fixed-width representation, add a separate width column and use the
placesargument as shown later. - Type the source values in column B exactly as shown. In C2, enter
=DEC2HEX(B2), and then fill down through C17. Verify the function name using the editor’s Formula tab, Insert Function dialog orShift+F3, as described in the official formula-entry guide. - Compare displayed values against the independent mathematical expectations below. Record the program edition, version, operating system and formula language if native results differ; this manuscript contains no native execution data.
- Keep the unconverted column unchanged so that original inputs remain available for comparison.
| Row | Use case (A) | Input (B) | Formula for C | Independent expected C |
|---|---|---|---|---|
| 2 | Zero | 0 (Number) |
=DEC2HEX(B2) |
0 |
| 3 | One | 1 (Number) |
=DEC2HEX(B3) |
1 |
| 4 | Nine | 9 (Number) |
=DEC2HEX(B4) |
9 |
| 5 | Ten | 10 (Number) |
=DEC2HEX(B5) |
A |
| 6 | Fifteen | 15 (Number) |
=DEC2HEX(B6) |
F |
| 7 | Sixteen | 16 (Number) |
=DEC2HEX(B7) |
10 |
| 8 | Twenty-six | 26 (Number) |
=DEC2HEX(B8) |
1A |
| 9 | Forty-two | 42 (Number) |
=DEC2HEX(B9) |
2A |
| 10 | Sixty-three | 63 (Number) |
=DEC2HEX(B10) |
3F |
| 11 | Sixty-four | 64 (Number) |
=DEC2HEX(B11) |
40 |
| 12 | One hundred twenty-seven | 127 (Number) |
=DEC2HEX(B12) |
7F |
| 13 | One hundred twenty-eight | 128 (Number) |
=DEC2HEX(B13) |
80 |
| 14 | Byte maximum | 255 (Number) |
=DEC2HEX(B14) |
FF |
| 15 | First value above byte | 256 (Number) |
=DEC2HEX(B15) |
100 |
| 16 | Mixed digits | 2748 (Number) |
=DEC2HEX(B16) |
ABC |
| 17 | Three-digit upper value | 4095 (Number) |
=DEC2HEX(B17) |
FFF |
Ready-to-paste formulas
The following use literal inputs rather than cell references. Quotes mark a base representation as text where applicable; the expected results are calculated independently using powers of the base.
| Formula | Independent expected result |
|---|---|
=DEC2HEX(0) |
0 |
=DEC2HEX(1) |
1 |
=DEC2HEX(9) |
9 |
=DEC2HEX(10) |
A |
=DEC2HEX(15) |
F |
=DEC2HEX(16) |
10 |
=DEC2HEX(26) |
1A |
=DEC2HEX(42) |
2A |
=DEC2HEX(63) |
3F |
=DEC2HEX(64) |
40 |
=DEC2HEX(127) |
7F |
=DEC2HEX(128) |
80 |
=DEC2HEX(255) |
FF |
=DEC2HEX(256) |
100 |
=DEC2HEX(2748) |
ABC |
=DEC2HEX(4095) |
FFF |
Mathematical verification method: For conversion to decimal, evaluate the position weights in base 2 or 16. For conversion from decimal, repeatedly divide by the target base and read remainders from right to left (or equivalently compute the exact integer base representation). For text width, add leading zeros without changing the magnitude. These are not tests executed by ONLYOFFICE.
Optional width: second argument (places)
The official help describes places as a display width; omitted means the minimum width. These examples use values for which the requested width can contain all digits. The zero padding is on the left, never on the right. The table is an independently calculated expectation, not proof of a particular edition’s padding behaviour.
| Decimal input | Places | Formula | Expected text-style representation |
|---|---|---|---|
| 0 | 2 | =DEC2HEX(0,2) |
00 |
| 10 | 2 | =DEC2HEX(10,2) |
0A |
| 15 | 2 | =DEC2HEX(15,2) |
0F |
| 16 | 4 | =DEC2HEX(16,4) |
0010 |
| 42 | 4 | =DEC2HEX(42,4) |
002A |
| 64 | 4 | =DEC2HEX(64,4) |
0040 |
| 127 | 4 | =DEC2HEX(127,4) |
007F |
| 255 | 4 | =DEC2HEX(255,4) |
00FF |
| 256 | 4 | =DEC2HEX(256,4) |
0100 |
| 4095 | 4 | =DEC2HEX(4095,4) |
0FFF |
If the chosen width cannot hold the conversion, do not assume a specific error code unless the version’s official documentation or native test establishes it. The vendor specifically confirms #NUM! for places <= 0; other width limits require testing.
Advanced applications and real-world interpretation
Encode an eight-bit colour channel
If B2 contains numeric 127, then =DEC2HEX(B2,2) independently represents that channel as 7F. Pad to two digits for channels 0–255; this is a numeric conversion, not validation of complete colour notation.
Use four-character diagnostic IDs
=DEC2HEX(42,4) has a mathematical output of 002A; =DEC2HEX(42) has minimal output 2A. The original decimal value is the same. A fixed-width ID may require leading zeros for visual consistency.
Round-trip to the original value
=HEX2DEC(DEC2HEX(255,4)) mathematically returns 255. Signed-number and maximum-width compatibility need separate testing; do not extrapolate from this small positive example.
Alternative BASE conversion
=BASE(255,16,4) mathematically formats the same value as 00FF, but BASE has its own documented range, radix and padding semantics. Its presence does not prove that DEC2HEX supports every BASE input.
Errors, edge cases and troubleshooting
| Symptom / diagnostic formula | Evidence-based explanation and action |
|---|---|
=DEC2HEX(15,0) |
#NUM! when places is zero; explicitly documented. |
=DEC2HEX(15,-1) |
#NUM! when places is negative; explicitly documented. |
| Formula name is not available | Check the function search under Formula > Insert Function for the installed edition; the current online help catalogue alone is not proof of support in an old build. See official function entry. |
| Formula is displayed instead of a computed value | Confirm the leading =, cell type and Show Formulas setting; use the editor’s Formula tab or the Function Arguments wizard. Vendor’s function-entry instructions. |
| Wrong zeros, unexpected text or unintended formatting | Confirm inputs were stored as intended, especially leading zeros; inspect quotes, numeric display format and the optional width, if applicable. Compare the underlying value separately from the displayed representation. |
| Locale-specific parsing or unknown function | The English examples use function names and commas from the official syntax entry; verify the installed formula language and regional separators under Advanced Settings. |
Do not infer undocumented limits. The current function page does not establish complete signed-number limits, truncation of fractional inputs, maximum width, case of output letters, or all too-small-places outcomes. Worked calculations use nonnegative integers and conventional uppercase hexadecimal representations; exact runtime rendering remains untested. If a value is outside the clearly covered range, record it as needs native validation, not as a verified ONLYOFFICE output or an assumed error message. Invalid input can produce different errors depending on the case; this guide only attributes #NUM! to cases that the vendor explicitly documents.
Compatibility, languages, versions and editions
- Current reference scope: The official English, unversioned ONLYOFFICE Spreadsheet Editor catalogue lists DEC2HEX. The Insert Function documentation explains both typing formulas and choosing them from the function wizard. This is documentation confirmation, not a runtime test.
- Web/Docs versions: The ONLYOFFICE Docs changelog lists Docs 10.0.0, released 2026-10-10. This is the release context checked on 2026-10-13; it does not prove DEC2HEX was introduced then, nor establish its first-supported version.
- Desktop versions: The distinct ONLYOFFICE Desktop Editors changelog lists Desktop 9.4.0, released 2026-05-19 at the time of research. Desktop and web deployment version numbers cannot be interchanged. This source does not establish this function’s first Desktop release.
- Historical releases and editions: No full historical execution matrix was available. Do not claim working support in older Docs/Desktop builds or specific editions without a vendor release note or directly recorded native test.
- Locale and syntax: The Advanced Settings instructions say formula language and regional settings are configurable. The function-entry guide uses English names and comma argument separators. Localized function names, decimal separators, accepted text coercions, and display formatting have not been checked in a live editor.
- Excel/Sheets/LibreOffice compatibility: This page makes no execution claim about those products. Their formats, sign rules, size limits and error behaviour cannot substitute for ONLYOFFICE verification.
Related functions and checked references
Related ONLYOFFICE function documentation: HEX2DEC, DEC2BIN, BASE, DECIMAL. These vendor links were individually opened/checked on 2026-10-13.
For a base-independent representation, ONLYOFFICE documents BASE (number, radix, optional minimum length). For reading a text numeral in a specified radix, it documents DECIMAL (text, radix). These are related mathematical tools, not proof that their parameter limits or sign conventions equal those of DEC2HEX.
Sources and verification
| Claim | Authoritative source | Verified on | Evidentiary limit |
|---|---|---|---|
| Function purpose, name and exact argument order | Official DEC2HEX reference | 2026-10-13 | Unversioned English documentation, not native testing |
Documented #NUM! conditions in the error table |
Official DEC2HEX reference | 2026-10-13 | Only its expressly described situations; no invented error matrix |
| Formula wizard, leading equals sign, example separator | Official Insert Function guide | 2026-10-13 | User-interface instructions, not a test of every locale |
| Formula language and regional display/input settings | Official Advanced Settings | 2026-10-13 | Configuration guidance; no localized runtime test |
| Docs 10.0.0 release date | Official Docs changelog | 2026-10-13 | Product release context only; not first function support |
| Desktop 9.4.0 release date | Official Desktop changelog | 2026-10-13 | Product release context only; not first function support |
| Numerical values throughout this page | Independent positional-value arithmetic and exact integer radix conversion | 2026-10-13 | Not results observed in ONLYOFFICE |
Verification limitations: Native execution in Desktop or Docs web, localized formula entry, quote/text coercion, signed boundaries and runtime error capture were not performed. Check these cases in the intended version before relying on them.