Skip to main content

How to filter dates between two specific dates in Excel?

Author: Kelly Last Modified: 2020-05-20

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 filter dates between two specific dates in Excel easily.

Filter dates between two specific dates with Filter command
Filter dates between two specific dates with VBA code
Select all dates between two specific dates with Kutools for Excel


Filter dates between two specific dates with Filter command

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:

doc-filter-dates-1 -2 doc-filter-dates-2

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:

doc-filter-dates-3

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:

doc-filter-dates-4

Step 3: In the Popping up Custom AutoFilter dialog box, specify the two dates that you will filter by. See the following steps:

doc-filter-dates-5

Step 4: Click OK. Now it filters the Date column between the two specific dates, and hides other records as the following screenshot shows:

doc-filter-dates-6


Filter dates between two specific dates with VBA code

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.

doc-filter-dates-7

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

Note:

  • 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.


Select all dates between two specific dates with Kutools for Excel

In this section, we recommend you the Select Specific Cells utility of Kutools for Excel. With this utility, you can easily select all rows between two specific dates in a certain range, and then move or copy these rows to another place in your workbook.

Before applying Kutools for Excel, please download and install it firstly.

1: Select the range that you will filter by two dates, and then click Kutools > Select > Select Specific Cells

2: In the Select Specific Cells dialog box, specify the settings as below

  • 1). Select Entire row option in the Selection type section.
  • 2). In the Specific type section, please successively select Greater than or equal to and Less than or equal to in the two drop-down lists. Then enter the start date and end date into the following textboxes.
  • 3). Click the OK button. See screenshot:

doc-filter-dates-9

Now all rows which match the criterion have been selected. And then you can copy and paste the selected rows to a needed range as you need.

  If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.


Filter all dates between two specific dates with Kutools for Excel


Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
really cool - thank you
This comment was minimized by the moderator on the site
Date on which performed
19/04/2019 - 19/04/2019
08/05/2019 - 08/05/2019
14/05/2019 - 21/05/2019

15/05/2019 - 15/05/2019
15/05/2019 - 29/05/2019
21/05/2019 - 30/05/2019
22/05/2019 - 12/06/2019
22/05/2019 - 27/05/2019
22/05/2019 - 19/06/2019
24/05/2019 - 06/06/2019
24/05/2019 - 24/05/2019
27/05/2019 - 03/06/2019
27/05/2019 - 27/05/2019
27/05/2019 - 27/05/2019
28/05/2019 - 29/05/2019
30/05/2019 - 30/05/2019
30/05/2019 - 30/05/2019
31/05/2019 - 22/06/2019


which filter do i need to use to filter it with the end date. now after 08/05/2019 the next task was completed by 21/05/2019. i need to arrange in date wise when the task was closed. can anyone suggest me please.
This comment was minimized by the moderator on the site
Hello, Is it possible to get the results to filter to another tab in the worksheet?
This comment was minimized by the moderator on the site
Hi guys, is it possible to creat a loop for the sample "Filter dates between two specific dates with VBA code"? Because i have a lot of dates and not just one as shown here. Thank you!
This comment was minimized by the moderator on the site
excellent, thank you so much
This comment was minimized by the moderator on the site
YOU SHOULD FIRST OF ALL CHANGE THE DATE COLUMN TO DATE DATATYPE.
This comment was minimized by the moderator on the site
thank you this comment is very useful :D
This comment was minimized by the moderator on the site
Hi For Step 2 Instead of the "Date Filter" I see "Text Filter" All of the cells in the column are dates and they are formatted as MM/DD/YYYY I am not sure how to format the Text Filter to be a Date Filter Any Advice? Thank You
This comment was minimized by the moderator on the site
thank you, this is very helpful
This comment was minimized by the moderator on the site
Thank you very much for providing this valuable article
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations