by_col - [optional] TRUE = sort by column. FALSE = sort by row. Default is FALSE.
The Excel SORT function extracts and sorts a list of unique values from a range. The result is a dynamic array of values. If this array is the final result (i.e. not handed off to another function) array values will "spill" onto the worksheet into a range that automatically updates when new uniques values are added or removed from the source range, or when source values change.
By default, the SORT function will sort values in ascending order using the first column. Use the optional arguments sort_index and sort_order to control which column to sort by, by what order (ascending or descending).
In the example shown, data includes in column B and scores in column B. The SORT formula in E5 is:
=SORT(B5:C14,2)// sort by scores in ascending order
The SORT function extracts all values, sorted in ascending order by score, and results "spill" into the range E5:F14.
To sort by score in descending order, set sort_order to -1 in a formula like this:
=SORT(B5:C14,2,-1)// sort by scores in descending order
Note: This 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 one column, you can use the SORT function or SORTBY function. In the example shown, data is sorted by the Group column. The formula in F5 is:
Notice data is sorted in ascending order (A-Z)...
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.