Contact

HEX2BIN in WPS Spreadsheet: Respect the Narrow Binary Target When Converting Hex

Engineering Intermediate WPS Spreadsheet

Convert hex strings to binary in WPS Spreadsheet, verify padding and distinguish the forty-bit source convention from the ten-bit target interval.

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

Quick answer: HEX2BIN converts hexadecimal notation into a binary representation. Its documented positive limit 1FF and negative limit FFFFFFFE00 correspond to quantities 511 and −512; not every valid hexadecimal value fits this binary target.

Availability and version history

  • Introduced: documented by 2019-05-30 in the official WPS lesson; the first release is not established.
  • Availability: Current WPS Windows documentation confirms this function. The historical lesson’s edition field is blank.
  • 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 optional width

=HEX2BIN(number,[places])

The source permits at most ten hexadecimal input characters and correctly describes forty bits, including one sign bit and thirty-nine remaining bits. Negative inputs use two’s complement.

Although the printed signature does not bracket places, both the definition and WPS walkthrough explicitly allow omission. Omitted places uses the shortest representation; larger places pads with leading zeros. A negative input ignores places and returns ten binary characters.

The historical edition field is blank. Current official Windows documentation separately confirms the function’s identity, without specifying a first release or minimum supported build.

Example 1: inspect small positive hex fields

Enter only the first column below as Text in A2:A6. Put =HEX2BIN(A2,8) in B2 and fill down.

A, hexadecimal B, expected eight-bit text
05 00000101
25 00100101
49 01001001
A5 10100101
FF 11111111

The corresponding numbers are 5, 37, 73, 165 and 255. These decimal values are explanatory checks, not an extra input column.

Hex A5 consists of digit values 10 and 5. Their four-bit groups are 1010 and 0101, giving 10100101. The leading zero in 05 preserves a two-character hex field; its binary output is explicitly padded to eight positions.

Example 2: make the target limit visible

=HEX2BIN("1FF",10)

The independently expected output is 0111111111, representing 511. Hex 200 represents 512 and lies above the lesson’s positive conversion limit.

A larger places request does not select a different numeric target. The WPS reference states the allowed endpoints but does not give an exact native error for every out-of-range case, so that error code remains unverified here.

HEX2DEC can decode the larger hex quantity under its own wider representation contract. That does not prove HEX2BIN can produce a binary string for it.

Advanced example: convert negative quantities across widths

Hex input Signed quantity Expected binary
FFFFFFFFFF -1 1111111111
FFFFFFFFFB -5 1111111011
FFFFFFFE00 -512 1000000000

The source’s forty-bit negative representation and the ten-bit binary output describe the same quantity. For −5, the two unsigned patterns are 1099511627771 and 1019 respectively.

A valid width of 4 does not shorten the negative result: =HEX2BIN("FFFFFFFFFB",4) has independently expected text 1111111011. The output does not become a four-bit signed number.

Short hex FB, by contrast, represents positive 251. =HEX2BIN("FB",8) gives expected text 11111011. The complete sign width must remain visible; a short positive code is not an arbitrary signed-byte value.

Advanced check: preserve quantities through a round trip

For the first table, put =BIN2HEX(B2,2) in C2 and fill down. Expected reconstructed hex fields are 05, 25, 49, A5 and FF.

If the original source had been 0005, this width-two reconstruction would return 05. The quantity is unchanged, but the character count is different. BIN2HEX uses its requested output width rather than remembering the original input.

For numeric verification, compare =HEX2DEC(A2) with =HEX2DEC(BIN2HEX(B2)). Both have the same independently expected numbers in this deliberately small fixture.

Field-level interpretation

Hex A5 may encode two separate four-bit fields, 10 and 5, rather than one quantity 165. =HEX2BIN(LEFT("A5",1),4) gives 1010; the corresponding RIGHT expression gives 0101. The complete quantity is 10×16+5, while the sum of the fields is only 15.

Use the external record definition to decide which interpretation is needed. Conversion does not validate that definition for you.

Errors and unverified boundaries

The lesson explicitly documents #NUM! for invalid hexadecimal input or insufficient places; truncation of fractional places; #VALUE! for nonnumeric places; and #NUM! for negative places.

The value 37 needs six binary positions, so =HEX2BIN("25",5) follows the insufficient-width condition. Places 8.9 truncates to 8 and gives 00100101. Zero places, general case handling, prefixes and competing-error precedence remain unverified. The outputs here are independently calculated expectations, not native WPS observations.

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.