DATA VALIDATION

A

aditya

data in column B is of 9 or 10 or 11 or 12 digit.
In every case it contains alphabet "P" whereas others are digit.
e.g. 10P060509
125P695847

how can i check this through data validation?
 
E

Ed Ferrero

HI aditya,
data in column B is of 9 or 10 or 11 or 12 digit.
In every case it contains alphabet "P" whereas others are digit.
e.g. 10P060509
125P695847

how can i check this through data validation?

Use a custom validation formula like;
=AND(LEN(B1)>8,LEN(B1)<13,ISNUMBER(FIND("P",B1)),NOT(ISERROR(VALUE(IF(LEN(B1)=FIND("P",B1),0,RIGHT(B1,LEN(B1)-FIND("P",B1)))))))
(all on one line)

This evaluates as True if the length of the string is between 9 and 12
charachters, and the string contains exactly one 'P' and all other
charachters are numeric.

Ed Ferrero
www.edferrero.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top