array/order - [optional] Additional array and sort order pairs.
The Excel SORTBY function sorts the contents of a range or array based on the values from another range or array. The range or array used to sort does not need to appear in results. In the example shown, the formula in E5 is:
=SORTBY(B5:B14,C5:C14,-1)// sort by grades descending
The output in E5:E14 is the list of names sorted by scores in descending order. To sort by grades in ascending order use:
=SORTBY(B5:B14,C5:C14,1)// sort by grades ascending
Note: The SORTBY function is a new "Dynamic Array Function" in Excel. It is a beta feature available only through the Office Insiders program. Dynamic Array functions are expected to be released in 2019 to Office 365 subscribers.
To sort by two columns, you can use the SORTBY function. In the example shown, data is sorted first by the Group column in ascending order, then by the Score column in descending order. The formula in F5 is:
To sort a list or table in random order, you can use the SORTBY function with the RANDARRAY function. In the example shown, the formula in D5 is:
where "data" is the named range...
To sort a list in a custom order, you can combine the SORTBY function with the MATCH function. In the example shown, The table is being sorted by the "group" column using in the order shown in cells J5:J7. The formula...
To create a random list of names, you can use the INDEX function and the RANDARRAY function to select random names from an existing list. In the example shown, the formula in D5 is:
The Excel SINGLE function returns a single value using implicit intersection. The SINGLE function is provided for backwards compatibility with implicit intersection formulas in earlier versions of Excel.
Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.