Forum Discussion

MohsinBabar's avatar
MohsinBabar
Qrew Member
3 years ago

excel formula to qb

Hello Exparts, 

Can you help me out. How can I translate below excel formula into QB?

Goal to convert 7 digits Decimal to 22 bits Binary.

=RIGHT(DEC2BIN(MOD(QUOTIENT(N8,256^3),256),8)&DEC2BIN(MOD(QUOTIENT(N8,256^2),256),8)&DEC2BIN(MOD(QUOTIENT(N8,256^1),256),8)&DEC2BIN(MOD(QUOTIENT(N8,256^0),256),8),22)

Here N8 (decimal) = 1016812 (maximum value can be 8388607)

Thanks in advance
Mohsin

------------------------------
Mohsin Babar
------------------------------

1 Reply

  • OR can we develop this one to QB?

    =DEC2HEX($N$16/4)&DEC2HEX(4*MOD($N$16,4))&IF(N17<16,"00","0")&DEC2HEX(N17)

    Here:
    N16 = 1016812 
    N17 = 255


    ------------------------------
    Mohsin Babar
    ------------------------------