ISEVEN Function Examples – Excel, VBA, & Google Sheets
Download the example workbook
This tutorial demonstrates how to use the ISEVEN and ISODD Functions to test if numerical values are odd or even in Excel and Google Sheets.
ISEVEN Function Overview
The ISEVEN Function Test if cell value is even. Returns TRUE or FALSE.
To use the ISEVEN Excel Worksheet Function, select a cell and type:
(Notice how the formula inputs appear)
ISEVEN Function Syntax and Inputs:
=ISEVEN(number)
value – The test value
How to use the ISEVEN and ISODD Functions
The ISEVEN Function tests if a numerical value is even. If it’s even, the function returns TRUE, otherwise it returns FALSE.
=ISEVEN(A2)
The ISODD Function does the opposite.
=ISODD(A2)
Alternate Row Shading
The most common uses of the ISEVEN and ISODD Functions are to shade alternate rows using Conditional Formatting.
To do this, you will use the formula:
=ISEVEN(ROW()))
within Conditional Formatting:
- Select all the cells to shade
- Go to Home Ribbon > Conditional Formatting > New Rule
- Select ‘Use a formula to determine which cells to format‘
- Enter the formula =ISEVEN(ROW())
- Click the Format button and choose your desired formatting
- Click OK twice to quit and save.
=ISEVEN(ROW())
You can add a second conditional formatting rule to also shade the ODD Rows
=ISODD(ROW())
ISEVEN in Google Sheets
The ISEVEN Function works exactly the same in Google Sheets as in Excel:
ISEVEN Examples in VBA
You can also use the ISEVEN function in VBA. Type:
Application.Worksheetfunction.Iseven(number)
For the function argument (number), you can either enter them directly into the function, or define variables to use instead.