Today I will be showing how you can decide whether a number is even or odd using the ISEVEN function of Excel.
Excel ISEVEN Function (Quick View)
Download Practice Workbook
Excel ISEVEN Function: Syntax and Argument
- Returns TRUE if a number is even, otherwise returns FALSE.
- Available from Excel 2003.
The Syntax of the ISEVEN function is:
|Argument||Required or Optional||Value|
|number||Required||The number which we need to differentiate as EVEN or ODD. Can be any number or reference of a cell having a number.|
- The ISEVEN function works for all numbers including positive and negative integers, positive and negative fractions and zero.
- The ISEVEN function even works for blank cells (It returns TRUE for a blank cell).
- The ISEVEN function does not work for arrays, even if it is an array of numbers. In the case of arrays, it will raise #VALUE! error.
Returns TRUE if the argument is an even number, and FALSE if the argument is an odd number.
Excel ISEVEN Function: 2 Examples
Now I will show you 3 examples of how you can use the ISEVEN function of Excel.
1. Dividing a Group of Students into Two Sections Using ISEVEN Function
Look at the data set below. We have the Student IDs and Student Names of some students of Sunshine Kindergarten.
Now we will divide the students into two groups, A and B.
Students with even IDs will go to group A.
And students with odd IDs will go to group B.
Enter this formula in the first cell:
Then double click on the Fill Handle to fill the rest of the cells.
Explanation of the Formula
ISEVEN(B4)returns TRUE if the number in cell B4 is even, otherwise FALSE.
IF(ISEVEN(B4),"A","B")returns “A” for a TRUE, and “B” for a FALSE.
- Same for the rest of the cells.
|IF(ISEVEN(B4),”A”,”B”)||B||First returns a TRUE if the number in cell C4 is even, otherwise returns a FALSE. Then returns “A” for a TRUE, and “B” for a FALSE.|
2. Using ISEVEN Function to Highlight Each Alternating Row (Creating Zebra Striping)
You can use the ISEVEN function of Excel to highlight each alternating row in a table in an Excel file.
To do that, you have to apply the formula in Conditional Formatting, not in the Formula Bar.
Let us do it with the table in example 1.
Select all the cells of the data set and go to Home>Conditional Formatting>New Rule from Excel Toolbar.
Then in the New Formatting Rule box, select Use a formula to determine which cells to format. And then insert this formula:
Then click on Format. Then from the Format Cells dialogue box, choose any format.
I choose light ash from the tab Fill.
Then click OK.
You will find the alternating rows in the table highlighted like this.
Explanation of the Formula
- As we selected all the cells in the table (B4 to D20) before applying the formula ISEVEN(ROW(B4)), it will go to all the cells from B4 to D20 and copy the formula.
For example, in cell C4, it will apply the formula ISEVEN(ROW(C4)), in cell D4 it will apply the formula ISEVEN(ROW(D4)) and so on.
- For the cells, where the formula returns a TRUE, it will apply the selected format (light ash fill), and for the cells where it returns FALSE, no format will be applied.
- Only in the rows with even numbers, the formula returns a TRUE. Thus the alternating rows are highlighted.
Common Errors with the Excel ISEVEN Function
|Error||When They Show|
|#VALUE!||When the argument number is of the wrong data type, like text, array, etc.|
Thus you can use the ISEVEN function of Excel to check whether a number is even or odd. Do you have any problems? Feel free to ask us.
- How to Use ISLOGICAL Function in Excel (4 Examples)
- How to Use ISTEXT Function in Excel (3 Examples)
- How to use ISNA function in Excel (4 Examples)
- How to Use ISODD Function in Excel (With 4 Examples)
- How to Use ISNUMBER Function in Excel (7 Examples)
- How to Use ISBLANK Function in Excel (2 Examples)
- How to Use ISERROR Function in Excel (With 5 Examples)