ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   bitwise operations as in xor (https://www.excelbanter.com/excel-discussion-misc-queries/227839-bitwise-operations-xor.html)

stevenshrii

bitwise operations as in xor
 
is there an Xor operation in excel for a bitwise functions ?


joeu2004

bitwise operations as in xor
 
"stevenshrii" wrote:
is there an Xor operation in excel for a bitwise functions ?


No in Excel per se, to my knowledge. But there is an XOR operator in VBA.
For example:

Function myxor(lh as Long, rh as Long) as Long
myxor = lh Xor rh
End Function

When we enter =myxor(12,10), the result is 6. Note that 12 in binary is
1100, 10 is 1010, and 6 is 0110. However, keep in mind that Excel stores
numbers internally as binary floating-point.

The above function is limited to 31-bit positive integers. You can use
32-bit integers by treating them as signed integers.


Harald Staff

bitwise operations as in xor
 
Harlan Grove has some clever formula solutions he
http://tinyurl.com/c2p536

HTH. Best wishes Harald

"stevenshrii" skrev i melding
...
is there an Xor operation in excel for a bitwise functions ?





All times are GMT +1. The time now is 08:50 PM.

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