Skip to main content
Workday User Guide
Last Updated: 2023-06-23
MS.SORT

MS.SORT

Description

Sorts an existing array and returns a new array. MS.SORT accepts one sort direction and sorts all columns you specified based on that direction. This function is intended for use with unconstrained arrays. To submit the formula, use the unconstrained keyboard shortcut Ctrl+Alt+Enter (Windows) or Command+Option+Enter (Mac).

Syntax

MS.SORT(
array
, [
sort_index
], [
sort_order
], [
by_col
])
  • array
    : The array to sort.
  • sort_index
    : A number that specifies the column to sort by. The default is to sort by the first (left-most) column.
  • sort_order
    : A number that specifies the sort order. Specify 1 to sort in ascending order or -1 to sort in descending order. The default is 1 (ascending).
  • by_col
    : A logical value that specifies the desired sort direction. Specify FALSE to sort by row or TRUE to sort by column. The default is FALSE (by row).

Notes

To sort by more than one column, with a different sort direction for each column, use SORT2.

Related Functions

ARRAYAREA
SORT
SORT2