1. Home
  2. Functions
  3. Engineering
  4. DEC2HEX

DEC2HEX function

Converts a decimal number to hexadecimal.

Syntax

=DEC2HEX(number, [places])

Arguments

ArgumentRequiredDescription
numberRequiredThe decimal integer to convert
placesOptionalThe number of characters to use (left out: as few as needed)

How to use DEC2HEX

DEC2HEX takes 1 required argument and 1 optional argument. Type =DEC2HEX( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=DEC2HEX(100, 4)Result "0064"
=DEC2HEX(-54)Result "FFFFFFFFCA"
=DEC2HEX(28)Result "1C"

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.