A formula can output 1 value per detail line.
How many values at once are you trying to order?
Are these numbers or alpha-numeric?
If I understand the problem, one solution might be to analyze the values to understand which is greater, convert to strings and then concatenate them in that order.
Is this the sort of thing you are thinking of?
if {field1}> {field2}
then
totext({field1})+", "+totext({field2})
else
totext({field2})+", "+totext({field1})
The above is a very simple example; please provide more details of the input data, where the formula is to be evaluated (detail line?) and what the desired output should look like.