# AddSorted Function

I have a constant sum question where a % from 0%-100% is required for a number of items. The total must add to 100%.

I'm using the AddSorted function to sort the items from highest to lowest within a constructed list. All appears to be working well.

Then I started to test equal rankings. It appears for items with equally ranked %'s the order is randomised? So if item 5=20% and item 7=20%, one survey would have item 5 above item 7 then the next survey would have them the other way around. So is it correct for equally ranked items the order is randomised from one survey to the next?

I'm happy if that is the case. That's exactly how I would prefer it to work.
asked Sep 13, 2012
edited Sep 13, 2012

## 1 Answer

+1 vote
That is exactly how ADDSORTED works.  It breaks ties randomly.  The same can be said for items were not even answered.  Since they will all have an empty value they are sorted randomly.

So for your constant sum question if I had 8 items and only 4 of them were answered like so:
1-empty
2-20
3-30
4-empty
5-empty
6-30
7-20
8-empty

The items could be sorted in ascending order either 6,3,7,2,1,4,5,8 or 3,6,2,7,8,5,4,1.

Hope this helps
answered Sep 13, 2012 by Gold (22,975 points)
Great. That's just what I needed. No additional programming for tied %'s.