The ISODD function in Excel is an Information formula that returns TRUE if the number argument is an odd number, or FALSE if it's even, thereby providing a simple yet effective way of distinguishing between odd and even numbers. You can test the result of a formula or value of a cell using this function. In this guide, we’re going to show you how to use the ISODD function and also go over some tips and error handling methods.

 

Supported versions

  • All Excel versions

 

ISODD Excel Function Syntax

The syntax for the ISODD function is quite straightforward:

ISODD(number)

number: This is the sole argument for the ISODD function and represents the number you want to test for being odd.

 

Examples

The ISODD function, just like the other "IS" functions, only requires a single argument as an input. The function returns a TRUE logical value if the number argument is an odd number. If the number has decimals, the ISODD function truncates the number argument. A common use case of this function is testing the value of cell or value that is returned by a formula.

=ISODD(1) returns TRUE

=ISODD(2) returns FALSE

Download Workbook

Highlight Odd Numbers Using ISODD Function with Conditional Formatting

Using the ISODD function in conditional formatting in Excel allows you to visually differentiate odd numbers from even numbers in a dataset. This can be particularly useful in large spreadsheets where such distinctions can help in data analysis or simply improve readability. Here’s how you can apply the ISODD function in conditional formatting:

  1. Select Your Data Range: First, select the cells or range where you want to apply the conditional formatting. This could be a column, a row, or a specific set of cells in your spreadsheet.
  2. Access Conditional Formatting: Go to the ‘Home’ tab on the Excel ribbon. Click on ‘Conditional Formatting’ in the ‘Styles’ group.
  3. Create a New Rule: In the dropdown menu, choose ‘New Rule’ to open the New Formatting Rule dialog box.
  4. Choose a Rule Type: Select ‘Use a formula to determine which cells to format’.
  5. Enter the ISODD Formula: In the formula field, enter the ISODD function applied to the first cell of your selected range. For example, if your selected range starts at A1, you would enter =ISODD(A1). This formula will be applied to each cell in the selected range, checking if each value is odd.
  6. Set the Format: Click on ‘Format’ to open the Format Cells dialog box. Choose the formatting options (like font color, cell color, etc.) that you want to apply to cells containing odd numbers. Click ‘OK’ to close the Format Cells dialog box.
  7. Finalize the Rule: Click ‘OK’ in the New Formatting Rule dialog box to apply the rule to your selected range.

Once applied, the conditional formatting rule will automatically highlight all the cells with odd numbers in your selected range according to the format you specified. As you update or add data in the range, the formatting will adjust in real-time, highlighting any new odd numbers that are entered.

Error Handling in ISODD Function

#VALUE! Error: The most common error that the ISODD function encounters is the #VALUE! error. This error occurs when the input to the ISODD function is not a valid numeric value. Since ISODD is intended to work with numbers, any non-numeric input, such as a text string or a cell reference that does not contain a number, will result in this error.

If you input =ISODD("Text") or =ISODD(A1) where A1 contains text, the function will return a #VALUE! error because "Text" or the content of A1 is not a number. To manage this and prevent your spreadsheet from displaying error values, you can use error handling functions like IFERROR or ISERROR. For example: =IFERROR(ISODD(A1), "Invalid Input") – This formula will return "Invalid Input" instead of an error if A1 contains a non-numeric value.

Error handling is particularly important when the ISODD function is part of a larger formula or when the function's input comes from user input or other uncertain sources. By anticipating and managing potential errors, you ensure that your spreadsheet remains clean, professional, and user-friendly.

 

Tips

  • You can use the ISODD function for the logical test component of an IF function.
    =IF(ISODD(A1),"Odd number","Even number")
  • If the number is not a whole number, the ISODD function truncates the numeric value.
  • Excel keeps date and time values as numbers. Excel assumes that Jan 1st, 1900 is 1, and every subsequent date value is based on this. While whole numbers represent days, decimals represent time values. For example; 1/1/2018 is equal to 43101, and 12:00 is equal to 5. Because of this, the ISODD function counts date time values as numbers.
  • Below is a list of other IS… functions:
    • ISBLANK to test blank cells
    • ISERR to test error values except #N/A
    • ISERROR to test all error values
    • ISNA to test #N/A error value specifically
    • ISNUMBER to test numbers
    • ISTEXT to test any item that is a text
    • ISNONTEXT to test any item that is not a text
    • ISEVEN to test even numbers
    • ISREF to test if a formula returns a reference