Binary calculation

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
 
H

Harald Staff

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.
 

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

Top