Which formula can be used to prevent leading or trailing spaces in a data validation rule?
- A\text{=TRIM(A1)=A1}
- B\text{=LEN(A1)>10}
- C\text{=ISNUMBER(A1)}
- D\text{=WEEKDAY(A1)<>1}
Solution & Step-by-step Explanation
The TRIM function automatically strips away all leading and trailing whitespaces from a string. By setting a custom data validation rule to check if =TRIM(A1)=A1, Excel ensures that the user's raw input matches the trimmed version. If there are leading or trailing spaces, the logical condition returns FALSE, triggering an error and blocking invalid data entry.