Excel / Test Even and Odd Numbers with ISEVEN and ISODD

Use ISEVEN to test whether a number is even and ISODD to test whether it is odd. Both return TRUE or FALSE. For a decimal input, Excel drops the fractional part before testing, so check for an integer first if you want to exclude decimals.

ISEVEN and ISODD syntax

Each function takes one number or a reference to a cell containing a number. The formulas below test whether A2 is even and whether it is odd. You can also pass the logical result to IF to display a label.

=ISEVEN(A2)
=ISODD(A2)

Microsoft’s ISEVEN reference

Microsoft’s ISODD reference

Results for zero, negatives, and decimals

Enter the following inputs starting at A2. Put the ISEVEN formula in B2 and the ISODD formula in C2, then fill down. The second column of the table shows the integer tested.

Even and odd results by input
Input Integer tested ISEVEN ISODD
0 0 TRUE FALSE
3 3 FALSE TRUE
-3 -3 FALSE TRUE
2.9 2 TRUE FALSE
-3.9 -3 FALSE TRUE
-0.8 0 TRUE FALSE

Zero is even because it is divisible by two. Excel drops the fraction from -3.9 and tests -3. It drops the fraction from -0.8 and tests zero, so ISEVEN returns TRUE.

Display Even or Odd with IF

If A2 always contains an integer, use IF to display a readable label.

=IF(ISEVEN(A2),"Even","Odd")

If the input may include decimals, blanks, text, or errors, first check it with ISNUMBER. For numeric inputs, compare the value with its truncated version from TRUNC before assigning a label.

=IF(ISNUMBER(A2),IF(A2=TRUNC(A2),IF(ISEVEN(A2),"Even","Odd"),"Not an integer"),"Not a number")

For example, -3 gives “Odd,” -3.9 gives “Not an integer,” and a blank or a 2 stored as text gives “Not a number.” Keep date columns out of this classification because Excel can store dates as numbers.

Excel uses commas or semicolons between arguments depending on regional settings. If the formula is rejected, check the separator and the function names for your installation.

Microsoft’s reference for the IS functions

When to use EVEN and ODD

ISEVEN and ISODD return a logical value. EVEN and ODD return integers. For example, ISEVEN(3) returns FALSE while EVEN(3) returns 4. When rounding is needed, EVEN and ODD round away from zero.