Engineering functions

HEX2DEC

Matches all 1,028 recorded answers

Recorded: 1,025 in the answer bank and 3 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicHEX2DEC
BulgarianHEX2DEC
CzechHEX2DEC
DanishHEX.TIL.DEC
GermanHEX2DEC
GreekHEX2DEC
English (Australia)HEX2DEC
English (United Kingdom)HEX2DEC
English (United States)HEX2DEC
SpanishHEX.A.DEC
EstonianHEX2DEC
FinnishHEKSADES
FrenchHEXDEC
HebrewHEX2DEC
CroatianHEX2DEC
HungarianHEX.DEC
IndonesianHEX2DEC
ItalianHEX2DEC
JapaneseHEX2DEC
KoreanHEX2DEC
LithuanianHEX2DEC
LatvianHEX2DEC
NorwegianHEX2DEC
DutchHEX.N.DEC
PolishSZESN.NA.DZIES
Portuguese (Brazil)HEX2DEC
Portuguese (Portugal)HEXADEC
RomanianHEX2DEC
RussianШЕСТН.В.ДЕС
SlovakHEX2DEC
SlovenianHEX2DEC
Serbian (Latin)HEX2DEC
SwedishHEX.TILL.DEC
ThaiHEX2DEC
TurkishHEX2DEC işlevi
UkrainianHEX2DEC
VietnameseHEX2DEC
Chinese (Simplified)HEX2DEC
Chinese (Hong Kong)HEX2DEC
Chinese (Traditional)HEX2DEC

Names from Microsoft's support site.

What it does

HEX2DEC(number)

HEX2DEC(number) converts hexadecimal to decimal. The result is a numeric worksheet value.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

=HEX2DEC("2D") returns 45. All of these represent the same integer: decimal 45, binary 101101, octal 55, and hexadecimal 2D.

For a negative value, =HEX2DEC("FFFFFFFFD3") returns -45. Accumulation gives 1099511627731; the full-width sign bit is set, so subtract 2^40 to get -45. The shorter source "FFD3" is positive 65491.

Quirks

These engineering conversions use signed fixed-width encodings, not arbitrary-length integers. The source accepts at most ten digits; a full ten-digit encoding uses 40-bit two’s complement. FFFFFFFFFF represents minus one. Invalid source digits or an oversized input give #NUM!. Quote source digits to keep leading zeros and prevent worksheet number parsing from changing the input.

How to implement

Separate input parsing, signed interpretation and output formatting. Uppercase the source, validate its digit set and length, and accumulate raw=raw*16+digit with checked integer arithmetic. Only a full ten-digit source with its top bit set is negative: subtract 2^40 to obtain signed integer v. Return v as a number. The 45 example is an exact integer at every step. Do not infer sign merely from the first source character of a short encoding.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

HEX2DEC · 1 lines · calc-func/src/catalogue/engineering.rs on GitHub
8 hex2dec "HEX2DEC" (1, 1) [V "number"] |s, a, sv| { to_decimal(s, a, radix::hex2dec_kernel) }
hex2dec_kernel · 3 lines · calc-func/src/ported/engineering_radix_family.rs on GitHub
pub fn hex2dec_kernel(number: &str) -> Result<f64, WorksheetErrorCode> {
    source_to_decimal_kernel(number, HEX_SPEC)
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
20430Windows, 64-bit, CPU not recorded1,025

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

1,025 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.

Alternatives

DEC2HEX converts in the reverse direction. BASE and DECIMAL provide general radix conversion with different sign rules. A full-width negative engineering encoding is not a minus-prefixed numeral; choose the pair whose sign convention fits your input.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents