Contact

Zoho Sheet DEC2HEX Function: Decimal to Hexadecimal with Examples

Number Conversion Intermediate Zoho Sheet

Convert decimal values to hexadecimal in Zoho Sheet with exact datasets, place-value checks, documented limits and practical examples.

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

DEC2HEX converts a decimal representation into hexadecimal. For the positive integer 42, the source numeral is 42 and the converted result is 2A. The base changes; the represented quantity does not. Use a width argument when a receiving report needs leading zeroes.

Syntax and availability

DEC2HEX(decimal_number; [num_of_digits])

Zoho’s official DEC2HEX entry was checked on October 15, 2026. It describes the rolling web service. The first supported release and last functioning version are unknown; current documentation is separate from those historical endpoints. Mobile/offline parity is unverified. Results below are independent integer calculations, not native Zoho execution.

The required numeric input has documented inclusive bounds −2^39 through 2^39−1, or −549,755,813,888 through 549,755,813,887. These are numeric bounds, not a limit of ten decimal digits. The worksheet below deliberately uses positive integers. Although the help includes a fractional argument illustration and a negative-looking output, it does not fully explain fractional rounding or signed output encoding; neither is inferred here.

The second argument chooses the output width. When the representation is shorter, Zoho pads its left side with zeroes; an insufficient width is an error, not permission to cut off significant digits. Use positive integer widths here. Fractional widths, blank inputs and Boolean coercion are not verified.

Square brackets mark an optional argument and are not typed into a formula. Omitting width gives the unpadded representation in the ordinary positive examples. Follow your workbook’s locale separator; these formulas use semicolons.

Rebuild a width example with an explicit input

The help displays a twelve-character result from an unspecified cell reference. With an independently specified integer input, =DEC2HEX(478;12) has expected result 0000000001DE. This agrees with the displayed representation, but does not establish what was in the vendor’s hidden input cell or how a fractional value would be coerced. Twelve-character padding is explicitly illustrated by Zoho.

Complete reproducible worksheet

Create Conversions with Source in A1, Decimal_check in B1, Converted in C1, and Padded in D1. Enter the following values in A2:B7. Enter the source numerals exactly as shown, without grouping commas or base prefixes. Column B is an independent explanatory value, not an argument to the conversion formula.

Row A: source B: decimal check C: expected D: expected width 5
2 1 1 1 00001
3 7 7 7 00007
4 15 15 F 0000F
5 42 42 2A 0002A
6 63 63 3F 0003F
7 255 255 FF 000FF

Enter C2 =DEC2HEX(A2) and fill through C7. Fill D2 =DEC2HEX(A2;5) through D7. The zeroes in D belong to the representation, not to a larger numeric value.

In a copy change A5 from 42 to 43 and update its explanatory B5 to 43. C5 becomes 2B and D5 becomes 0002B. Other records remain unchanged. This gives a one-unit sensitivity check with a fully specified input.

Advanced: build a specified RGB color code

Put 34,139,230 in G2:I2 as red, green and blue channel values. In G3 enter =DEC2HEX(G2;2) and fill right through I3. Expected channel strings are 22,8B,E6. Then enter ="#"&G3&H3&I3 in J3. The expected color code is #228BE6.

Two characters per channel are essential for this particular format. If a channel is 7, the desired string is 07, not 7. A valid channel policy also requires values from zero through 255; DEC2HEX’s much wider numeric domain does not validate that separate application rule. These examples use positive integers so fractional-input handling is not involved.

Change the red channel G2 from 34 to 35. G3 becomes 23 and J3 becomes #238BE6. The other channels stay unchanged. Independently, 34=2×16+2, 139=8×16+11, and 230=14×16+6; B represents 11 and E represents 14. This is a formatting example, not a color-management or display-calibration test.

Errors and troubleshooting

The documented #NUM! cases include an output that needs more places than the requested width, and width zero or negative. For example, =DEC2HEX(255;1) cannot hold FF in one position. Increasing the width preserves the whole representation; shortening the source value would change the data.

Inputs outside the documented numeric interval also produce #NUM!. The upper bound plus one, 549,755,813,888, is outside that interval. Do not remove an error merely to make a report appear complete: retain the raw value and investigate the format or width rule.

The shared help glossary mentions name, type and reference errors without defining a complete coercion matrix for this function. Check the source base, legal characters, cell type and literal quotation before investigating more complex formulas. Do not add 0x, 0b or other programming-language prefixes unless a product reference explicitly permits them.

Keep conversion and arithmetic separate. A nondecimal display can look like a decimal number, yet ordinary subtraction on that display need not measure the intended change. Preserve raw identifiers, document the source’s sign and width convention, and verify exported leading zeroes in the receiving system. Matching function names across spreadsheet products do not establish identical limits or behavior.