need (fix Your formula in bold
In your case, the rule will apply provided that A1 (cell A1) and simultaneously the maximum and the minimum (rule logical And), and this is possible only under the condition that all numbers in the range are equal.
In my version if the minimum or the maximum (logical OR)
In General, the standard rules of conditional formatting select the first 10 elements for the maximum and the last 10 elements for the minimum and set the number of desired values =1
Thus rendered the smallest and largest
According to the first embodiment of the screen rules:
According to the second embodiment, too, it all works: