0

I have to restrict some invalid data in a Excel Column.

Below is Validation Criteria:

  • Should be a numeric Number
  • Size/Length should be equals to 9

Ex : valid:602005514, invalid:were,43456 etc.

I have created a Custom Data Validation using below function.

=AND(LEN(INDIRECT(SUBSTITUTE(ADDRESS(ROW(),COLUMN()),"$","")))=9,
     ISNUMBER(INDIRECT(SUBSTITUTE(ADDRESS(ROW(),COLUMN()),"$","")))) 
 //here i have to get cell name dynamically. so, i have used ADDRESS function

But its not working as expected. It is not allowing any value in cell. I guess it might be because of LEN function circular reference.

I have tried many ways, but not able to solve it. Please help me to solve this.

4 Answers 4

2

You don't need to resort to INDIRECT etc, in you formula just refer to top left cell in the range you are applying the validation.to. Excel will adjust for the othger cells in the range. When entering cell references don't use absolute references, ie no $'s

Eg select a range starting at cell A1, and set data validation formula to

=AND(ISNUMBER(A1),LEN(A1)=9)
Sign up to request clarification or add additional context in comments.

Comments

0

Check this simple validation .. checking Cell D13 ..

=IF(LEN(D13)=9,IF(ISNUMBER(D13),"yes","no"),"no")

Comments

0

Another way:

=AND(ISNUMBER(A1),A1>99999999)

Comments

0

Make sure there are no leading or trailing spaces in the cell:

=IF(TRIM(A3)=A3,TRUE,FALSE)   

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.