Excel: Worksheet Function to Determine if Integer Even or Odd

ID: Q61274


The information in this article applies to:


SUMMARY

The following is a worksheet formula to determine whether an integer in cell A1 is even:


   =IF(MOD(A1,2)=0,"even","odd") 


Note that if cell A1 is empty, this formula will return "even". If A1 contains a text value, a #VALUE! error will be returned.

Additional query words: 2.00 2.01 2.10 2.20 2.21 2.0 2.1 2.2 3.0 4.0


Keywords          : 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: March 16, 1999