What is the ISODD function?
=ISODD(number)ISODD returns TRUE if a number is odd. It is most often used inside IF to treat values differently.
Column A of the sheet mixes text, numbers, a blank, a logical value, errors and text that looks like a number; column B says what each is. Column C shows the same formula copied down.
ISODD splits items into two groups by odd and even numbers, or shades every other row with conditional formatting. Decimals are judged by their integer part, so 2.5 counts as 2 and returns FALSE.
Arguments
- number
- The value or cell to test.
ISODD examples
Example 1. Check for odd
=ISODD(A9)-7 is odd, so TRUE.
Example 2. Shade every other row
=ISODD(ROW())Use it in conditional formatting to color odd rows.
Example 3. Results for different values
=ISODD(A2)A blank cell counts as 0, so it is FALSE.
A2 =ISODD(A2) 3 TRUE 4 FALSE 2.5 FALSE -7 TRUE Blank FALSE Example 4. Split into two teams
=IF(ISODD(A2), "Team A", "Team B")Odd ticket numbers go to Team A and even ones to Team B.
Common mistakes
Passing text
Anything that is not a number returns #VALUE!.
Decimals
Only the integer part counts. 2.5 is treated as 2, so FALSE.
Where the table starts
With =ISODD(ROW()) in conditional formatting, a table whose data starts on row 2 leaves its first data row unshaded. Use ISEVEN(ROW()) to shade from the first row.
FAQ
- Even numbers?
- Use ISEVEN.
- Negative numbers?
- They work. -7 is odd.
- Can MOD do the same?
- =MOD(A2, 2)=1 also works. MOD(-7, 2) is 1, so negative odd numbers are TRUE too.