Contact

HEX2DEC in WPS Spreadsheet: Decode Hex Records and Keep Their Signed Width Visible

Engineering Intermediate WPS Spreadsheet

Decode hexadecimal strings in WPS Spreadsheet, inspect explicit byte fields and verify the documented forty-bit signed convention with independent controls.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: HEX2DEC converts a hexadecimal representation into its numeric value. For example, =HEX2DEC("A5") has independently expected result 165. The historical WPS lesson documents a maximum of ten hex characters and two’s-complement negative input.

Availability and version history

  • Introduced: documented by 2019-08-19 in the official WPS lesson; the first release is not established.
  • Availability: the lesson labels Windows Personal and explicitly demonstrates WPS 2019.
  • Scope: exact current supported builds and other WPS clients remain unverified.
  • Checked: October 14, 2026. Documentation and independent calculations; no native WPS execution.

Syntax and source scope

=HEX2DEC(number)

Hexadecimal uses digits 0–9 and letters A–F, representing values 10–15. Ten hex characters correspond to forty binary bits. The source identifies the highest bit as the sign bit and describes negative numbers using two’s complement.

The official Academy walkthrough explicitly demonstrates WPS 2019 and labels its edition WPS Office for Windows Personal. That proves use in the documented historical environment, not the first introduction release or the limits of every current WPS client.

Use quoted constants or input cells formatted as Text before entry. The worked strings use uppercase hex letters; general case-insensitive parsing, whitespace and prefix acceptance are not separately established here.

Example 1: decode a clearly labeled text column

Enter only the first column below in Text-formatted A2:A7. Put =HEX2DEC(A2) in B2 and fill down. The second column shows expected output.

A, hexadecimal text B, expected numeric value
05 5
25 37
49 73
A5 165
12C 300
0100 256

For A5, the calculation is 10×16+5=165. For 12C, it is 1×256+2×16+12=300. Hex text 25 means 37, not decimal 25.

Strings 05 and 5 both describe the number 5. Retain the original text when its width matters to an external record; decoding does not preserve how many leading zeros were present.

Example 2: interpret the full forty-bit sign convention

The independent two’s-complement model subtracts 1099511627776, or 2^40, when the highest bit is set in a complete ten-character representation.

Input Independently expected number
FF 255
FFFFFFFF 4294967295
7FFFFFFFFF 549755813887
8000000000 -549755813888
FFFFFFFFFB -5
FFFFFFFFFF -1

These are positional consequences of the documented convention, not native WPS boundary captures. The short FF and eight-character all-F strings are positive under the forty-bit format. A separate signed-byte or signed-thirty-two-bit file convention would require a different interpretation.

The sign bit is not a minus character followed by an ordinary magnitude. In particular, 8000000000 represents the negative endpoint of this encoding model, not negative zero.

Advanced example: unpack three explicit byte fields

A record specification defines six hex characters as three two-character fields. Enter 2549A5 in E2 as text. Use:

=HEX2DEC(LEFT(E2,2))
=HEX2DEC(MID(E2,3,2))
=HEX2DEC(RIGHT(E2,2))

Expected outputs are 37, 73 and 165. If they occupy F2:H2, the complete positional value is:

=F2*65536+G2*256+H2

Expected result: 2443685, matching =HEX2DEC(E2). LEFT, MID and RIGHT use the declared field boundaries.

The sum of the three independent field values is 275, which is a different quantity from the packed record. Decide whether the application needs individual fields or the whole encoded number before aggregating.

Advanced check: compare two bases without comparing their text

Hexadecimal A5 and octal 245 both represent 165:

=HEX2DEC("A5")
=OCT2DEC("245")

The second result follows 2×64+4×8+5=165. OCT2DEC uses a different input alphabet and signed width. The check deliberately chooses a small positive quantity that fits both.

Invalid input and display limits

The lesson documents #NUM! for an invalid hexadecimal number. A constant such as “G5” is outside the hex alphabet; silently replacing that error with zero would hide an invalid record because zero is itself a valid quantity.

More than ten characters exceeds the stated contract. Exact errors for every excessive-length, mixed-type or competing-invalid-input case remain unverified. Large values may require a wider column or a number format showing all digits; a rounded display is not a native precision test.

Preserve the source, base and intended signed width alongside every decoded result. All worked outputs here are independently calculated from the documented rules.

References and verification

Complete function-specific documentation reviewed. Worked outputs are independently calculated expectations, not captured native results. Formulas use English names and comma separators; check the installed locale. Product/client and source gaps retain their explicit scope.