To find the median, we arrange data in order from smallest to largest values. If there is an odd number of variants, the median is the middle value. If there is an even number of variants, the median is the average of the two middle values.
Arrange given data in ascending order:
$16, $18, $22, $28, $32, $40.
The median is the average of $22 and $28 that it is $(22+28):2=$25.
Answer: the median is $25.