in reply to sort based upon the partial data

A common technique for solving this sort of problem is to transform the data into an easily sorted form, then transform the sorted data back into the original form. The Schwartzian transform is probably the most common for of this technique. See the replies to What is "Schwarzian Transform" (aka Schwartzian) for a discussion of it and mention of the related Orcish Maneuver.


True laziness is hard work