Today I will be showing how you can decide whether a number is even or odd using the ISEVEN function of Excel. This function helps us to define even or odd numbers.
Excel ISEVEN Function Overview
Let’s start with the basic description of the ISEVEN function.
- Function Objective:
The ISEVEN function is used to return TRUE if a number is even, otherwise returns FALSE.
The Syntax of the ISEVEN function is:
|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.|
- Return Value:
Returns TRUE if the argument is an even number, and FALSE if the argument is an odd number.
The ISEVEN function was introduced in the Excel 2003 version and is available for versions after that.
The ISEVEN function works for all numbers including positive and negative integers, positive and negative fractions, and zero.
- Additionally, the ISEVEN function works for blank cells (It returns TRUE for a blank cell).
- However, 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.
Now I will show you 2 examples of how you can use the ISEVEN function of Excel. Look at the dataset below. We have the Student IDs and Student Names of some students.
1. Dividing in Groups Using the ISEVEN Function in Excel
In the first example, 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.
To do that, follow the steps given below.
- Firstly, enter the formula in Cell D5.
- Secondly, press Enter and drag down the Fill Handle tool to autofill this formula for the rest of the cells.
- Thus, all the students will be divided into 2 groups.
🔎 How Does the Formula Work?
- In the beginning, ISEVEN(B5) returns TRUE if the number in Cell B5 is even, otherwise FALSE.
- Then, IF(ISEVEN(B4),”A”,”B”) —-> the IF function returns “A” for a TRUE, and “B” for a FALSE.
2. Using Conditional Formatting & ISEVEN Function to Highlight Each Alternating Row
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.
- Firstly, select all the cells of the data set and go to the Home tab >> click on Conditional Formatting.
- Then, select the New Rule option.
- After that, in the New Formatting Rule box, select Use a formula to determine which cells to format.
- Next, insert this formula:
- Then, click on Format.
🔎 How Does the Formula Work?
- As we selected all the cells in the table (B5 to D12) before applying the formula ISEVEN(ROW(B4)), it will go to all the cells from B5 to D12 and copy the formula.
- The ROW function will return the Row number.
- Here, 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.
- Now, from the Format Cells dialogue box, choose any format. Here, I choose light ash from the tab Fill.
- Lastly, click OK.
- Again, click OK.
- Finally, you will find the alternating rows in the table highlighted like this.
Common Errors with Excel ISEVEN Function
|Error||When They Show|
|#Value!||When the argument number is of the wrong data type, like text, array, etc.|
In the article, you will find an Excel workbook like the image given below to practice on your own.
Download Practice Workbook
You are welcome to download the practice workbook from the link below.
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.