Starting binary input with 0s in a cell

binary, excel

Solution

I found the simplest solution after working with Excel this past week.

To include leading 0s, I should select the cell containing my decimal number and simply use the dec2bin function in Excel and define how many bits I want to output to be.

=DEC2BIN([number or cell reference],[#bits])

So if you enter "=DEC2BIN(A1,8)" in the formula bar, and the value of A1 is 15, the value output will be 00001111.

Problem

First up, I'm not sure if this is the right place to ask this or not, so if it's not please let me know. Ok so,I'm working on a project that deals with numbers in the binary format as inputs, however, when the input let's say begins with "00" or any number of 0s, it discards it in Excel so I was wondering how to force excel to accept 0s at the beginning of a binary input

Original source