I have a use case where I want to put in the following data validation in a cell:
apple,banana
is valid since length of apple
and banana
is <= 6 but apple,avacado
is invalid since length of avacado
> 6I am currently using the following:
=AND(LEN(A1)<=100, LEN(A1)-LEN(SUBSTITUTE(A1, ",", ""))<=10)
I am not sure how I can I add the length restriction for individual substring. I hope I have added all the details.
=AND(AND(LEN(TEXTSPLIT(A1,","))<=6),LEN(A1<=100),COUNTA(TEXTSPLIT(A1,","))<=10)
String length 100 or less symbols. Less or equal to 10 words (separated by comma). Every separate word is 6 or less symbols. Spaces are included in every case.