Skip to main content
Question

excel formula to qb

  • November 11, 2021
  • 0 replies
  • 39 views

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
------------------------------
This topic has been closed for replies.

  • Author
  • Registered
  • November 11, 2021
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
------------------------------