Forum Discussion
Data Validation with AND and OR
- May 06, 2020
Try Below formula
=OR(EXACT(LEFT(I5,3),"A R"),AND(EXACT(LEFT(I5,1),"A"),LEN(RIGHT(I5,LEN(I5)-1))=9,ISNUMBER(RIGHT(I5,LEN(I5)-1)*1)))
I am using a different language version of Excel if this doesn't work please rewrite the formulas I gave on my first post seperately to be sure they run correctly and then combine them.
First codition starts with A, followed by 9 digit number:
=EXACT(LEFT(I5;1),"A")
=LEN(RIGHT(I5,LEN(RIGHT(I5)-1))=9
=ISNUMBER(RIGHT(I5,LEN(RIGHT(I5)-1)*1)
Combine them all wiht AND
=AND(EXACT(LEFT(I5,1),"A"),LEN(RIGHT(I5,LEN(RIGHT(I5)-1))=9,ISNUMBER(RIGHT(I5,LEN(RIGHT(I5)-1)*1))
Then combine this with "A R" condiytion with OR
=OR(EXACT(LEFT(I5,3),"A R");AND(EXACT(LEFT(I5,1),"A"),LEN(RIGHT(I5,LEN(RIGHT(I5)-1))=9,ISNUMBER(RIGHT(I5,LEN(RIGHT(I5)-1)*1)))
- erol sinan zorluMay 06, 2020Iron Contributor
Hi,
Replace any ";" with "," please. I am using different language settings and in this settings we are using ";". Best regards,
- Eric_MarcusMay 06, 2020Copper Contributor
Thank you erol (and sorry for misspelling your name in my last post -- MS autocorrected). I replaced the one ; with , but it still was not accepted. Any other thoughts? Thanks again!
- erol sinan zorluMay 06, 2020Iron Contributor
Try Below formula
=OR(EXACT(LEFT(I5,3),"A R"),AND(EXACT(LEFT(I5,1),"A"),LEN(RIGHT(I5,LEN(I5)-1))=9,ISNUMBER(RIGHT(I5,LEN(I5)-1)*1)))
I am using a different language version of Excel if this doesn't work please rewrite the formulas I gave on my first post seperately to be sure they run correctly and then combine them.