SORTBY will respect column additions/deletions, because it references a range, where SORT references a column index number.Īn array can be thought of as a row of values, a column of values, or a combination of rows and columns of values. If you want to sort data in the grid, it's better to use the SORTBY function, as it is more flexible. The SORT function is provided to sort data in an array. When by_col is FALSE or missing Excel will sort by row. By default Excel will sort by row, and will only sort by column where by_col is TRUE. Where order is not provided, ascending order will be presumed. Where sort_index is not provided, row1/col1 will be presumed.