A custom validation rule uses a formula that must return TRUE for the entry to be accepted. It lets you check complex conditions, such as the uniqueness of a value or the dependency between two cells. The formula is written relative to the first cell of the targeted range.
Example
=NB.SI($A:$A;A2)=1 // rejects a duplicate in column A