Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I ensure

  1. only integers
  2. with no duplicated values

can appear in a column in Excel 2007?

share|improve this question

1 Answer 1

You check for duplicated values using something similar to the answers received in your question yesterday, then also check that the value is an integer.

Using A as the column, select A2 through as far in column A as you care about, then go to the Data Validation dialog. Choose custom and input the following formula:

=IF(ISNA(VLOOKUP(A2,A$1:A1,1,FALSE)),IF(INT(A2)=A2,TRUE,FALSE),FALSE)

As someone mentioned in your other question, this will only work for input values, not dragged ones.

NOTE: The standard column choosing method of A:A doesn't appear to work in this scenario because apparently the code always sees the cell itself as a duplicate (of itself), so it always fails.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.