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).

Excel formula: List upcoming birthdays

“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.

Excel formula: Sort by two columns

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.

Excel formula: Random sort

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.

Excel formula: Sort text by length

TEXT Function

The Excel TEXT function returns a number formatted as text.

in a text string with the number format of your choice.

Excel formula: Sort by custom list

Excel formula: Zodiac sign lookup

Excel SORTBY function

Excel TEXT function