Engineering functions

BIN2HEX

Matches all 752 recorded answers

Recorded: 748 in the answer bank and 4 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicBIN2HEX
BulgarianBIN2HEX
CzechBIN2HEX
DanishBIN.TIL.HEX
GermanBIN2HEX
GreekBIN2HEX
English (Australia)BIN2HEX
English (United Kingdom)BIN2HEX
English (United States)BIN2HEX
SpanishBIN.A.HEX
EstonianBIN2HEX
FinnishBINHEKSA
FrenchBINHEX
HebrewBIN2HEX
CroatianBIN2HEX
HungarianBIN.HEX
IndonesianBIN2HEX
ItalianBIN2HEX
JapaneseBIN2HEX
KoreanBIN2HEX
LithuanianBIN2HEX
LatvianBIN2HEX
NorwegianBIN2HEX
DutchBIN2HEX
PolishDWÓJK.NA.SZESN
Portuguese (Brazil)BIN2HEX
Portuguese (Portugal)BINAHEX
RomanianBIN2HEX
RussianДВ.В.ШЕСТН
SlovakBIN2HEX
SlovenianBIN2HEX
Serbian (Latin)BIN2HEX
SwedishBIN.TILL.HEX
ThaiBIN2HEX
TurkishBIN2HEX işlevi
UkrainianBIN2HEX
VietnameseBIN2HEX
Chinese (Simplified)BIN2HEX
Chinese (Hong Kong)BIN2HEX
Chinese (Traditional)BIN2HEX

Names from Microsoft's support site.

What it does

BIN2HEX(number, [places])

BIN2HEX(number, [places]) converts binary to hexadecimal. The result is text, with optional leading zeros controlled by places.

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.

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

For a negative value, =BIN2HEX("1111010011",4) returns "FFFFFFFFD3". Decode 979-1024=-45, then encode 2^40-45 in ten hexadecimal digits. The destination has a different sign width from the source.

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 10-bit two’s complement. 1111111111 represents minus one. Invalid source digits or an oversized input give #NUM!. For a positive result a width too small gives #NUM!. A negative result uses ten digits; the current code still validates an explicitly supplied width before emitting it, despite documentation describing the width as ignored.

How to implement

Separate input parsing, signed interpretation and output formatting. Uppercase the source, validate its digit set and length, and accumulate raw=raw*2+digit with checked integer arithmetic. Only a full ten-digit source with its top bit set is negative: subtract 2^10 to obtain signed integer v. Check v against the 40-bit signed target range. If negative, encode 2^40+v in base 16 using ten digits. Otherwise use repeated division by 16, reverse the remainders and left-pad to the requested width. Truncate the width and validate it in the current supported range one through ten. Return text; a decimal number formatted to look similar is a different value kind.

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.

BIN2HEX · 1 lines · calc-func/src/catalogue/engineering.rs on GitHub
2 bin2hex "BIN2HEX" (1, 2) [V "number", V "places"] |s, a, sv| { between(s, a, radix::bin2hex_kernel) }
bin2hex_kernel · 3 lines · calc-func/src/ported/engineering_radix_family.rs on GitHub
pub fn bin2hex_kernel(number: &str, places: Option<f64>) -> Result<ExcelText, WorksheetErrorCode> {
    source_to_target_kernel(number, places, BIN_SPEC, 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 recorded748

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

748 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

HEX2BIN 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