2012 has been the most awesome year since we started Chandoo.org.
The credit for this goes to our community of Excel users – that is you.
For practically every day of 2012, you have inspired me (and all of us at Chandoo.org) to learn something new, share and make you awesome. I know I say this many times, but I can never feel enough – Thank you for your support to Chandoo.org.
Apart from you, there are many other amazing people & companies that played a role in our success. In this post, let me highlight them & express my sincere gratitude.
People who helped me in 2012:
Teachers & Gurus:
Running a business, website & family requires a lot of motivation, fresh ideas & learning. Thanks to several wonderful teachers & inspiring individuals who gave me the strength I need this year.
Excel & Visualization Teachers:
Jon Peltier, Dick Kusleika, Debra Dalgleish, Mike Alexandar, Daniel Ferry, Robert Mundigl, Hui, Francis, Rob Collie, Bill Jelen and many more.
Chandoo.org Forum Members:
Hui, Sajan, NarayanK, BobHC, Faseeh, SirJB, Luke and all other regulars & Ninjas who contribute to my Excel knowledge everyday.
Business & Motivation
Andy Sernovitz, Darren Rowse, Yaro Starak, Avinash, Brandon Pearce, Alok, Pat, Chris, MrMoneyMustache, Jacob, Patrick and many more.
Technology
Amit Agarwal, John Gruber and many more sourced thru FlipBoard, Twitter & Pulse
Authors
As I was traveling quite a bit (1.5 months each in Thailand & Australia and few weeks with in India) I could not read as much as I wanted to. But I did manage to read & learn from some amazing authors, books. Special thanks to these wonderful authors.
- Chris Guillebeau $100 Startup
- Sam Walton Made in America
- Daniel Kahneman Thinking Fast & Slow
- Benjamin Graham Intelligent Investor
- Bill Bryson Down Under
- John F. Love McDonalds – Behind the arches
- Danielle S. Fairhurst Business Analysis using Excel
- Rob Collie DAX Formulas for PowerPivot
- Bill Jelen PowerPivot in Excel
And many other…
Note: All the book links to Amazon are affiliate links. That means, if you purchase something after clicking on them, I get a few cents ![]()
Partners, Affiliates & Supporters
To make Chandoo.org successful, I collaborate with many great minds in this industry. Some of these remarkable people are,
Chandoo.org Partners
- Danielle at Plum Solutions (and her assistant Susan) helped me arrange first ever Excel & Dashboard classes in Australia.
- Paramdeep at Pristine Education (and their staff) helped us offer various financial modeling training programs thru Chandoo.org.
- Daniel Ferry at ExcelHero.com helped me offer Excel School training along with his academy so that many of you could become awesome in Excel.
- Ankush at ActiKnow Consulting for helping many of our clients with custom Excel solutions.
Our Affiliates:
This year was great for many of our affiliates too. Thanks to their support, we had more customers and they had more revenues. Some of our most prominent affiliates are,
Dashboard Spy, Francis, Daniel Ferry, Debra Dalgleish, Philip, Ken Puls, Oscar, Jimmy Pena, Victor Chan, Alan Murray and many more.
Our Supporters:
Many people selflessly spend their time & energy promoting our cause – to make you awesome. My sincere thanks and love goes to,
Hui, SirJB, BobHC, Luke, Faseeh, Sajan, Narayank and all our Forum regular members & Ninjas.
Special thanks to Fabrice, Robert, Oscar & others who regularly to link to us and spread the good word.
Press:
Special thanks to Kumara Swamy from Telegraph India for featuring me in an article this year.
Customers & Readers
This year, close to 5,000 of you blessed me with your product purchases from us. More than 55,000 of you are now part of our RSS / Newsletter community. Many more continue to join us each day. Thank you so much for inviting me in to your life & taking time to learn from us.
Many thanks to KPMG, Renault Nissan, Ecobank, SEEK, and many other corporate clients for supporting us this year.
I am also thankful to our Excel forum members.
Special thanks to
- Attendees of various live classes conducted by me this year in Perth, Sydney, Melbourne, Brisbane & Chennai.
- People in Sydney, Melbourne, Brisbane & Perth who met me when I was in Australia.
- People in Chennai who met me for coffee.
- Hui & Family, Danielle & Family for sharing some of my evenings very nice and memorable.
Our Staff
Most of what we did at Chandoo.org not even remotely possible without of staff. I am amazed at their level of commitment and support to our mission to make you awesome. My heartfelt thanks to,
- Ravindra: for helping with various training enrollments, emails & customer service
- Vijay: for teaching VBA
- Sameer: for answering student doubts in training programs
- Sujatha: for providing customer care & email support
- Pothi: for taking care of our server & site infrastructure
- Chittibadrayya: for taking care of all the book-keeping & accounting aspect of our business
Special thanks to Neel (our iPhone developer) too.
Websites & Companies that helped me in 2012
I am thankful to Microsoft for making Excel so awesome.
I am also thankful to,
Email & Productivity: Google, iPhone
Website, Hosting & E-commerce: WordPress, GoDaddy, Wishlist Member, KnownHost, Amazon, PayPal, E-Junkie, 2Checkout, EBS
Community & Connection: Twitter, Facebook, Youtube, Skydrive
Software: Paint.NET, Mozy, Notepad ++, Camtasia & Snagit, Skype
There are many other software, companies and websites that help me every day. I am really thankful to each and every one of these. Detailed listing here.
Last but not least…
There is someone else that deserve utmost thanks for everything I do at Chandoo.org.
- My family: Jo & kids support me and Chandoo.org in numerous ways. They shower me with love, humor and support everyday so that I can be awesome at what I do.
- All my close friends & relatives: for supporting me & encouraging me to do better.
PS… something for you:
Here is a nice little surprise for you. Go ahead and download it. Unlock the secret message.
PS: Incase you have difficulty downloading the file, see it in action here.













26 Responses to “Get busy this weekend, with OR XOR AND [Excel Homework]”
first solution for AND
The two numbers are in A1 and B1
= SUBSTITUTE (SUBSTITUTE (A1+B1*9*9, 9, 1), 8, 0)
regards
Stef@n
next solution for OR
=1*SUBSTITUTE (A1+A2;2;1)
regards
Stef@n
last solution for XOR
=1*SUBSTITUTE (A1+A2;2;0)
regards
Stef@n
Or you could make use of the VBA logical operators!
Define the following as custom functions
Public Function BITXOR(x As Long, y As Long)
BITXOR = x Xor y
End Function
Public Function BITAND(x As Long, y As Long)
BITAND = x And y
End Function
Public Function BITOR(x As Long, y As Long)
BITOR = x Or y
End Function
and then use them such:
A B =BITOR(A,B) =BITAND(A,B) =BITXOR(A,B)
0101 0100 0101 0100 0001
an another solution for AND
=1*SUBSTITUTE (SUBSTITUTE (A1+A2;1;0);2;1)
note:
the binary numbers are in A1 and A2 !
regards
Stef@n
I was obviously playing hooky at the beach during the bit-wise math lesson – you lost me at “Understanding bit-wise operations” 🙂
After looking at the above solutions, I find my solution silly, but still:
For the following formulae,
Row 1: headers,
Row 2: OR
Row 3: AND
Row 4: XOR
Column 1: Input 1
Column 2: Input 2
Column 3: Result
OR
{=SUM(IF(MID(A2,ROW(OFFSET($A$1,0,0,LEN(A2),1)),1)+MID(B2,ROW(OFFSET($A$1,0,0,LEN(B2),1)),1)>0,1,0)*10^(LEN(A2)-ROW(OFFSET($A$1,0,0,LEN(B2),1))))}
AND
{=SUM(IF(MID(A3,ROW(OFFSET($A$1,0,0,LEN(A3),1)),1)+MID(B3,ROW(OFFSET($A$1,0,0,LEN(B3),1)),1)=2,1,0)*10^(LEN(A3)-ROW(OFFSET($A$1,0,0,LEN(B3),1))))}
XOR
{=SUM(IF(MID(A4,ROW(OFFSET($A$1,0,0,LEN(A4),1)),1)+MID(B4,ROW(OFFSET($A$1,0,0,LEN(B4),1)),1)=1,1,0)*10^(LEN(A4)-ROW(OFFSET($A$1,0,0,LEN(B4),1))))}
@Anup
Please don't consider your solution silly
Firstly, You are the 3rd person to submit an answer
Secondly, The best formula/function is the one that you know and understand.
I think I have a very tedious solution, which people won't have the patience to do except in small numbers.
I used the same problem setup as "Anup Agarwal"
AND =IF(AND(MID(B2,1,1)="1",MID(C2,1,1)="1"),1,0)&IF(AND(MID(B2,2,1)="1",MID(C2,2,1)="1"),1,0)&IF(AND(MID(B2,3,1)="1",MID(C2,3,1)="1"),1,0)&IF(AND(MID(B2,4,1)="1",MID(C2,4,1)="1"),1,0)
OR =IF(OR(MID(B3,1,1)="1",MID(C3,1,1)="1"),1,0)&IF(OR(MID(B3,2,1)="1",MID(C3,2,1)="1"),1,0)&IF(OR(MID(B3,3,1)="1",MID(C3,3,1)="1"),1,0)&IF(OR(MID(B3,4,1)="1",MID(C3,4,1)="1"),1,0)
=IF(OR(AND(MID(B4,1,1)="1",MID(C4,1,1)="0"),AND(MID(B4,1,1)="0",MID(C4,1,1)="1")),1,0)&IF(OR(AND(MID(B4,2,1)="1",MID(C4,2,1)="0"),AND(MID(B4,2,1)="0",MID(C4,2,1)="1")),1,0)&IF(OR(AND(MID(B4,3,1)="1",MID(C4,3,1)="0"),AND(MID(B4,3,1)="0",MID(C4,3,1)="1")),1,0)&IF(OR(AND(MID(B4,4,1)="1",MID(C4,4,1)="0"),AND(MID(B4,4,1)="0",MID(C4,4,1)="1")),1,0)
Sorry my last post was totally messed up
AND
=IF(AND(MID(B2,1,1)="1",MID(C2,1,1)="1"),1,0)&IF(AND(MID(B2,2,1)="1",MID(C2,2,1)="1"),1,0)&IF(AND(MID(B2,3,1)="1",MID(C2,3,1)="1"),1,0)&IF(AND(MID(B2,4,1)="1",MID(C2,4,1)="1"),1,0)
OR
=IF(OR(MID(B3,1,1)="1",MID(C3,1,1)="1"),1,0)&IF(OR(MID(B3,2,1)="1",MID(C3,2,1)="1"),1,0)&IF(OR(MID(B3,3,1)="1",MID(C3,3,1)="1"),1,0)&IF(OR(MID(B3,4,1)="1",MID(C3,4,1)="1"),1,0)
XOR
=IF(OR(AND(MID(B4,1,1)="1",MID(C4,1,1)="0"),AND(MID(B4,1,1)="0",MID(C4,1,1)="1")),1,0)&IF(OR(AND(MID(B4,2,1)="1",MID(C4,2,1)="0"),AND(MID(B4,2,1)="0",MID(C4,2,1)="1")),1,0)&IF(OR(AND(MID(B4,3,1)="1",MID(C4,3,1)="0"),AND(MID(B4,3,1)="0",MID(C4,3,1)="1")),1,0)&IF(OR(AND(MID(B4,4,1)="1",MID(C4,4,1)="0"),AND(MID(B4,4,1)="0",MID(C4,4,1)="1")),1,0)
@stefan,
I just couldn't get your solutions to work.
01010101010 + 01010101110 = 02020210120
what am i doing wrong?
@anup
...I got yours to work!
@Stephen - I get the same, but Stef@an's second solution for AND does work (at least for the test cases I used)
@ Stephen / Rich
yes , you are right ! - only this works:
OR
=1*SUBSTITUTE (A1+A2;2;1)
XOR
=1*SUBSTITUTE (A1+A2;2;0)
AND
=1*SUBSTITUTE (SUBSTITUTE (A1+A2;1;0);2;1)
@Stef@n - You're answer is really smart, I never knew about the substitute function before. Great Work!
Thx Michael 🙂
yes - it is simply easy 😉
if you add 1 and 1 - excel calculate 2
and then you have to substitute the 2 - new = 0 respectively 1
Here is a good resource for people wanting to learn binary and hexadecimal.
http://justwebware.com/bitwise/bitwise.html
Three that weren't asked for:
NOT
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1+A2,0,3),1,0),3,1)
EQV
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1+A2,0,3),2,3),1,0),3,1)
IMP
=SUBSTITUTE(SUBSTITUTE(A1+SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,0,3),1,0),3,1),0,1),2,0)
(was using Daniel Ferry's bitwise file to verify against)
@ Kyle
Not only takes one parameter and inverts 0 -1 and 1-0
Took out the +A2
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,0,3),1,0),3,1)
Great solutions!
I'll add two:
NAND =1*SUBSTITUTE (A1+A2,2,0)
NOR=1*SUBSTITUTE(SUBSTITUTE (SUBSTITUTE(A1+A2,0,2),1,0),2,1)
This will work for binary numbers of any size (although the text format mask will have to have as many zeroes as there are digits in the longest addend)
Assume binary #s are in C35 & C36, then add and format as text in C37:
=TEXT(C36+C35,"000000000000")
-sum- = 101112211112
AND - SUBSTITUTE 0s for 1s in -sum-, then sub 1s for 2s
=SUBSTITUTE(SUBSTITUTE(C37,"1","0"),"2","1")
OR - sub 1s for 2s in -sum-
=SUBSTITUTE(C37,"2","1")
XOR - sub 0s for 2s in -sum-
=SUBSTITUTE(C37,"2","0")
Just wandered by:
AND:
=SUBSTITUTE(A1+A2,1,0)/2
Clever, Shane. I like that.
[…] post http://www.excelhero.com/blog/2010/01/5-and-3-is-1.html for examples using Sumproduct, and http://chandoo.org/wp/2011/07/29/bitwise-operations-in-excel/ for examples using Text […]
Hi Chandoo,
I am not (yet) really into bitwise calculation, but I am looking for a way to speed up my vba calculation with very big numbers. Would is ben convenient to use bitwise notation for this?
Best regards,
Ronald (the Netherlands)
p.s. love your country!
@Ronald
I'd suggest asking this in the Chandoo.org Forums
https://chandoo.org/forum/
Attach a sample file with an example of some data and describe what you want to achieve