I'm struggling to get this to work. Basically, I'm trying to create an excel formula that will look at a value e.g. RFC12345678 and return whether the format is valid or not. The conditions are:
If it meets those conditions, return "Valid", if not, return "Invalid".
Use AND()
with three checks:
=IF(AND(LEN(A1)=11,LEFT(A1,3)="RFC",ISNUMBER(--RIGHT(A1,8))),"Valid","Invalid")
RFC123456789
does not return TRUE;RFC
in the beginning;If your check needs to be case-sensitive, change to:
=IF(AND(LEN(A1)=11,EXACT(LEFT(A1,3),"RFC"),ISNUMBER(--RIGHT(A1,8))),"Valid","Invalid")