Using a dynamic array formula or the FILTER command, we can sort data and keep blank rows in Excel and Google Sheets.