If values in the source data change, the output from SORTBY will update automatically.

The SORTBY function takes three primaryarguments:array,by_array, andsort_order.

The first argument,array, is the range or array to be sorted.

SORTBY function example - sort by score

The second argument,by_array, contains the values to be used for sorting.

These values can come from an existing range, orfrom an array created by a formula.

However,by_arraymust have dimensions compatible witharray.

SORTBY function example - sort by score

For example, ifarraycontains ten rows,by_arrayshould also contain ten rows.

Finally, the optionalsort_orderargument determines sort direction.

Use 1 forascendingorder and -1 fordescendingorder.

SORTBY function example - sort by score

By default, SORTBY will sort in ascending order.

To sort by more than one level, provide additionalsort_byandsort_orderarguments in pairs.

Instead, the range or array provided for theby_arrayargument will determine the sort orientation automatically.

SORTBY function example - sort by score

Whenby_arrayis a vertical range, SORTBY sorts vertically by rows.

Whenby_arrayis a horizontal range, SORTBY sorts horizontally by columns.

In this case, both contain five rows.

SORTBY function example - sort by score

Example:sort by two columns.

The output from FILTER is dynamic.

If source data or criteria change, FILTER will return a new set of results.

Excel formula: Random list of names

Values can be sorted by one or more columns.

SORT returns a dynamic array of results.

The range or array used to sort does not need to appear in results.

Excel formula: Random sort

RANDARRAY Function

The Excel RANDARRAY function generates an array of random numbers between two values.

The size or the array is specified byrowsandcolumnsarguments.

The generated values can be either decimals or whole numbers.

Excel formula: Reverse a list or range

SEQUENCE Function

The Excel SEQUENCE function generates a list of sequential numbers in an array.

The array can be one dimensional, or two-dimensional, determined byrowsandcolumnsarguments.

Excel formula: LAMBDA contains which things

Excel formula: Sort birthdays by month and day

Excel formula: Sort by custom list

Excel formula: Sort by two columns

Excel formula: Sort by substring

Excel formula: List upcoming birthdays

Excel formula: Sort values by columns

Excel formula: Sort text by length

Excel formula: Generate random text strings

Excel formula: Randomly assign people to groups

Excel formula: Random numbers without duplicates

Article image

Article image

Article image

Article image

Article image

Excel UNIQUE function

Excel FILTER function

Excel SORT function

Excel SORTBY function

Excel RANDARRAY function

Excel SEQUENCE function

SORTBY function example - sort by score