Excel – Only Add Odd Or Even Numbers To A Cell

data validationmicrosoft excel

I want to create a cell in and Excel spreadsheet that can only have Even numbers entered into it and also one just for Odd numbers. Any ideas what formula I can put into the Data Validation formula to be able to do this. Thank you.

Best Answer

In the cells you want to check for even set the data validation to custom, then in the formula

=NOT(MOD(A2,2))

check odd numbers in the same way with the formula

=MOD(A3,2)

of course adjusting the cell address, the style, and Error Alert you want in response