HEX2DEC in Collabora Office: Decode Hexadecimal Strings and Explain Their Sign Width
Decode hexadecimal text in Collabora Calc, verify byte fields and independently explain the full ten-character two-complement interpretation.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: HEX2DEC interprets a hexadecimal string as a number. =HEX2DEC("2A") has expected result 42. The cited section permits at most ten hexadecimal characters and documents two’s-complement input for negative values.
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 positional weights
=HEX2DEC(Number)
Number is a hexadecimal string. Use quoted constants or Text-formatted cells to make the representation explicit. The source’s own lowercase example, =HEX2DEC("6a"), returns 106.
Hex digits 0–9 have their usual values; A–F represent 10–15. Positions from right to left have weights 1, 16, 256, 4096 and so on. Thus 2A is 2×16+10=42, not a decimal number with a letter appended.
The sign convention refers to the most significant bit of the fixed-width representation. Ten hex characters span forty bits. Short strings such as the documented “6a” remain ordinary positive quantities; the negative models below use the complete ten-character width.
Example 1: decode a text column
Format A2:A7 as Text and enter these values. Put =HEX2DEC(A2) in B2 and fill down.
| Hex text | Independently expected number |
|---|---|
| 07 | 7 |
| 2A | 42 |
| 6a | 106 |
| B3 | 179 |
| 0100 | 256 |
| 1268FA | 1206522 |
For B3, compute 11×16+3=179. For 0100, the 1 occupies the 16^2 position, so the value is 256. The initial zero adds width, not value.
The strings 07 and 7 both represent 7. Preserve the source string if a later export must reproduce its leading zero. The decoded number alone cannot distinguish them.
Example 2: the forty-bit signed model
For a full ten-character representation with the highest bit set, two’s-complement decoding subtracts 2^40, or 1099511627776, from the unsigned positional value.
| String | Independently expected numeric result |
|---|---|
| FF | 255 |
| FFFFFFFF | 4294967295 |
| 7FFFFFFFFF | 549755813887 |
| 8000000000 | -549755813888 |
| FFFFFFFFD6 | -42 |
| FFFFFFFFFF | -1 |
These results are encoding-model consequences of the documented convention, not captured native boundary tests. The eight-character all-F string is positive under the forty-bit rule; it must not be silently interpreted using an external thirty-two-bit signed format.
The sign is not a separate minus character, and the remaining bits are not simply a positive magnitude to negate. The single high bit in 8000000000 gives the negative endpoint of the model.
Advanced example: unpack a six-character record
A specified record contains three unsigned byte fields. Enter 1268FA in E2 as text. Use:
=HEX2DEC(LEFT(E2;2))
=HEX2DEC(MID(E2;3;2))
=HEX2DEC(RIGHT(E2;2))
Expected values are 18, 104 and 250. If those outputs occupy F2:H2, then:
=F2*65536+G2*256+H2
Expected packed value: 1206522, agreeing with =HEX2DEC(E2). LEFT, MID and RIGHT implement the declared two-character boundaries.
This is a structural check for a six-character input. A shorter or longer record would not match the stated layout even if some substrings were individually valid hexadecimal.
Advanced check: reconstruct the representation
Using the three numeric fields above:
=DEC2HEX(F2;2)&DEC2HEX(G2;2)&DEC2HEX(H2;2)
Expected text: 1268FA. With fields 0, 7 and 15, the same pattern gives 00070F. Explicit two-character widths keep the boundaries intact.
DEC2HEX returns the reverse representation under its own documented rules. This round-trip verifies the small positive examples, not its unlisted admission limits.
Validation and display cautions
Only hexadecimal digits belong to the input model. Prefixes such as 0x or #, whitespace cleanup, empty strings and exact native errors are not established by this short section. Keep their acceptance unverified rather than applying another product’s parser behavior.
Large numeric results may need a wider column or an appropriate number format to display all digits. The exact integers above are independently calculated; visual rounding in a worksheet display is not itself proof of a changed stored value or of tested native precision.
References and verification
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.