Grace
Grace

Reputation: 11

Generating a random binary number

What is the formula that I can use to generate a random binary number which is 6 bits in length and convert that binary number into decimal number using Excel?

Upvotes: 1

Views: 1199

Answers (1)

Tharun K
Tharun K

Reputation: 1180

To generate a random binary number which is 6 bits in length

=TEXT(DEC2BIN(RANDBETWEEN(0,63)),"000000")

Convert that binary number into a decimal number

=BIN2DEC(number)

To achieve this, you can store the random binaries in a column, and pass the cell number to BIN2DEC

References:

https://exceljet.net/excel-functions/excel-bin2dec-function

https://exceljet.net/excel-functions/excel-dec2bin-function

Upvotes: 1

Related Questions