Google-sheets – Eliminate empty cells from a sort

google sheets

I have a spreadsheet where club members scores are added from competitions during the year. I accumulate the data to a sheet with a name column and a value column I then sort these to another sheet by data order to then share to our website.
The formula I use to get the list in score order is

=sort(Leaderboard1!L5:M126,2,False)

This works fine however I also want to present a list in Name order but as the sheet I am pulling the data from contains cells with no information in them (available for adding new members during the year) when I amend the formula to

=sort(Leaderboard1!E5:F126,1,True)

I get all the blank cells at the top of the sorted list.

I have tried a number of variations to only sort cells with names with no luck.

Can you please suggest a correct formula to not include those cells in column 1 that do not have names, column 2 will always have a 0.

Best Answer

Try:

=sort(filter(Leaderboard1!E5:F126, len(Leaderboard1!E5:E126)),1,True)