Вопрос

I currently have a column called "MAC Address" - it is not a required field as some pieces of gear do not have an address, but unique values are enforced. If a user puts in an address I want to (at minimum) verify that the format is correct. I currently have the following in the "Column Validation".

=(LEN([MAC Address])=17) +(MID([MAC Address],3,1)=":") +(MID([MAC Address],6,1)=":") +(MID([MAC Address],9,1)=":") +(MID([MAC Address],12,1)=":") +(MID([MAC Address],15,1)=":")=6

However, with every new entry, it flags it as an error because an empty field does not solve this formula. From the pieces I have read online it might be solved with an "OR" or "ISBLANK", but I can't get the right syntax.

Can someone please tell me how to add the additional coding to make this only trigger if the field is NOT blank. Thanks so much!

Это было полезно?

Решение

Just add ISBLANK to your formula like this:

=IF(ISBLANK([MAC Address]),6,(LEN([MAC Address])=17) +(MID([MAC Address],3,1)=":") +(MID([MAC Address],6,1)=":") +(MID([MAC Address],9,1)=":") +(MID([MAC Address],12,1)=":") +(MID([MAC Address],15,1)=":"))=6

UPD: or

=OR(ISBLANK([MAC Address]),AND(LEN([MAC Address])=17,MID([MAC Address],3,1)=":",MID([MAC Address],6,1)=":",MID([MAC Address],9,1)=":",MID([MAC Address],12,1)=":",MID([MAC Address],15,1)=":"))
Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top