leading zeros

  • Thread starter Thread starter Gabe
  • Start date Start date
G

Gabe

Hell all.

I am trying to enumerate a list in binary from 0 to (2^n - 1). I am
using the function "=DEC2BIN(ROW()-1)" to get a proper sequence. How
can I get this to keep the leading zeros so that they will all be the
same width?

Thanks in advance for the help.

-Gabe
 
Hi Gabe,

Change your formula to

=VALUE(DEC2BIN(ROW()-1))

and Format>Cells>Custom, in the Type box, enter 0000000 or as may zeros as
you require

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel
 
Back
Top