## Thursday, November 3, 2011

### Odds and Evens

When I was in grade school, there was a popular gambling game amongst us boys that involved guessing “Odds” or “Evens” regarding the number of marbles the other boy held in his closed fist. Judging by how many times I spent my allowance on buying new sacks of marbles, I apparently wasn’t very good at the game.

When working with databases or tables, there are many instances when you wish to Identify and Sort whether the number is Odd or Even. Cases may involve street addresses, employee ID numbers, statistical studies, and several other pursuits.

So what is a Good Formula for identifying an Odd or Even number? As with so many things in Excel, there are several ways to do this, but the following are among the most straight-forward. Assuming your data is in Column A, you could use this formula and copy down your range:

1. =IF((ISEVEN(A1) = TRUE), "Even", "Odd") This IF formula incorporates the ISEVEN function to generate the desired results.

~ Or ~

2. =IF(MOD(A1,2)=0,"Even","Odd") This IF formula incorporates the MOD function to generate the results. MOD is an unusual function that finds the Remainder when you divide one figure by another.

Odds and Evens: There are times when knowing this information can be a Boon to your data analysis needs.

Cheers!

#### 1 comment:

kmac said...

Bob, I found dividing lists into odd and even VERY useful.
I was working on campaigns where we had to put together lists for knocking on doors (walk lists), so it was important to divide them up into separate sheets for odd and even, so canvassers could walk down one side of the street, then another (or two people working the same street).
I did it the same way you describe, except I had the two functions (IF and ISEVEN-or ISODD) separate as a part of a macro to clean up the raw list and then export it to Access for a nice report.
Keep up the good work!
Kevin McLogan