Hi Tia,
I assume your data is arranged as follows from A1 to D4:
B C D E
1 -1 1 0
1 0 0 0
0 0 -1 -1
Where B,C,D,E are your samples and there are three unique variables (0,1,-1) which can be present in any combinations for each one of these samples.
Would that serve your purpose if we identify the number of unique variables for each one of these sample. The sample which has maximum number of unique variables (in this case it's can not be >3) should be considered to have maximum correlation with sample A.
If this approach is fine then write the following formula at A6 and drag across the columns:
=SUMPRODUCT(1/COUNTIF(A2:A4,A2:A4))
In Col C for sample D, the formula will return you 3. Hence, we can say sample D has maximum correlation with sample A.
Please let us know if this is fine.
Kaushik