DEC2HEX in Collabora Office: Build Hexadecimal Labels with Explicit Field Widths
Convert numbers to padded hexadecimal strings in Collabora Calc, assemble independently checked byte fields and explain documented negative-width scope.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: DEC2HEX returns hexadecimal text for a number. With explicit padding, =DEC2HEX(42;4) has expected string 002A. Use the original numeric value for arithmetic and the generated string for a defined representation.
Availability and version history
- Introduced: the original Collabora release and launch date are not established by the reviewed sources.
- Availability: documented in Collabora Office 26.04 desktop help.
- Platform scope: online and mobile deployment support is not inferred from the desktop documentation.
- Checked: October 14, 2026. Function-specific documentation and independent controls; no native Collabora execution.
Syntax and the reference’s boundaries
=DEC2HEX(Number [; Places])
Number is the value to convert; Places is the number of output positions. The cited section marks Places optional but does not supply an omitted default, a full Number interval, fractional coercion rules or an error table.
For negative inputs, it explicitly describes a ten-character, forty-bit result with a sign bit. The companion HEX2DEC section documents two’s-complement input. This guide uses that paired convention for clearly labeled negative models and does not import Excel’s numeric admission limits into Collabora.
Hexadecimal digits A–F represent 10–15. Four binary bits correspond to one hexadecimal digit, so two hex characters can describe an unsigned byte value from 0 to 255.
Example 1: create aligned codes
Enter 0, 7, 42, 106 and 255 in A2:A6. In B2 enter =DEC2HEX(A2;2) and fill down.
| Number | Expected text |
|---|---|
| 0 | 00 |
| 7 | 07 |
| 42 | 2A |
| 106 | 6A |
| 255 | FF |
The independent positional checks are 2×16+10=42, 6×16+10=106 and 15×16+15=255. A and F are digits in base sixteen, not variable names.
In C2 put =HEX2DEC(B2) and fill down. The expected numbers recover the five original inputs. Retaining column A avoids relying on text labels for totals or numeric ordering.
Example 2: padding changes the representation
For the same value, compare:
=DEC2HEX(42;2)
=DEC2HEX(42;4)
=DEC2HEX(42;6)
Expected strings are 2A, 002A and 00002A. Each decodes to 42. The official source’s control =DEC2HEX(100;4) gives 0064, since 6×16+4=100.
A width is part of a data-format contract. If an external record requires four characters, removing leading zeros changes its representation even though its numeric value remains the same.
Advanced example: assemble three unsigned byte fields
A fictional record stores three byte-sized channels. Put 18, 104 and 250 in E2:G2, each constrained to an integer from 0 through 255.
=DEC2HEX(E2;2)&DEC2HEX(F2;2)&DEC2HEX(G2;2)
Expected six-character text: 1268FA. The independent packed numeric value is:
=E2*65536+F2*256+G2
Expected result: 1206522. =DEC2HEX(1206522;6) has the same expected text 1268FA. The positional weights are 16^4, 16^2 and 1.
For channels 0, 7 and 15, the same construction gives 00070F. Two-character padding preserves each boundary; concatenating unpadded descriptions would make it unclear where one field ended and the next began.
This example produces data text. It does not change cell colors or claim compatibility with an unspecified external format.
Negative values: an explicitly modeled encoding
Using the documented forty-bit negative width and the paired HEX2DEC two’s-complement convention, independent expected strings are:
| Number | Forty-bit model |
|---|---|
| -1 | FFFFFFFFFF |
| -2 | FFFFFFFFFE |
| -42 | FFFFFFFFD6 |
The model adds 2^40, or 1099511627776, before expressing the result in ten hex positions. For −42 the unsigned value is 1099511627734. A native run was not performed, and negative Places interactions remain unverified.
Do not substitute the short string FF for −1: the companion decoder’s full-width sign convention makes FF positive 255.
Common mistakes and remaining limits
Hexadecimal text 10 means decimal 16; text F means decimal 15. A text sort can therefore differ from numeric ordering. Decode deliberately when the quantity is what matters.
The sparse source does not establish all accepted numeric endpoints, minimal omitted width, fractional arguments, insufficient Places or exact native error codes. DEC2BIN has an explicitly documented smaller interval; that fact does not define DEC2HEX’s missing interval. Keep this guide’s explicit integer inputs and sufficient widths when reproducing its controls.
References and verification
- Collabora Office 26.04: DEC2HEX.
- Collabora Office 26.04: paired HEX2DEC signed-input convention.
- Editorial testing standards.
Complete function-specific documentation reviewed. Outputs are independently calculated positional models or explicitly documented controls, not captured native application results. Formulas use English names and semicolon separators; optional-argument brackets describe syntax and are not typed into a working formula.