Excel Hide Rows Based on Date: 3 Ways
In this article
To hide rows in Excel based on a date, you can use AutoFilter, a helper column with a formula, or a pivot table—each method works for different scenarios. This article explains all three approaches, step by step, so you can choose the one that fits your data and skill level.
Why Hide Rows by Date?
Hiding rows by date is a common need when working with time-based data: you might want to focus on the last 30 days, hide past due items, or only show entries from a specific month. Manually hiding rows one by one is slow and error-prone, especially with large datasets. The methods below let you hide or show rows automatically based on a date condition, and you can update the view instantly when the date range changes.
Method 1: Use AutoFilter
AutoFilter is the simplest way to hide rows by a specific date or date range. It works well when you want to filter out rows that don't match a date you choose manually.
- Select any cell in your data range.
- Go to the Data tab and click Filter (or press Ctrl+Shift+L).
- Click the drop-down arrow in the date column header.
- Uncheck Select All, then check the specific date(s) you want to keep, or use Date Filters to choose options like Before, After, Between, or Last Month.
- Click OK. Rows that don't match are hidden.
To show all rows again, click the filter icon and choose Clear Filter from that column.
Tip: If your dates are stored as text (not real date values), the date filter options may not appear. You'll need to convert them to actual dates first (see the common problems section below).
Method 2: Helper Column with a Formula
When you need to hide rows automatically based on a condition (e.g., dates older than 30 days), a helper column with a formula gives you more control. You can then filter on that helper column.
- Add a new column next to your data, for example, column B if your dates are in column A.
- In the first data row, enter a formula that returns TRUE or FALSE based on your condition. For example, to keep only dates within the last 30 days:
=A2>=TODAY()-30 - Copy the formula down for all rows.
- Apply AutoFilter on the helper column and filter for TRUE.
This method updates automatically when you open the file or press F9, because TODAY() recalculates.
Examples of useful conditions:
- Show only future dates:
=A2>=TODAY() - Show only dates in the current month:
=TEXT(A2,"YYYYMM")=TEXT(TODAY(),"YYYYMM") - Show only weekdays:
=WEEKDAY(A2,2)<6
Method 3: Pivot Table
If you want to summarize data by date (e.g., total sales per day) and hide certain days, a pivot table is a powerful alternative. It doesn't hide rows in the original data, but it lets you display only the date groups you want.
- Select your data and go to Insert > PivotTable.
- Drag the date field to the Rows area and any value field (like amount) to the Values area.
- Right-click a date in the pivot table, choose Filter, and then select the date range you want to show (e.g., Last 30 Days).
Pivot tables also let you group dates by month, quarter, or year, which is handy for hiding individual days and showing only monthly totals.
How to Choose the Right Method
Your choice depends on how often you need to change the date condition and whether you want the view to update automatically.
- AutoFilter: best for one-off filtering or when you manually pick dates each time.
- Helper column: best for dynamic conditions like “last 30 days” that should update automatically.
- Pivot table: best for summarizing data by date and hiding individual days while keeping totals.
If you need to hide entire rows in the original sheet (not just temporarily), the helper column method is the most flexible because you can filter and then delete hidden rows, or use a macro to hide them permanently.
Common Problems and Fixes
Here are frequent issues people run into when hiding rows by date:
- Dates not recognized as dates: If your column contains text like “Jan 5, 2025” or “2025-01-05”, Excel may not treat it as a date. Use Text to Columns (Data tab) or the DATEVALUE function to convert text to real dates.
- Filter doesn't show date options: This usually means the cells are formatted as text. Select the column, go to Data > Text to Columns, and finish with the “Date” format.
- Hidden rows reappear when sorting: When you sort data, hidden rows may be moved. Always apply the filter after sorting, or use the helper column method with a permanent filter.
- Formula returns wrong results: Check that your date references are absolute (e.g., $A$2) if you copy the formula across columns, and that the date column is truly a date, not a serial number formatted as a date.
Frequently Asked Questions
Can I hide rows based on a date range without a helper column?
Yes, you can use AutoFilter’s “Date Filters” and choose “Between” to enter a start and end date. This hides all rows outside that range without needing a helper column. However, the range is static—it won’t update automatically.
How do I hide rows with dates older than today?
Use a helper column with the formula =A2>=TODAY() and filter for TRUE. This hides all rows where the date is before today. For older than 30 days, use =A2>=TODAY()-30.
Can I hide rows based on a date in another cell?
Yes. In the helper column, reference the cell containing your cutoff date, e.g., =A2>=$E$1 where E1 holds the date. Then filter for TRUE. This lets you change the cutoff date without editing the formula.
Will hiding rows affect my formulas?
No, hidden rows are still included in calculations like SUM or AVERAGE. If you want to exclude them, you need to use functions like SUMIFS or SUBTOTAL, or filter the data and copy it to a new location.
How do I unhide all rows after filtering?
Click the filter icon in the column header and select “Clear Filter” (or press Ctrl+Shift+L to toggle off the filter). This will show all rows again.
Can I hide rows based on a date in Excel Online?
Yes, all three methods work in Excel for the web. AutoFilter and helper columns are fully supported, and pivot tables are available in most plans. The interface is slightly different, but the steps are the same.