This is done with the TEXT function, which we use to extract the month and day.
TheSORTBY functioncan sort by one or more arrays.
For thearrayargument, we provide the full set ofdata(B5:C16).
“0727” for the date in cell C5).
Notice names and birthdays are now sorted by month, then by day.
In other words, the birthdays are sorted in the order they will occur throughout the year.
For the purposes of this example, this works fine.
However, there are times where you mightwant or need a numeric sort option.
Now you might use the “Helper” column to sort the table manually by month and day.
It is possible to sort with a formula as well, but it issomewhat more complex.
For more information on dynamic array alternatives, see:Alternatives to Dynamic Array Functions.
The range or array used to sort does not need to appear in results.
TEXT Function
The Excel TEXT function returns a number formatted as text.
in a text string with the number format of your choice.