How to filter dates between two specific dates in Excel?
Sometime you may only want to filter data or records between two specific dates in Excel. For example, you want to show the sales records between 9/1/2012 and 11/30/2012 together in Excel with hiding other records. This article focuses on ways to help you and filter dates between two specific dates in Excel easily.
|Combine multiple worksheets/workbooks into one worksheet / workbook:|
Combine multiple worksheets or workbooks into one single worksheet or workbook may be a huge task in your daily work. But, if you have Kutools for Excel, its powerful utility – Combine can help you quickly combine multiple worksheets, workbooks into one worksheet or workbook.
Recommended Productivity ToolsOffice Tab: Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.
Kutools for Excel: 200 new features for Excel, make Excel much easy and powerful, increase productivity immediately.
Supposing you have following report, and now you want to filter the items between 9/1/2012 and 11/30/2012 so that you can quickly summarize some information. See screenshots:
Microsoft Excel's Filter command supports to filter all dates between two dates with following steps:
Step 1: Select the date column, Column C in the case. And click Data > Filter, see screenshot:
Step 2: Click the arrow button besides the title of Column C. And move mouse over the Date Filters, and select the Between item in the right list, see the following screenshot:
Step 3: In the Popping up Custom AutoFilter dialog box, specify the two dates that you will filter by. See the following steps:
Step 4: Click OK. Now it filters the Date column between the two specific dates, and hides other records as the following screenshot shows:
The following short VBA code also can help you to filter the dates between two specific dates, please do as this:
Step 1: Input the two specific dates in the blank cells. In this case, I enter start date 9/1/2012 in cell E1, and enter end date 11/30/2012 in cell E2.
Step 2: Then hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.
Step 3: Click Insert > Module, and paste the following code in the Module Window.
Public Sub MyFilter() Dim lngStart As Long, lngEnd As Long lngStart = Range("E1").Value 'assume this is the start date lngEnd = Range("E2").Value 'assume this is the end date Range("C1:C13").AutoFilter field:=1, _ Criteria1:=">=" & lngStart, _ Operator:=xlAnd, _ Criteria2:="<=" & lngEnd End Sub
- In the above code, lngStart = Range("E1"), E1 is the start date in your worksheet, and lngEnd = Range("E2"), E2 is the end date that you have specified.
- Range("C1:C13"), the range C1:C13 is the date column that you want to filter.
- All above codes are variables, you can change them as your need.
Step 4: Then press F5 key to run this code, and the records between 9/1/2012 and 11/30/2012 have been filtered.
Step 1: Select the range that you will filter by two dates, and then click Kutools > Select Tools > Select Specific Cells…
Step 2: In the Select Specific Cells dialog box, specify the settings as the following screenshot shows:
Step 3: Click OK or Apply, the entire rows which match the criterion have been selected.
And then you can copy and paste the selected rows in a blank range.
Here I will introduce the Super Filter utility of Kutools for Excel, with this utility, you can easily filter dates between two specified dates. Please do as follows.
1. Click Enterprise > Super Filter. See screenshot:
2. The Super Filter pane is opened and located on the right side of Excel. Click the button to select the range you want to filter, then click the Add Filter button to create a blank filter.
3. Create the filter condition you need. In this case, we are going to filter dates between 9/1/2012 and 11/30/2012. You need to:
1). Select And in the Relationship drop-down list;
2). In the first AND filter condition box, select the date column you want to filter in the first drop-down list, then select Date, Greater Than Or Equal To, and 9/1/2012 separately from the left three drop-down list.
3). In the second AND filter condition box, select the date column, Date, Less Than Or Equal To, and 11/30/2012 separately from the drop-down lists.
4. Click the Filter button.
Then all dates are filtered between specified dates immediately.
Click the Clear button on the bottom right corner of Super Filter pane to clear the filter.
- Select cells based on certain criteria
- Select cells with specific text
- Remove rows based on cell value
Recommended Productivity Tools
Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.
Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!
200 New Features for Excel, Make Excel Much Easy and Powerful:
- Merge Cell/Rows/Columns without Losing Data.
- Combine and Consolidate Multiple Sheets and Workbooks.
- Compare Ranges, Copy Multiple Ranges, Convert Text to Date, Unit and Currency Conversion.
- Count by Colors, Paging Subtotals, Advanced Sort and Super Filter,
- More Select/Insert/Delete/Text/Format/Link/Comment/Workbooks/Worksheets Tools...