Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Something in Excel? – jonsca Jun 16 '11 at 20:33
since people are commenting that the topic is not clear, even though the tag says data-validation, you might add excel into the question, if it is an excel question. – datatoo Jun 16 '11 at 21:04
Voting to reopen since he clarified the question – Darth Android Jun 16 '11 at 21:44
Divide each value by two and if there is a remainder you know it is Odd, if no remainder, even. – music2myear Jun 16 '11 at 21:46

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


check odd numbers in the same way with the formula


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

share|improve this answer
Thank you. It worked. – gibson62 Jun 17 '11 at 21:23

Here's an alternative that uses Excel's Odd and Even functions. Assuming you are validating for even in A2 and Odd and A3. Enter these as Custom formulas in the Data Validation dialog:

share|improve this answer
these do produce odd or even results, but change them for the user, rather than demanding they enter either and odd or even value. perhaps that is enough for the situation, but seems error prone – datatoo Jun 18 '11 at 16:00
@ datatoo I've edited my answer to clarify that these would be entered as Custom formulas in the Data Validation dialog. I thought that was assumed since it's what the OP asked for. – Doug Glancy Jun 19 '11 at 2:02
you were right to assume that, since that was the question, sorry – datatoo Jun 19 '11 at 17:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .