How can I convert whole numbers to binary, Hexideciaml and Octal

Anonymous
2015-03-17T21:42:57+00:00

How can I wrote a formula or Macro to convert whole numbers to binary?  This is just 1 example on how it does its math:

Example: Convert 74 to a binary number.

74 / 2 = 37 with a remainder of 0

Binary digits (so far): 0

37 / 2 = 18 with a remainder of 1

Binary digits (so far): 10

18 / 2 = 9 with a remainder of 0

Binary digits (so far): 010

9 / 2 = 4 with a remainder of 1

Binary digits (so far): 1010

4 / 2 = 2 with a remainder of 0

Binary digits (so far): 01010

2 / 2 = 1 with a remainder of 0

Binary digits (so far): 001010

1 / 2 = 0 with a remainder of 1

Binary digits (so far): 1001010

And that brings us down to 0, so the final answer

(74 expressed in binary) is 1001010.

I want to make sure that each 0 or 1 goes in a cell all to itself too.  There are a total of 8 cell potential per number and would like the spreadsheet to look like this below.  If anyone can get me started I will finish it as far as a formula goes.

Thank you so much GURUS!!!!!

If there can be a small change for Hexadecimal (16) and Octal (8) that would be cool but if not that is okay too.  beggars can not be choosy  lol  again THANK YOU!!!!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2015-03-17T21:50:29+00:00

    Hi,

    These are all inbuilt Excel functions

    =DEC2BIN(A10,8)

    =DEC2HEX(A10,8)

    =DEC2OCT(A10,8)

    To split to number up into separate cells we can use this and drag right where D10 contains our Binary, Hex or Octal number. Leading zeroes will be retained.

    =MID(D$10,COLUMN(A1),1)

    3 people found this answer helpful.
    0 comments No comments
Answer accepted by question author
  1. Anonymous
    2015-03-19T19:32:51+00:00

    Hi,

    If you want to drag the formula right then it has to be like this with the column reference absolute.

    =MID($J4,COLUMN(A1),1)

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2015-03-19T23:05:36+00:00

    Hi,

    If you want to drag the formula right then it has to be like this with the column reference absolute.

    =MID($J4,COLUMN(A1),1)

    Thanks Mike, I did some reading up on it since you said it was an excel function. It's working. great!  You all are AMAZING and I'm so thankful and blessed to have your help

    0 comments No comments