The ISEVEN function in Google Sheets is categorized under the math functions. Use this function to check whether a cell contains an even integer, returning TRUE or FALSE based on the value.
You can apply ISEVEN in data analysis and combine it with other functions in formulas. This tutorial explains how to use this simple function.
Syntax
ISEVEN(value)
Here, the argument “value” can be a number or a date. When using a date, it is converted to its serial number, and the function checks if that number is even.
Examples of Using ISEVEN in Google Sheets
The formula below will return TRUE because the number is even:
=ISEVEN(12)
If cell A1 contains 12, you can apply this formula as =ISEVEN(A1)
.
An odd number will return FALSE, but what about using a date?
My system date today is 26/09/2018. See the formula below:
=ISEVEN(TODAY())
This returns FALSE because the serial number for the provided test date is an odd number.
If you enter the date in a cell and apply Format > Number, it will show 43369, which is an odd number.
Can You Use ISEVEN with an Array or Range?
Yes, ISEVEN can be applied to a range of values. Here’s an example:
=ArrayFormula(ISEVEN(A2:A9))
While ISEVEN is not an array formula itself, you need to combine it with ArrayFormula. However, this is not necessary when using ISEVEN with other array functions like SUMPRODUCT, FILTER, INDEX, SORT, or SORTN.
Note: The ISEVEN function referencing an empty cell will return TRUE since the value in an empty cell is 0. Zero divides evenly by 2 without a remainder, so we consider it even.
Using ISEVEN for Filtering
This formula filters only even numbers in the given range:
=FILTER(A2:A9, ISEVEN(A2:A9))
The FILTER function checks if the condition ISEVEN(A2:A9)
is TRUE for the given range.
Applying ISEVEN for Conditional Formatting
Users commonly apply ISEVEN in conditional formatting. You can use it to apply alternating colors to selected rows.
For example, to apply alternating colors in the range A2:Z100:
- Select the range and go to Format > Conditional formatting.
- Under Format cells if, select Custom formula is and apply this formula:
=ISEVEN(ROW($A2))
Note: Alternating colors can also be applied without a formula via Format > Alternating colors.
Combining ISEVEN with an IF Logical Statement
Test whether a value is even using IF and perform different actions:
=IF(ISEVEN(A1), "even", "odd")
In this formula, you can replace “even” and “odd” with other calculations based on the value in A1.
Practical Applications of ISEVEN in Google Sheets
Here’s an example demonstrating the usefulness of ISEVEN in certain data manipulation tasks.
The data shows the present/absent status of an employee and their overtime hours. Some cells (e.g., C6, C10, and C12) are missing the text “OT,” even though they contain overtime hours.
To filter out the overtime hours, use the following formula:
=FILTER(B3:H12, ISEVEN(ROW(A3:A12)))