Data is 1, 2, 3, 4, 6, 7, 7, 7, 19, 22, 31, 37
There are 12 data, so the median (Q2) is between the sixth and seventh values, so think of it as
1, 2, 3, 4, 6, 7, Q2,7, 7, 19, 22, 31, 37
Then Q1 = median of 1, 2, 3, 4, 6, 7 = 3.5 and Q3 = median of 7, 7, 19, 22, 31, 37 = 20.5
Note that if you put bars where the quartiles are you do get the data divided into four sets of equal size
1, 2, 3 | 4, 6, 7 | 7, 7, 19 | 22, 31, 37
Data is 1, 2, 3, 4, 6, 7, 7, 7, 19, 22, 31, 37, 37
There are now 13 data, so the median is the seventh value so the median's position is where the second 7 is, so you have
1, 2, 3, 4, 6, 7, Q2, 7, 19, 22, 31, 37, 37
Then Q1 = median of 1, 2, 3, 4, 6, 7 = 3.5 and Q3 = median of 7, 19, 22, 31, 37, 37 = 26.5