Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default XOR operator in Excel

dear all,

In excel, it seem that XOR operator is not supported by default, are there
any other ways to work around?

Thanks.
lurchot


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default XOR operator in Excel

You can use the following formula to XOR cells A1 and A2.

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

An expanded version handles the case when either A1 or A2 is empty:

=IF(OR(A1="",A2=""),NA(), OR(AND(A1,NOT(A2)),AND(A2,NOT(A1))))


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"lurchot" wrote in message
...
dear all,

In excel, it seem that XOR operator is not supported by default, are there
any other ways to work around?

Thanks.
lurchot


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default XOR operator in Excel

This can be shortened to

=(A1<0)+(A2<0)=1


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

"Chip Pearson" wrote in message
...
You can use the following formula to XOR cells A1 and A2.

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

An expanded version handles the case when either A1 or A2 is empty:

=IF(OR(A1="",A2=""),NA(), OR(AND(A1,NOT(A2)),AND(A2,NOT(A1))))


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"lurchot" wrote in message
...
dear all,

In excel, it seem that XOR operator is not supported by default, are
there any other ways to work around?

Thanks.
lurchot



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default XOR operator in Excel

GREAT! especially latter one.

Thanks Chip.

---------------------------------
This can be shortened to

=(A1<0)+(A2<0)=1


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

"Chip Pearson" wrote in message
...
You can use the following formula to XOR cells A1 and A2.

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

An expanded version handles the case when either A1 or A2 is empty:

=IF(OR(A1="",A2=""),NA(), OR(AND(A1,NOT(A2)),AND(A2,NOT(A1))))


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"lurchot" wrote in message
...
dear all,

In excel, it seem that XOR operator is not supported by default, are
there any other ways to work around?

Thanks.
lurchot





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default XOR operator in Excel


What version of Excel does not support Xor ?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"lurchot"
wrote in message
dear all,
In excel, it seem that XOR operator is not supported by default, are there
any other ways to work around?
Thanks.
lurchot




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default XOR operator in Excel

What version of Excel does not support Xor ?

I would assume that he was speaking of a worksheet function, not the VBA
operator.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)

"Jim Cone" wrote in message
...

What version of Excel does not support Xor ?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"lurchot"
wrote in message
dear all,
In excel, it seem that XOR operator is not supported by default, are there
any other ways to work around?
Thanks.
lurchot



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default XOR operator in Excel


Thanks Chip. I guess I got up too early.
--
Jim Cone


"Chip Pearson"
wrote in message
What version of Excel does not support Xor ?

I would assume that he was speaking of a worksheet function, not the VBA
operator.
--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"Jim Cone"
wrote in message
What version of Excel does not support Xor ?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"lurchot"
wrote in message
dear all,
In excel, it seem that XOR operator is not supported by default, are there
any other ways to work around?
Thanks.
lurchot



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
have Excel retrieve conditional operator ( < = ) from a cell [email protected] Excel Worksheet Functions 1 May 17th 07 07:16 PM
Operator kittycris Excel Worksheet Functions 3 January 11th 07 01:36 AM
MAJOR BUG: Excel operator precedence is wrong P Keenan Excel Worksheet Functions 5 June 23rd 06 02:18 PM
what does ~ operator mean? Todd Excel Discussion (Misc queries) 3 November 22nd 05 05:30 PM
Or operator AnisaF Excel Worksheet Functions 6 March 20th 05 12:53 PM


All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"