Hello!
I am trying to apply a data validation to a range of cells to restrict the length of the input based on two conditions.
If cell in column B contains text "BAR", then input in cell A cannot be longer than 34 characters.
If cell in column B contains anything else (can be empty as well), then input in cell A cannot be longer than 40 characters.
I used this formula as custom data validation:
=OR(AND(B3="BAR";LEN(A3)>34);LEN(A3)>40)
But it triggers data validation even if input in cell A is only 1 character long now. How can it be corrected?
I am trying to apply a data validation to a range of cells to restrict the length of the input based on two conditions.
If cell in column B contains text "BAR", then input in cell A cannot be longer than 34 characters.
If cell in column B contains anything else (can be empty as well), then input in cell A cannot be longer than 40 characters.
I used this formula as custom data validation:
=OR(AND(B3="BAR";LEN(A3)>34);LEN(A3)>40)
But it triggers data validation even if input in cell A is only 1 character long now. How can it be corrected?