LibreOffice - Data - Validity - Criteria - How to use formula option?

In LibreOffice Calc, i need to find a way to validate if entered data has more then one line.

I check this: https://help.libreoffice.org/7.1/en-US/text/scalc/01/12120100.html

But there is no description how to use "Formula" ?

Could somebody help me in finding a way to do that ?

enter image description here

enter image description here

enter image description here


Solution 1:

Here is a basic validity formula example. It works even if 1 is after a newline in the cell.

NOT(ISERROR(SEARCH("1";A2)))

This works as well.

NOT(ISERROR(SEARCH(CHAR(10);"1" & CHAR(10) & "2")))

Also when entered as a normal formula in the spreadsheet, this works.

=NOT(ISERROR(SEARCH(CHAR(10);A2)))

So this should work as a validity formula, right? Sadly no, it doesn't.

NOT(ISERROR(SEARCH(CHAR(10);A2)))