The median is currently 14, the central datum in an ordered set of 13. Changing 14 to 12 will not satisfy the other requirements. The lowest quartile is the median of the range of the lowest value up to, but not including the median of the whole set, and the highest quartile is the median of the range between the main median and the highest datum, excluding the main median. An alternative method of including the main median in the two sets making the size of the two sets 7 instead of 6, means that one of the central values, required to be 7 and 17, must already exist in the set and, since neither does and we can only change one datum, we cannot use this method.
Because the size of the dataset is 13 the median splits the data into two sets of 6 data, either side of the median. The current value of 12 needs to be "pushed" one place to the right to become the median of the dataset. This will happen if a datum higher than 12 is made lower than 12.
Let X1, X2, X3, ..., X13 be the data values. The median (Q2) is X7=12 in the required dataset. X3 and X4 are the central two values of the lowest quartile and X10 and X11 are the central two values of the highest quartile. There are two ways of calculating X3 and X4, and X10 and X11. The Q1=(1/2)(X3+X4)=7 or Q1=(1/4)(X3+3X4)=7 and Q3=(1/2)(X10+X11)=17 or Q3=(1/4)(X10+3X11). So if X3=6 and X4=8, then Q1=7; similarly if X10=16 and X11=18, then Q3=17. So if the current X12 or X13 is changed so that it in the ordered set it becomes X1 or X2<6, then all conditions will be met. For example, if current X13 is changed from 24 to 5 then the ordered dataset is 3 5 6 8 9 10 12 14 15 16 18 19 20, and Q1=7, Q2=12, Q3=17.
If the alternative method for calculating Q1 and Q3 is used we would have Q1=(1/4)(6+24)=7.5 and Q2=(1/4)(16+54)=17.5, which clearly does not fit the requirements.