Would like to use formula to sort a single value/letter in ascending order.

For example, A G A A A K K H H H should be A A A A G H H H K K

Thanks