Google Sheets – Character Number in Hexadecimal

google sheets

What I am trying to do is have Google Sheets display a number with 10 places, formatted in hex. Here's my current function:

=TEXT(dec2hex(ROW()-2), "0000000000")

The -2 exists just to make sure it starts at zero coming in row 2.

The problem with this set-up is that when it gets to A, it stops formatting in a ten character system, presumably because they are not numbers.

Is there a way to format this system so that it works for hexcode?

Best Answer

This formula works as well, as it uses the second parameter of the DEC2HEX formula:

=DEC2HEX(ROW()-2,10)