HEX2OCT in Collabora Office: Translate Hexadecimal Records into Padded Octal Text
Translate hexadecimal strings to octal in Collabora Calc, preserve explicit widths and check conversions through independent positional arithmetic.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: HEX2OCT returns an octal string for a hexadecimal input. The documented control =HEX2OCT("6a";4) returns 0152, representing the number 106.
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 clearly bounded inputs
=HEX2OCT(Number [; Places])
Number is a hexadecimal string with a maximum of ten characters. The source documents a sign bit and two’s-complement input for negative values. Places is optional and identifies the number of output positions.
The reference does not state the omitted Places default, all numeric conversion limits, negative output width or exact native errors. These examples use small positive strings and sufficient explicit integer widths. A maximum input length is not a promise that every possible value fits an unspecified destination format.
Hexadecimal groups four binary bits per digit; octal groups three. Their boundaries therefore do not generally align digit for digit. Conversion preserves a quantity rather than replacing each hexadecimal character with one octal character.
Example 1: translate a small import
Enter these strings in Text-formatted A2:A6. Use =HEX2OCT(A2;4) in B2 and fill through B6.
| Hexadecimal text | Expected octal text | Decimal control |
|---|---|---|
| 07 | 0007 | 7 |
| 2A | 0052 | 42 |
| 6a | 0152 | 106 |
| B3 | 0263 | 179 |
| FF | 0377 | 255 |
For 6a, hex 6×16+10=106 and octal 1×64+5×8+2=106. That independent arithmetic explains the source’s result.
For B3, hex 11×16+3=179. Octal 263 represents 2×64+6×8+3=179. Converting B to one octal digit would be impossible because octal has no digit for eleven.
Example 2: output width is a representation choice
For the same positive quantity:
=HEX2OCT("2A";2)
=HEX2OCT("2A";4)
=HEX2OCT("2A";6)
Expected text is 52, 0052 and 000052. Every output describes 42. The extra zeros satisfy explicit display or record requirements; they do not add numeric precision.
Keep the requested width with the file specification. If only the decoded number 42 is retained, the original padding cannot be recovered automatically.
Advanced example: convert a complete two-byte quantity
Enter hexadecimal text 012A in E2. It represents 1×256+2×16+10=298.
=HEX2OCT(E2;4)
=HEX2DEC(E2)
Expected outputs are text 0452 and number 298. The octal check is 4×64+5×8+2=298.
Do not convert the two byte fields independently and concatenate their octal outputs as if that were the same operation. Converting hex 01 and 2A separately to width 3 gives 001 and 052; concatenation produces 001052, whose octal value is 554. The byte boundary has weight 256, while a three-octal-digit boundary has weight 512.
This counterexample explains why a representation change must respect the external field layout. If the two bytes are genuinely independent fields, retain them as separate fields rather than treating their concatenation as one converted quantity.
Advanced check: use a common numeric interpretation
For the first table, put =HEX2DEC(A2) in C2 and =OCT2DEC(B2) in D2, then fill both through row 6. Expected sequences are 7, 42, 106, 179 and 255 in both columns.
A rowwise comparison =C2=D2 has independently modeled result TRUE. HEX2DEC and OCT2DEC provide the distinct decoding steps. This verifies the explicit examples, not every input a production parser might encounter.
Remaining boundaries
Store the hexadecimal input as text before entry when leading zeros matter. Use quoted strings in formulas; a bare token containing a letter is not an ordinary decimal constant.
Negative inputs, destination overflow, omitted width, fractional Places, invalid digits and exact native error codes remain unverified by this sparse section. Do not borrow Excel’s forty-bit or thirty-bit admission error tables simply because the conversion name matches. The tutorial’s complete positive fixtures avoid those assumptions while showing both successful conversions and a field-boundary counterexample.
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.