A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

bitwise XOR calc



 
 
Thread Tools Display Modes
  #1  
Old September 1st, 2004, 07:41 AM
Luke
external usenet poster
 
Posts: n/a
Default bitwise XOR calc

I need to calculate the XOR of three values in excel.

Say...

A1 = A0
A2 = F4

The conversion to bin =
A1 = 10100000
A2 = 11110100

I have found on the web that...
=SUMPRODUCT(MOD(MOD(INT(A1/Bits),2)+MOD(INT
(A2/Bits),2),2),Bits) - along with putting...
=2^(8-ROW(INDIRECT("1:8"))) in the define name
Insert/Name/Define - should give me the result...

A3 = 1010100

but it doesn't.

Any advise would be helpful (I'm not much in to VBA, so if
that's the soulition, then the whole code would be
appreciated.)

Thanks in advance.

Luke
  #2  
Old September 1st, 2004, 11:31 AM
Frank Kabel
external usenet poster
 
Posts: n/a
Default

Hi
IIRC this formula slution was posted by Harlan Grove. It
expects the values as decimals. So you may first convert
your hex values to decimlas (e.g. use HEX2DEC from the
Analysis Toolpak ddin for this). After this conversion try
the formula again


-----Original Message-----
I need to calculate the XOR of three values in excel.

Say...

A1 = A0
A2 = F4

The conversion to bin =
A1 = 10100000
A2 = 11110100

I have found on the web that...
=SUMPRODUCT(MOD(MOD(INT(A1/Bits),2)+MOD(INT
(A2/Bits),2),2),Bits) - along with putting...
=2^(8-ROW(INDIRECT("1:8"))) in the define name
Insert/Name/Define - should give me the result...

A3 = 1010100

but it doesn't.

Any advise would be helpful (I'm not much in to VBA, so

if
that's the soulition, then the whole code would be
appreciated.)

Thanks in advance.

Luke
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.