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-18T02:26:46+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)

    Thanks Mike, I did not know this

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2015-03-18T02:47:20+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)

    I placed this formula in a cell and changed it to meet my criteria and I do not seem to understand how it can work? if we take the first column it has 00001000 and when I place the formula in and drag it only gives me 001010 which is not even close

    This is what I have in  Q:4     =MID(J$4,COLUMN(A1),1)  What am I doing wrong?

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

    0 comments No comments