Based on @mikekaganski’s answer at Calc: How to specify formula for custom data validity? - #2 by mikekaganski, I tried to write a validity formula matching the newline in a cell, for example:
1
2
This works as a validity formula:
NOT(ISERROR(SEARCH("2";A2)))
And this works as a spreadsheet formula but not a validity formula.
=NOT(ISERROR(SEARCH(CHAR(10);A2)))
Any idea why it does not work, or if there is a way to make it work?
Apparently newlines are handled at least to some extent, because this works:
NOT(ISERROR(SEARCH(CHAR(10);"1" & CHAR(10) & "2")))
The problem comes from my attempted answer at https://superuser.com/a/1657145/541756.