How to write a formula to identify even and odd numbers from two cells (A1 & B1) into one cell (C1)?

arthurz11

Board Regular
Joined
Nov 9, 2007
Messages
81
Office Version
  1. 2021
Platform
  1. Windows
In Cell A1, can be any numbers from 0 to 3.
In Cell B1, can be any numbers from 0 to 3.
In Cell C1, the answer should be any four options. Depending on the numbers entered in A1 and B1:
EE, or OO, or EO, or OE.
E for Even and O for Odd number.
Example:
If A1 = 1 and B1 = 1. C1 the answer is "OO"
If A1 = 2 and B1 = 2. C1 the answer is "EE"
If A1 = 2 and B1 = 3. C1 the answer is "EO"
If A1 = 1 and B1 = 2. C1 the answer is "OE"
If A1 = 0 and B1 = 2. C1 the answer is "EE" (Note: zero is considered an even number)

In Cell C1, I have used =IF(AND(MOD(A1,2)=1,MOD(B1,2)=1),"OO","EE") but this "ONLY" works if both numbers or even or odd.
How do I combine the formula to include EO or OE? So if it's not EE or OO, it can be EO. or vice versa, OE?
 
Glad we could help & thanks for the feedback.
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,215,377
Messages
6,124,597
Members
449,174
Latest member
chandan4057

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top