but : 34 359 738 367

I was one digit off !!!.]]>

If someone is interested in binary formula here is what I find 3 diferentes one.

Put your number in cell A1 and the formula in B1.

1 . for A Binary of 12 digits the formula is :

=DEC2BIN((MOD(A1,4096)/512),3) DEC2BIN(MOD(A1,512),9)

The maximum number you can go with this one is : 4 095.

2 . for A Binary of 18 digits the formula is : =CONCATENATE(DEC2BIN(INT(A1/512),9),DEC2BIN(MOD(A1,512),9))

The maximum number you can go with this one is : 262 143.

3 . f... [ More ]]]>

Thank you again RL. Frenchie.]]>

I am a little confused. How and with what, were you using the code above to get the problems listed

in this post. Macro is not hard to learn and you can find help online just google macro tutorial and

you should find all the help you need. I don't have time to do this, sorry. You mentioned looking for

patterns in binary, I have done much in this area and have found little that could help with the lottery

but don't let this detain you.

You first may need to learn some v... [ More ]]]>

Thank you for the code, but could you help me step by step how to make it work on the excel file, I don't know nothing about macro, that would be a good lesson for me.

Thank you.]]>

copy and paste this code and see if it works, may need to remove the End IF

I = 7 so it will convert any number = 255 can be changed if needed

prints all 8 bits format = 01000101

DECLARE FUNCTION DecBin$ (V AS ANY)

FUNCTION DecBin$ (V AS Variant)

DIM R$, L%, I%

I = 7

R =

IF IsNumeric(V) THEN

L = VAL(V)

WHILE I = 0

IF 2 ^ I = L THEN R = R 1 ELSE R = R 0

IF 2 ^ I = L THEN L = L - 2 ^ I

I = I - 1

WEND

End IF

DecBin = R

END FUN... [ More ]]]>

One of those circles was full of small lines that someone saw as binary code, then they translated to ascii values and they got an Euler formula]]>

Thank you for your response, but you're talking Chinese to me, I do not know anything about macro, someone wrote that one for me and ready to use in an Excel file.

I realy do appreciate your effort, and admire your knolege I wiche I could do the same but not today,

The reason why I needed a binary code was to play and transfer number into it to see what I can came up with, you never know always try, my things is to work with patterns so, that could lead to something inte... [ More ]]]>

ignore the above I have made so many typeo's as in the while i = 0 should be While i = 0

I was trying to give you an idea where your mistake was without pointing it out directly. Allowing

you to solve it.

Here is a basic code example the only difference it prints all 16 bits. I will stop playing the stupid me

input enter number to convert , L

R$ = : i=16:

DO WHILE I = 0

IF 2 ^ I = L THEN R$ = R$ + 1 ELSE R$ = R$ + 0

IF 2 ^ I = L THEN L = (L - 2 ^ I]]>

I made a mistake shown in bold

here you now have (2 ^ i = l), (2 ^ 4 = 16) and (16 = 25) so r = 1

You now have the MSD for the binary string. From this point, convert the

remaining digits; one digit at a time using the l = l - i each time (2 ^ i = l)

I left this undone for you to finish. |_ above should be l = l - 2 ^ i not l = l - i

example steps to compleat

l = l - i

while i = 0

i = i - 1

if 2 ^ i = l then r = r 1 Else r = r 0

if 2 ^ i = l then l]]>

Look at this and It should help you see your error and correct your code

l=25 ' number to convert to decimal

i = 16 allows function to convert any decimal =65536

(The long version)

1=16

2^i=65536 is 25

i=i-1 'i=15

2^i=32768 is 25

i=i-1 'i=14

2^i=16384 is 25

i=i-1 'i=13

2^i=8192 is 25

i=i-1 'i=12

2^i=4096 is 25

i=i-1 'i=11

2^i=2048 is 25

i=i-1 'i=10

2^i=1024 is 25

i=i-1 'i=9

2^i=512 is 25

i=i-1 'i=8

2^i=256 is 2... [ More ]]]>

your answers were very appreciated, thanks again that helped alot.]]>

I had a little time and looked over your code. When the number to convert is a odd number your code

will work correct but if it is even then it will be missing the lsd. Check any even number and it will be missing

the 0 digit at the end of the string. 25 binary is 11001 and 50 binary is 110010. Your code is terminating

early with all even numbers because the lsd is zero. This is a easy fix.

RL]]>

FUNCTION DecBin$ (Decimal ) STATIC

BinNum$ =

H$ = HEX$(Decimal )

FOR I% = 1 TO LEN(H$)

DIGIT% = INSTR( 0123456789ABCDEF , MID$(H$, I%, 1)) - 1

IF DIGIT% 0 THEN

BinNum$ =

EXIT FOR

END IF

J% = 8

K% = 4

DO

BinNum$ = BinNum$ + RIGHT$(STR$((DIGIT% \ J%) MOD 2), 1)

J% = J% - (J% \ 2)

K% = K% - 1

IF K% = 0 THEN

EXIT DO

END IF

LOOP WHILE J%

NEXT I%

DecBin$ = BinNum$

END FUNCTION]]>

Well the number 25 in binary is 11001 and the number 50 in binary is 110010 so I think you may have an error in your array sizes.

Rather than correcting your VB code I'm posting it in php maybe you can translate it to VB, I'm using recusivity that makes it easy:

/**

* binary function by themagician

* it takes an integer and print its binary value

* June - 2010

*

*/

// It prints: 11001

binary(25);

print \n ;

// It prints: 110010

binary(50]]>

I'm not sure but I think that the Binary code below has an error,can someone test it and correct it if it's not correct,because when I enter the number 25 it give me : 11001 et when I put 50 it give me the same : 11001 !!?

Thank you.

Function DecBin$(V As Variant)

Dim r$, L , i%, K

r =

If IsNumeric(V) Then

L = Val(V)

i = 16

While 2 ^ i L

i = i - 1

Wend

' Now we have an i that is either equal to L or less.

If 2 ^ i = L Then

r = 1 Stri... [ More ]]]>