Forum Discussion
KathyB1570
Sep 30, 2024Copper Contributor
Custom Sort for Weight Distribution
I'm trying to figure out a way to sort a list of pallets by weight, but the list needs to have the smallest values at the beginning and end with the highest weights in the middle. Is this possible?
PeterBartholomew1
Sep 30, 2024Silver Contributor
This is strictly an Excel 365 formula. The first step was to stack copies of the weights, one sorted ascending and the other descending.
= VSTACK(SORT(pallets,,1), SORT(pallets,,-1))You would then select every alternate value down the list. This can be achieved by using WRAPROWS and TAKE.
= TAKE(
WRAPROWS(
VSTACK(SORT(pallets), SORT(pallets,,-1)),
2)
,,1)