Cookies help us deliver our services. By using our services, you agree to our use of cookies.
Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to extract all records between two dates in Excel?

Here is a range of data in Excel, and in this case, I want to extract all rows records between two dates as below screenshot shown, have you any ideas to quickly handle this job without looking for data and extracting them one by one manually?

doc extract record between dates 1 shot arrow right doc extract record between dates 2

Extract all records between two dates by formulas

Extract all records between two dates by Kutools for Excelgood idea3


Extract all records between two dates by formulas


To extract all records between two dates in Excel, you need to do as these:

1. Create a new sheet, Sheet2, and type the start date and end date in two cells, for instance, A1 and B1. See screenshot:
doc extract record between dates 3

2. In the C1 in Sheet2, type this formula, =SUMPRODUCT((Sheet1!$A$2:$A$22>=A2)*(Sheet1!$A$2:$A$22<=B2)), press Enter key to count the total number of matching rows. See screenshot:
doc extract record between dates 4

Note: in the formula, Sheet1 is the sheet contains the original data you want to extract from, $A$2:$A$22 is the range of data, A2 and B2 are the start date and end date.

3. Select a blank cell that you will place the extracted data, type this formula =IF(ROWS(A$5:A5)>$C$2,"",INDEX(Sheet1!A$2:A$22,SMALL(IF((Sheet1!$A$2:$A$22>=$A$2)*(Sheet1!$A$2:$A$22<=$B$2),ROW(Sheet1!A$2:A$22)-ROW(Sheet1!$A$2)+1),ROWS(A$5:A5)))), press Shift + Ctrl + Enter keys, and drag Auto fill handle over columns and rows to extract all data until blank cells or zero values appear. See screenshot:
doc extract record between dates 5

4. Remove the zeros, and select the dates showing as 5-digit numbers, go to Home tab, and select Short Date in the General drop-down list to format them in date formatting. See screenshot:
doc extract record between dates 6


Extract all records between two dates by Kutools for Excel

If you want to more easily handle this job, you can have a try on the Select Specific Cells feature of Kutools for Excel.

Kutools for Excel, with more than 120 handy functions, makes your jobs easier. 

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

1. Select the data you want to extract from, click Kutools > Select > Select Specific Cells. See screenshot:
doc extract record between dates 7

2. In the Select Specific Cells dialog, check Entire row option, and select Greater than and Less than from the drop-down lists, type the start date and end date into the text boxes, remember to check And. See screenshot:
doc extract record between dates 8

3. Click Ok > OK. And the rows matched the dates have been selected. Press Ctrl + C to copy the rows, and select a blank cell and press Ctrl + V to paste it, see screenshot:
doc extract record between dates 9



Recommended Productivity Tools

Office Tab

gold star1 Bring handy tabs to Excel and other Office software, just like Chrome, Firefox and new Internet Explorer.

Kutools for Excel

gold star1 Amazing! Increase your productivity in 5 minutes. Don't need any special skills, save two hours every day!

gold star1 300 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...

Screen shot of Kutools for Excel

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Angry Savage · 1 months ago
    This formula worked brilliantly. I was concerned as I have multiple date duplicates and there was no mention of how it handles those; no issues. It returned all relevant data.
    Stoked.
    • To post as a guest, your comment is unpublished.
      Sunny · 9 days ago
      Thanks for your support, you can combined the duplicate dates cells after extracting.
  • To post as a guest, your comment is unpublished.
    Math · 5 months ago
    The trouble I am having because I need to find dates that run through the date range specified. So I want anything that runs through something like 1/2016 to 12/2017, however it needs to include start dates that may be before the range so I can identify the records I need to look at.
  • To post as a guest, your comment is unpublished.
    Kayla · 6 months ago
    I used this code and it is pulling up dates outside of the window... how do I fix it?
    • To post as a guest, your comment is unpublished.
      Sunny · 9 days ago
      Which code Kayla? Do you mean the formula?
  • To post as a guest, your comment is unpublished.
    Michelle · 8 months ago
    I recreated this example in Excel 2010, and the result was that the first row of data would show up, but everything underneath had a number error.
    • To post as a guest, your comment is unpublished.
      Brian · 2 months ago
      Same thing happens to me n Excel 2010. Something in the formula doesn't work correctly.
    • To post as a guest, your comment is unpublished.
      Sunny · 7 months ago
      Have you pressed Shift + Ctrl + Enter keys?
      • To post as a guest, your comment is unpublished.
        brian · 2 months ago
        I see what's wrong. You have to press the shift + CTRL + Enter keys while still in edit mode.
        I was hitting those keys after entering the formula and hitting ENTER.
        I wish it would have been clearer.
        • To post as a guest, your comment is unpublished.
          Sunny · 9 days ago
          Yes, brian, after typing the formula and still in edit mode, directly press Shift + Ctrl + Enter keys (the keys instead of Enter key), to get the correct result.