Excel: Worksheet Function to Determine if Integer Even or Odd

ID: Q61274


The information in this article applies to:
  • Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 4.0a, 5.0
  • Microsoft Excel for OS/2 versions 2.2, 2.21, 3.0


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
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.