I have a big dataset, and I am trying to determine the standard deviation of separate groups. The groups are in a single column, for simplicity sake let's say they are just "A" and "B." The scores are in a second column. I want to have a single forumla that I can paste into a "Group Standard Deviation" column that will discern whether the group column has a value of "A" or "B."

I tried the suggestion here, also demonstrated here:

=STDEV(IF(RangeX=CondX,IF(RangeY=CondY,StandardDeviationRange)))
ctr+shift+enter

In my case:
=STDEV(IF(A2:A21="A",IF(A2:A21="B",B2:B21)))
ctr+shift+enter

But I am getting a "#DIV/0!" error.

I think I am getting the error becuase my groups are differentiated in the same column (A2:A21), so I only have RangeX and RangeX. It appears that this approach only works if RangeX is different than RangeY.

Is there a way to do this? Below is sample data.

Thanks!

ColumnA ColumnB
A 1
A 2
A 3
A 4
A 5
A 6
A 7
A 8
A 9
A 10
B 10
B 20
B 30
B 40
B 50
B 60
B 70
B 80
B 90
B 100