I would first order them from least to greatest
State A 21 22 22 23 23 23 24 24 25
State B 20 20 21 22 23 23 24 46 50.
now analyze data
State A
find the 'middle' value, that is your median
if you have odd number of terms , it is exact middle. if even number of terms, then take average of two adjacent middle terms.
21 22 22 23 23 23 24 24 25
median is 23
median of lower half is Q2
21 22 22 23 , median is (22 + 22) /2 = 22
median of upper half is Q3
Five point summary of state A
minimum : 21
Q1 : 22
median: 23
Q3: 24
maximum 25
IQR = 2
Five point summary of state B
minimum : 20
Q1 : 20
median: 22
Q3: 35
maximum 50
IQR = 15