currently facing a countif problem. Below is my sample data

45001245-1

45001245-2

45001245-3

45001248-1

45001248-2

For the duplicate data i.e. 45001245-1, -2, -3, i would like to set the data ending with -1 to value 1 and the rest to value 0

Currently using this formula

=IF(Countif(A$2:A$15,A2)=1,1,0) without the implementation of the dashes as it wouldnt work if the data has dashes.

Any help is appreciated.

Thanks in advance