MICROSOFT EXCEL
Order lists using data from another column
Excel’s SORTBY function, added in Office 2021, lets you sort a list based on information stored in a different column. This is useful when the thing you want to sort – such as names, items or bills – isn’t in the same order as the values you want to sort by, such as dates, prices or amounts. SORTBY creates a separate, neatly sorted version of your list that updates automatically whenever the underlying data changes.
A simple home example is sorting your household bills by their due dates. In our screenshot, column A (A2:A8) contains bill names ( 1 in our screenshot), and column B (B2:B8) contains the dates they’re due 2 - make sure you write dates as 1, 2, 3 and so on, not 1st, 2nd, 3rd.
In any empty cell, type =SORTBY(A2:A8, B2:B8, 1) 3 and Excel will display the bills sorted by their due dates 4 . The 1 at the end of the formula tells Excel to use ascending order. To use descending order, so the date order is reversed, type -1 at the end instead.