提示:其他語言是Google翻譯的。 你可以訪問 English 版本。
登入
x
or
x
x
註冊
x

or

如何提取Excel中兩個日期之間的所有記錄?

以下是Excel中的一系列數據,在這種情況下,我想要提取兩個日期之間的所有行記錄,如下面的屏幕截圖所示,您有任何想法可以快速處理此作業,而無需手動查找數據並逐個提取它們?

doc在日期1之間提取記錄 向右箭頭射擊 doc在日期2之間提取記錄

通過公式提取兩個日期之間的所有記錄

通過Kutools for Excel提取兩個日期之間的所有記錄好idea3

Office選項卡在Office中啟用選項卡式編輯和瀏覽,使您的工作更輕鬆......
Kutools for Excel解決了您的大多數問題,並使您的生產率提高了80%
  • 重用任何東西: 將最常用或最複雜的公式,圖表和其他任何內容添加到您的收藏夾中,並在將來快速重複使用它們。
  • 超過20文本功能: 從文本字符串中提取數字; 提取或刪除部分文字; 將數字和貨幣轉換為英文單詞。
  • 合併工具:將多個工作簿和工作表合二為一; 合併多個單元格/行/列,而不會丟失數據; 合併重複的行和總和。
  • 拆分工具:根據價值將數據分割成多個工作表; 一本工作簿可轉換為多個Excel,PDF或CSV文件; 一列到多列。
  • 粘貼跳過 隱藏/過濾行; 數和總和 按背景顏色; 將個性化電子郵件批量發送給多個收件人。
  • 超級過濾器: 創建高級過濾方案並應用於任何工作表; 分類 按週,日,頻率等; 過濾 通過大膽,公式,評論......
  • 超過300強大的功能; 與Office 2007-2019和365一起使用; 支持所有語言; 在您的企業或組織中輕鬆部署。

通過公式提取兩個日期之間的所有記錄


要在Excel中的兩個日期之間提取所有記錄,您需要執行以下操作:

1。 創建一個新工作表Sheet2,並在兩個單元格中鍵入開始日期和結束日期,例如A1和B1。 看截圖:
doc在日期3之間提取記錄

2。 在Sheet1的C2中,輸入此公式, =SUMPRODUCT((Sheet1!$A$2:$A$22>=A2)*(Sheet1!$A$2:$A$22<=B2)), 按 輸入 鍵來計算匹配行的總數。 看截圖:
doc在日期4之間提取記錄

請注意: 在公式中,Sheet1是工作表包含要從中提取的原始數據,$ A $ 2:$ A $ 22是數據的範圍,A2和B2是開始日期和結束日期。

3。 選擇一個空白單元格,您將放置提取的數據,鍵入此公式 =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)))), 按 Shift + Ctrl + Enter 鍵,然後將自動填充句柄拖到列和行上以提取所有數據,直到出現空白單元格或零值。 看截圖:
doc在日期5之間提取記錄

4。 刪除零,並選擇顯示為5-digit數字的日期,轉到 主頁 選項卡,然後選擇 短日期 在“常規”下拉列表中以日期格式設置格式。 看截圖:
doc在日期6之間提取記錄


通過Kutools for Excel提取兩個日期之間的所有記錄

如果您想更輕鬆地處理這項工作,可以試試Kutools for Excel的“選擇特定單元格”功能。

Kutools for Excel, 與以上 120 方便的功能,使您的工作更輕鬆。

安裝後 Kutools for Excel,請按照以下步驟操作:(免費下載Kutools for Excel!)

1。 選擇你想要提取的數據,點擊 Kutools > 選擇 > 選擇特定單元格。 看截圖:
doc在日期7之間提取記錄

2。 在裡面 選擇特定單元格 對話框,檢查 整行 選項,然後選擇 比...更棒 - 小於 從下拉列表中,在文本框中輸入開始日期和結束日期,記得檢查 。 看截圖:
doc在日期8之間提取記錄

3。 點擊 Ok > OK。 並且匹配日期的行被選中。 按 按Ctrl + C 複製行,然後選擇一個空白單元格並按 按Ctrl + V 粘貼它,看截圖:
doc在日期9之間提取記錄


Kutools for Excel解決了您的大多數問題,並使您的生產率提高了80%

  • 重用: 快速插入 複雜的公式,圖表 以及你以前用過的任何東西; 加密單元格 密碼; 創建郵件列表 並發送電子郵件...
  • 超級方程式酒吧 (輕鬆編輯多行文字和公式); 閱讀佈局 (輕鬆讀取和編輯大量單元格); 粘貼到過濾範圍...
  • 合併單元格/行/列 不丟失數據; 分裂細胞含量; 組合重複的行/列...防止重複的細胞; 比較範圍...
  • 選擇複製或唯一 行; 選擇空行 (所有細胞都是空的); 超級查找和模糊查找 在許多工作簿中; 隨機選擇......
  • 精確複製 多個單元格而不更改公式參考; 自動創建參考 多張表; 插入項目符號,複選框等等......
  • 提取文本,添加文本,按位置刪除, 刪除空間; 創建和打印分頁小計; 在單元格內容和註釋之間轉換...
  • 超級過濾器 (將過濾方案保存並應用到其他工作表); 高級排序 按月/週/日,頻率等; 特殊過濾器 用粗體,斜體......
  • 結合工作簿和工作表; 根據鍵列合併表; 將數據拆分為多個表格; 批量轉換xls,xlsx和PDF...
  • 超過300強大的功能。 支持Office / Excel 2007-2019和365。 支持所有語言。 在您的企業或組織中輕鬆部署。 全功能30天免費試用。
kte tab 201905

Office選項卡為Office提供選項卡式界面,使您的工作更輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,Publisher,Access,Visio和Project。
  • 在同一窗口的新選項卡中打開並創建多個文檔,而不是在新窗口中。
  • 通過50%提高您的工作效率,每天為您減少數百次鼠標點擊!
官方底部
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.
    Neha · 2 months ago
    "drag Auto fill handle over columns and rows to extract all data until blank cells or zero values appear."
    This doesn't seem to be working for me. The first row gives me the dates but the same gets repeated in the next two rows.
    • To post as a guest, your comment is unpublished.
      Sunny · 12 days ago
      Hi, Neha, could you check if your auto calculate is turn on? Click Formulas > Calcuations Options > Automatic.
  • To post as a guest, your comment is unpublished.
    Muneera · 5 months ago
    it worked well for single sheet. can u pls help me to get the same from multiple sheets of similar data. first 4 sheets contain similar data. i need all records of same 'date' in sheet5.
  • To post as a guest, your comment is unpublished.
    Tim · 5 months ago
    Can you extend the formula to check for dates that encompass more than one day? For example, using the same start and end dates from 1/1/15-12/31/16, but the data in sheet 1 have start and end dates too rather than just existing for a singular date.
  • To post as a guest, your comment is unpublished.
    Angry Savage · 11 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 months ago
      Thanks for your support, you can combined the duplicate dates cells after extracting.
  • To post as a guest, your comment is unpublished.
    Math · 1 years 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 · 1 years 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 months ago
      Which code Kayla? Do you mean the formula?
  • To post as a guest, your comment is unpublished.
    Michelle · 1 years 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 · 1 years 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 · 1 years ago
      Have you pressed Shift + Ctrl + Enter keys?
      • To post as a guest, your comment is unpublished.
        brian · 1 years 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 months 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.
          • To post as a guest, your comment is unpublished.
            Jo Higgins · 7 months ago
            Still doesnt work for me? I am doing exactly as above and still returning the NUM error? Any other ideas?