bitwise operations as in xor

J

JoeU2004

stevenshrii said:
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.
 

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

Similar Threads

bitwise functions 3
Binary NOT? 4
Where are Bitwise Operators 1
XOR Operator - How? 3
Calculator in C# 1
XOR operator in Excel 7
Bitwise XOR 2
How do I do bitwise compare operations on a field? 6

Top