Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Looking for BOOLEAN ALGEBRA functions (specifically XOR)

1,518 views
Skip to first unread message

Jones@discussions.microsoft.com RL Jones

unread,
Jul 21, 2009, 2:01:01 PM7/21/09
to
I am looking for BOOLEAN Algebra Functions. Can't find any help in EXCEL.
While I can work around the OR, AND, and NOT, I need XOR.

Rick Rothstein

unread,
Jul 21, 2009, 2:27:08 PM7/21/09
to
I'm pretty sure this is it...

=OR(AND(A1,NOT(B1)),AND(NOT(A1),B1))

--
Rick (MVP - Excel)


"RL Jones" <RL Jo...@discussions.microsoft.com> wrote in message
news:60D87E8B-B977-4003...@microsoft.com...

Mike H

unread,
Jul 21, 2009, 2:27:06 PM7/21/09
to
Hi,

Excel doesn't have it but you can write your own quite simply

=IF(COUNTIF(A1:B1,"Some Value")=1,TRUE,FALSE)

Mike

Mike H

unread,
Jul 21, 2009, 3:08:05 PM7/21/09
to
Rick,

Can be abbreviated to:-

=(A1<>0)+(B1<>0)=1

and it also works if both cells are blank.

Mike

Rick Rothstein

unread,
Jul 21, 2009, 3:20:01 PM7/21/09
to
Ah, yes... very good. And I guess that could be written this way as well...

=NOT(A1)+NOT(B1)=1

--
Rick (MVP - Excel)


"Mike H" <Mi...@discussions.microsoft.com> wrote in message
news:4217D9BA-483E-4BAC...@microsoft.com...

Mike H

unread,
Jul 21, 2009, 3:33:03 PM7/21/09
to
Yes it could and until Excel include

=XOR(A1,B1) then they are as short as it gets.

Mike

Harlan Grove

unread,
Jul 21, 2009, 5:47:09 PM7/21/09
to
"Rick Rothstein" <rick.newsNO.S...@NO.SPAMverizon.net> wrote...

>Ah, yes... very good. And I guess that could be written this way as well...
>
>=NOT(A1)+NOT(B1)=1
...

If A1 and B1 would always be 1s or 0s, even shorter:

=MOD(A1+B1,2)

Rick Rothstein

unread,
Jul 21, 2009, 6:03:33 PM7/21/09
to
>>Ah, yes... very good. And I guess that could be written this way as
>>well...
>>
>>=NOT(A1)+NOT(B1)=1
> ...
>
> If A1 and B1 would always be 1s or 0s, even shorter:
>
> =MOD(A1+B1,2)

Provided the user didn't need to see the result of the operation as
TRUE/FALSE, of course.

Herbert Seidenberg

unread,
Jul 21, 2009, 7:16:52 PM7/21/09
to
An XOR could operate on any number of binary bits.
An odd parity checker would XOR all given bits,
thus checking for an odd number of bits in a word:
=MOD(1+MOD(HEX2BIN("AE")-1,9),2)
I vote for Harlan's formulas, having lifted them from
his post dated Jun 16, 2003.

Dana DeLouis

unread,
Jul 22, 2009, 12:21:02 AM7/22/09
to
> ... until Excel include =XOR(A1,B1)

It's included as an Excel vba function.
I have no idea why it's not included as a Worksheet function.

b = a Xor b

= = = =
Dana DeLouis

Rick Rothstein

unread,
Jul 22, 2009, 3:46:33 AM7/22/09
to
I wasn't saying to not use Harlan's formula... just noting his is returning
a number whereas the other posted formula returned TRUE/FALSE. If you used
in an expression, that difference wouldn't matter; but since all submissions
were shown as stand-alone formulas, I just figured I would note the
difference in what each returned. Besides, I wanted to give an opening to
Harlan to post back...

=MOD(A1+B1,2)=1

I think he likes being able to do that, so I thought I would be nice to him
and leave the door open for him to do that.<g> Of course, now that I took
that opportunity away from him in my response to you, I'll have to give him
a different opening for a response to this thread. Let me see... I know... I
do wonder which is the more efficient construction... Harlan's formula which
uses a MOD function call, mine which uses two NOT function calls or Mike's
which uses two logical comparisons.

--
Rick (MVP - Excel)


"Herbert Seidenberg" <herbds...@yahoo.com> wrote in message
news:f0d14c72-704f-483c...@m7g2000prd.googlegroups.com...

textmon...@gmail.com

unread,
Mar 23, 2017, 7:49:32 PM3/23/17
to
On Tuesday, July 21, 2009 at 11:01:01 AM UTC-7, Jo...@discussions.microsoft.com RL Jones wrote:
> I am looking for BOOLEAN Algebra Functions. Can't find any help in EXCEL.
> While I can work around the OR, AND, and NOT, I need XOR.

All you have to do is
=not(a1 = a2)

Auric__

unread,
Mar 24, 2017, 3:36:15 AM3/24/17
to
All *you* have to do is check the date of the original post. I'm pretty sure
"Jones" isn't still waiting for answers after almost ***EIGHT YEARS!!!***

--
I don't think you have yet told me how I can satisfy your curiosity.
0 new messages