• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel data validation

Nitesh Khot

Member
Hi..

I want to restrict data entry from user where User enter mobile no then it should be start with either "7" or "8" or "9" and length of mobile no is 10 digit with no duplicity in range(A1:A10)..

I have used below formula in data validation it works fine but i am unable to restrict no start from "7" or "8" or "9"

formula is :-

=AND(ISNUMBER(A1),LEN(A1)=10,COUNTIF($A$1:$A$18,A1)<=1)
 
Thanks deepak,

its working fine as below few changes..

=AND(ISNUMBER(H1),LEN(H1)=10,COUNTIF($H$1:$H$18,H1<=1,LEFT(H1,1)>"6")
 
Hi Nitesh ,

You should be aware that the formula will also pass a decimal number such as :

72345.6789

If you wish to exclude decimal numbers , you will have to include one more check in the formula.

Narayan
 
Hi Nitesh,

This should work:
=AND(COUNTIF($H$1:$H$18,H1)<=1,$H1>6999999999)

Regards,

Edit: oops, missed the check for NUMBER, revised:
=AND(ISNUMBER($H1),COUNTIF($H$1:$H$18,H1)<=1,$H1>6999999999)
 
Hi Narayan Sir,
Thanks,

There must be a reason you've advised to retain the check.
I am interested to know / learn.

Regards,
 
In your approach numbers with decimal like 8888888888.8 will also get accepted as its > 6999999999

Deepak Sir,
Thanks, got your point.

OP needs the length of exact 10 digits, my formula fails when the length is more than 10 digits. [forgot the basic thing, how stupid I am today]
 
Back
Top