You could do this using 2010 supported formulas.
For the distinct list of states in cells I2 and down: =IFERROR(INDEX(A$2:A$5,MATCH(0,INDEX(COUNTIF(I$1:I1,A$2:A$5),,),)),"")
For the correlation in cells J2 and down: =CORREL(IF(A$2:A$5=I2,IF(TRIM(B$2:B$5)="TRUE",F$2:F$5)),IF(A$2:A$5=I2,IF(TRIM(B$2:B$5)="TRUE",F$2:F$5),G$2:G$5))