View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default How to get leading zeros using DEC2BIN

Use either =--dec2bin(1)
or
=dec2bin(1)*1
Then the formating will hold.
--
Gary''s Student


"scallyte" wrote:

I have a range formatted as 00000000. When I type 354 in a cell, I get
00000354 as expected. No problem.

When I use the Analysis Pak function = DEC2BIN(1), I get 1 instead of
the desired 00000001. A different function for example =SUM(1, 5)
works as expected and gives me 00000006.

How can I do this without VBA? Thanks