How to Insert Blank Rows When Dates Change in Excel
Question details
The user needs to insert blank rows automatically between groups of records whenever the date changes in a sorted worksheet.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Organizing a sorted dataset by visually separating different date groups with blank rows for better readability.
- Observed behavior
- The data is currently contiguous, and the goal is to separate grouped records sharing the same date with a blank row whenever the date transitions to a new one.
Ensure your dataset is strictly sorted in ascending or descending order by the date column before applying any method to insert blank rows.
Use the Excel Subtotal Feature
This is the most straightforward method to insert blank rows between grouped data without using complex formulas or macros.
The Subtotal feature can automatically group data and insert summary rows. By generating these summary rows and then clearing their contents, you can easily create clean blank rows between your data groups.
Highlight your entire dataset. Go to the 'Data' tab on the ribbon, click 'Outline', and select 'Subtotal'.
In the Subtotal dialog box, choose the date column from the 'At each change in' dropdown. Ensure no columns are checked under 'Add subtotal to' (or leave a dummy column checked) and click 'OK'.
Select the entire dataset again, apply a Filter (Ctrl+Shift+L), and filter the date column to only show rows containing the word 'Count'. Select these visible rows, right-click, and delete them.
Clear the filter to reveal your data. Go back to 'Data' > 'Outline' > 'Ungroup' > 'Clear Outline'. You will now have perfectly formatted blank rows separating your date groups.
Use a Dynamic Array Formula (LET Function)
Ideal for advanced users who want to output a new array with blank rows automatically generated without altering the original dataset.
Use REDUCE and VSTACK Functions
A modern formula approach available in Microsoft 365 to conditionally expand arrays when a value change is detected.
Insert Blank Rows Between Data Groups Easily in WPS Spreadsheet
You can effortlessly organize grouped data and insert blank rows in WPS Spreadsheet using the intuitive Subtotal and Filter features, completely free of charge.
- 1. Open your Excel file in WPS: Launch WPS Spreadsheet and open the file containing your sorted date data.
- 2. Apply Subtotals: Navigate to the Data tab, click Subtotal, and group by the date column to automatically generate spacing rows.
- 3. Remove Subtotal Text: Use the built-in Filter to find the subtotal rows, delete the contents, and remove the outline to leave perfect blank separators.

Frequently Asked Questions
Can I use a VBA macro to insert blank rows when a value changes?
Yes, you can write a simple VBA loop that reads from the bottom row up to the top, checking if the current cell's date matches the cell above it. If they are different, use Rows(i).Insert to add a blank row automatically.
Why is my Subtotal option grayed out?
The Subtotal feature cannot be used if your data is formatted as an official Excel Table (Insert > Table). You must convert the table back to a normal range (Right-click > Table > Convert to Range) before the Subtotal option becomes clickable.
Do the dynamic array formulas work in older versions of Excel?
No, functions like VSTACK, REDUCE, TOCOL, and LET are available only in Excel for Microsoft 365 and Excel 2021. If you are using an older version, the Subtotal method is the most reliable approach.




