The best thing to do would be to go back to the ungrouped raw data and calculate the upper and lower quartiles from there. If you cannot do that then you need to interpolate withing the groups.
You should not take the difference between the midpoints of the ranges. Instead, it would be better to see how much of each of the relevant groups in within the interquartile range.
For example, if 35% of the upper group is in the interquartile range then you could take the point 35% of the way from its lower boundary to its upper boundary. Similarly if 30% of the lower group is in the interquartile range then you could take the point 30% of the way from its upper boundary to its lower boundary. Then take the difference between these points.
Adding an example, if the groups and frequencies were
0 - 4.99 4
5 - 9.99 5
10 - 14.99 11
15 - 19.99 10
20 + 1
you might decide the lower quartile of the 31 observations was at the 8th observation (fourth of the five in the 5-9.99 group, perhaps 70% of the way up) and the upper quartile at the 24th observation (fourth of the ten in the 15-19.99 group, perhaps 35% of the way up). So you might take the lower quartile to be $5 \times 0.3 + 10 \times 0.7 = 8.5$ and the upper quartile to be $15 \times 0.65 + 20 \times 0.35 = 16.75$. So the interquartile range might be $16.75-8.5 = 8.25$.
Becoming more sophisticated, you might decide not to assume that there is a uniform distribution in each group, and instead choose a density which takes into account frequencies in neighbouring groups. At this stage it is probably easier to get a computer to do the calculations. There is more than one way to do it, and Wikipedia has a description of some of the different ways of estimating the quantiles of a population