Is there an XOR function??

H

hgrove

Luke wrote...
How do I Xor two values together using a calculation?

For up to 32-bit integers,

=SUMPRODUCT(MOD(MOD(INT(A1/2^(32-ROW(INDIRECT("1:32")))),2)+MOD(INT(A2/2^(32-ROW(INDIRECT("1:32")))),2),2),2^(32-ROW(INDIRECT("1:32"))))
 
H

hgrove

CoRrRan wrote...
...
=BIN2DEC(SUBSTITUTE(DEC2BIN(A1)*1+DEC2BIN(B1)*1;2;0))

Note that BIN2DEC and DEC2BIN both require the Analysis ToolPak, an
both can handle numbers only up to 511. Also note that comma rathe
than semicolon is the typical argument separator for English languag
versions of Excel
 
D

Dana DeLouis

Would a Custom Function work for you?

Function BitXor(a, b)
BitXor = a Xor b
End Function

Here, A1 & B1 have the following two values:
123456789
987654321

=BitXor(A1,B1)

returns:
1032168868

Which seems to check with another program:
BitXor[123456789, 987654321]

1032168868

BitXor means a 'bit'wise Xor.
Hope I did this correctly. :>)
Dana DeLouis
 
D

Dana DeLouis

Hmmm. Never mind. Although "Help" says that a & b can be any expression,
it looks like they are limited to a size of "Long", or about 9-10 digits.

Dana


Dana DeLouis said:
Would a Custom Function work for you?

Function BitXor(a, b)
BitXor = a Xor b
End Function

Here, A1 & B1 have the following two values:
123456789
987654321

=BitXor(A1,B1)

returns:
1032168868

Which seems to check with another program:
BitXor[123456789, 987654321]

1032168868

BitXor means a 'bit'wise Xor.
Hope I did this correctly. :>)
Dana DeLouis

Luke said:
How do I Xor two values together using a calculation?

Cheers
 
G

Guest

It seems to work,

Thank you for your reply.

Regards,
Luke
-----Original Message-----
Hmmm. Never mind. Although "Help" says that a & b can be any expression,
it looks like they are limited to a size of "Long", or about 9-10 digits.

Dana


Dana DeLouis said:
Would a Custom Function work for you?

Function BitXor(a, b)
BitXor = a Xor b
End Function

Here, A1 & B1 have the following two values:
123456789
987654321

=BitXor(A1,B1)

returns:
1032168868

Which seems to check with another program:
BitXor[123456789, 987654321]

1032168868

BitXor means a 'bit'wise Xor.
Hope I did this correctly. :>)
Dana DeLouis

How do I Xor two values together using a calculation?

Cheers


.
 

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


Top