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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|