another approach I think is

another approach is

=IF(COUNTIF(A1:A5,1)>0,1,2)
or
=if(count(A1:A5)>0,1,2)

don't know how to write it in your language.