Binary calculation

  • Thread starter Thread starter FL
  • Start date Start date
F

FL

Hi,

Are the worksheet functions to execute binary calculations
like AND, OR, XOR, Bitshift, ...

Examples:
11101101 AND 00000010 = 00000000
11000001 OR 00000010 = 11000011


Thanks in advance,
FL
 
Hi

As far as I know, no, you need some VBA for that.

Function BitAnd(X As Long, Y As Long)
BitAnd = X And Y
End Function

Function BitOR(X As Long, Y As Long)
BitOR = X Or Y
End Function

Function BitXOR(X As Long, Y As Long)
BitOR = X Xor Y
End Function

Note that you pass real numbers into them, not their binary-like text
representations.
 
Back
Top