Are there Boolean operators in MS Excel?

  • Thread starter Thread starter Aashu
  • Start date Start date
A

Aashu

:)



My dear friends & respected ones,
warm regards to everybody.

I am new to this forum. My query is :Is there any operator or
function in MS Excel to reverse the bit pattern of a binary no. as we
perform in Boolean mathematics.

Eg. Suppose there is any binary no. in cell A5 as "111011110101", so by
using any operator, how inverted binary no. i.e. "000100001010" can be
obtained.

Also are there other operators so as to perform AND, OR, EX-OR
operations of digital electronics?


Best Regards,
 
Aashu said:
:)



My dear friends & respected ones,
warm regards to everybody.

I am new to this forum. My query is :Is there any operator or
function in MS Excel to reverse the bit pattern of a binary no. as we
perform in Boolean mathematics.

Eg. Suppose there is any binary no. in cell A5 as "111011110101", so by
using any operator, how inverted binary no. i.e. "000100001010" can be
obtained.

Also are there other operators so as to perform AND, OR, EX-OR
operations of digital electronics?

If the binary number had been only 10 digits, you could have used
=DEC2BIN(-(BIN2DEC(A5)-1),10)
 
...Is there any operator or
function in MS Excel to reverse
the bit pattern of a binary number?

Hi. Excel vba has a limited capability of using Xor to reverse bit
patterns. You can usually find workarounds. Since your bin # is too
large for Excel, here's one of a few workarounds using Xor.

Sub Demo()
Dim bin, dec, Inv

bin = 111011110101#

'dec=3829
dec = bin2dec(Left(bin, 3)) * 512 + bin2dec(Right(bin, 9))

Inv = dec2bin(dec Xor (2 ^ Len(bin) - 1))
Debug.Print Format(Inv, "000000000000")
End Sub

Returns: 000100001010

HTH
Dana DeLouis
 
Thanks All of you very much for prompt response & solving my problem an
also showing me different ways for solving the same problem.



Best Regards,
 
daddylonglegs said:
Try this formula solution

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A5,0,2),1,0),2,1)


Thank you very much "DADYLONGLEGS", you have suggested me one of the
simplest option very useful in my application.


Thanks & Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top