ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Are there Boolean operators in MS Excel? (https://www.excelbanter.com/excel-discussion-misc-queries/102249-there-boolean-operators-ms-excel.html)

Aashu

Are there Boolean operators in MS Excel?
 

:)



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


--
Aashu
------------------------------------------------------------------------
Aashu's Profile: http://www.excelforum.com/member.php...o&userid=36916
View this thread: http://www.excelforum.com/showthread...hreadid=566643


David Biddulph

Are there Boolean operators in MS Excel?
 
"Aashu" wrote in
message ...

:)



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)
--
David Biddulph



Dana DeLouis

Are there Boolean operators in MS Excel?
 
...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


David Biddulph wrote:
"Aashu" wrote in
message ...
:)



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)


Aashu

Are there Boolean operators in MS Excel?
 

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



Best Regards,
-------------
Aashu.




Dana DeLouis Wrote:
...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


David Biddulph wrote:
"Aashu" wrote

in
message ...
:)



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)



--
Aashu
------------------------------------------------------------------------
Aashu's Profile: http://www.excelforum.com/member.php...o&userid=36916
View this thread: http://www.excelforum.com/showthread...hreadid=566643


daddylonglegs

Are there Boolean operators in MS Excel?
 

Try this formula solution

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


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=566643


Aashu

Are there Boolean operators in MS Excel?
 

daddylonglegs Wrote:
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,
-----------------
Aashu


--
Aashu
------------------------------------------------------------------------
Aashu's Profile: http://www.excelforum.com/member.php...o&userid=36916
View this thread: http://www.excelforum.com/showthread...hreadid=566643



All times are GMT +1. The time now is 07:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com