Syntax. ISODD(number)
Definition. This function returns TRUE
if the number argument is an odd number. If the argument is an even number, the function returns FALSE
.
number (required). The expression to be checked
Background. You can pass any expression as an argument to this function. Integers are treated as expected. If you pass a decimal number, the decimal places are truncated. =ISODD(2.4)
returns FALSE
, and =ISODD(-1.6)
returns TRUE
.
If the argument cannot be evaluated, the function returns the #VALUE!
error for strings and logical values.
The counterpart to this function is the ISEVEN() function:
ISODD(number)=NOT(ISEVEN(number))
Example. You can use the example for the ISEVEN() function and format the rows with odd row numbers in a color. In Excel 2003 and earlier versions, you must replace the validation formula with
=NOT(INT(ROW(cell)/2)=ROW(cell)/2)
Sample Files
Use the ISODD worksheet in the Information.xls or Information.xlsm sample file. The sample files are found in the Chapter11 folder. For more information about the sample files, see the section titled Using the Sample Files.
3.133.126.199