Up and down actions to move rows - better way?

I recently worked out a formula to enable users to move a row up or down a list.  The action is inline and the icons are arrows.   It seems to be working well, but it's a monster formula with the same Select action repeated many times.  I like the fact that it doesn't require any virtual field calculations, which means that however much the lights go dim while it's calculating, it's only limited to when the action is actually clicked.   Is there a more elegant formula than this:

 

IF(Count(Select(Food Orders[Rank], AND([Rank]< [_THISROW].[Rank], [Manifest]=[_THISROW].[Manifest]),False)) > 1,
Average(List(Index(
    Sort(
         Select(Food Orders[Rank], AND([Rank]< [_THISROW].[Rank], [Manifest]=[_THISROW].[Manifest]),False), False),
    Count(Select(Food Orders[Rank], AND([Rank]< [_THISROW].[Rank], [Manifest]=[_THISROW].[Manifest]), False))),
    Index(
    Sort(
         Select(Food Orders[Rank], AND([Rank]< [_THISROW].[Rank], [Manifest]=[_THISROW].[Manifest]),False), False),
    Count(Select(Food Orders[Rank], AND([Rank]< [_THISROW].[Rank], [Manifest]=[_THISROW].[Manifest]), False))-1))),
 Max(Select(Food Orders[Rank], AND([Rank]< [_THISROW].[Rank], [Manifest]=[_THISROW].[Manifest]),False)) - 1)

 

a  

0 2 53
2 REPLIES 2

Please see if  you are you looking for this?

Manual Sorting (Move Items ↑↓ w/Buttons) || Bonus:... - Google Cloud Community

Just in case the tip matches your requirement, please like the original tip and ask any more questions in that tip thread.

 

 

 

Thanks.  I looked at a template with a similar implementation - perhaps from the same author.  That approach recommends building 14 different actions, which scared me off.  My approach requires only two actions, which was my preference.  

Top Labels in this Space