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

or

如何在兩個日期之間查找並在Excel中返回相應的值?

DOC-VLOOKUP最新-1

假設您有一些項目計劃的報告,那麼您現在想要獲得計劃的兩個給定日期之間給定時間的特定項目。 以下面的屏幕截圖數據為例,我想查看給定的日期8 / 13 / 2015,如果這個日期在報表內的開始日期和結束日期之間,則返回相應的項目名稱。 本文將介紹LOOKUP函數來處理這個問題。

在兩個日期之間查找並用LOOKUP公式返回相應的值


在列表中查找值:

用這個公式 Kutools for Excel,您可以快速查看沒有任何公式的列表中的確切值。

DOC-VLOOKUP函數,6

Kutools for Excel:比200方便的Excel加載項,可以在60天免費試用。 下載並免費試用現在!


箭頭藍色右泡 在兩個日期之間查找並用LOOKUP公式返回相應的值


要獲取日期在兩個日期之間的相對值,下面的查找公式可能會幫助您。 請這樣做:

將此公式輸入到要放置結果的空白單元格中: =LOOKUP(2,1/($A$2:$A$7<=F1)/($B$2:$B$7>=F1),$C$2:$C$7)A2:A7 是開始日期和範圍 B2:B7 是報告中的結束日期範圍 F1 是您希望得到相應值的給定日期。),然後按 輸入 關鍵是要得到你需要的結果。 看截圖:

DOC-VLOOKUP最新-2

注意:如果日期不存在,則輸入此公式後將得到一個錯誤值。



相關文章:

如何在Excel中的一個單元格中查看返回多個值?

如何在Excel中查找下一個最大值?

如何在Excel中的二維表中查找?


Kutools for Excel - 最佳辦公生產力工具提高80%的生產力

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

    Thank you for your time!
  • To post as a guest, your comment is unpublished.
    Junaid · 2 months ago
    dear, I need help. For Example, IF we have many entries against value "A" than how I can pick the latest date value using the formula in excel. and if I have many entries of different values how I can pick the latest date value. (Sorry For My English)
    • To post as a guest, your comment is unpublished.
      DReid · 1 months ago
      I have something similiar to this! Have you had any luck anywhere?
      • To post as a guest, your comment is unpublished.
        amircse0711 · 1 months ago
        Same here , still finding the way to retrive more than one value, Did you find the solution ?

        Thank you for your time!
  • To post as a guest, your comment is unpublished.
  • To post as a guest, your comment is unpublished.
    Pete C · 3 months ago
    Hi. What is the logical explanation to use this formula: =LOOKUP(2,1/($A$2:$A$7<=F1)/($B$2:$B$7>=F1),$C$2:$C$7)? How does it work? Thanks.
  • To post as a guest, your comment is unpublished.
    Terry · 4 months ago
    a godsend - exactly what I was looking for! much thanks
  • To post as a guest, your comment is unpublished.
    Jeromy · 6 months ago
    hello, what if in the columns, there are data aside from dates. How can I get the date from the range?

    E.g. Column A - 03/19/2019, Column B - Approved, Column C - Pending, Column D - ---. In this case, how can I get 03/19/2019?
  • To post as a guest, your comment is unpublished.
    prashant · 1 years ago
    i have two sheets, Sheet No 1 has Selling date, Grade & Item Code, Sheet no 2 has Price applicable from date, to date, Item code & Garde. please help to solve using vlookup, index or any other function in excel ?
  • To post as a guest, your comment is unpublished.
    Tom · 1 years ago
    Hello, what if I want to add another criteria. For example, if there was another column D called "Group ID" that I want to add in the formula. i.e. If group ID=302511 then LOOKUP(2,1/($A$2:$A$7<=F1)/($B$2:$B$7>=F1),$C$2:$C$7). Is this possible?
    • To post as a guest, your comment is unpublished.
      skyyang · 1 years ago
      Hello, Tom,
      Can you give your problem more detailed? You can insert a screenshot here.
  • To post as a guest, your comment is unpublished.
    Shakeer · 1 years ago
    Hi
    I have a list of Jobs where the status of these jobs vary from INV, CMP to CLS.
    is there a way i could lookup the Status Date to a corresponding job number to a different sheet
  • To post as a guest, your comment is unpublished.
    Jo Evans · 1 years ago
    Thanks - can always rely on help from internet
  • To post as a guest, your comment is unpublished.
    Versha Prabhu · 1 years ago
    I have two tables in a workbook.I need help to create a macro to run a report based on the dates as shown.


    Sheet1


    Name Due Date Amount Paid
    JohnDoe3 23-Jan-18 $965.00 Yes
    JohnDoe4 24-Jan-18 $145.00 Yes
    JohnDoe5 25-Jan-18 $225.00 No
    JohnDoe6 26-Jan-18 $336.00 No
    JohnDoe7 27-Jan-18 $365.00 No
    JohnDoe8 28-Jan-18 $124.00 No
    JohnDoe9 29-Jan-18 $321.00 No
    JohnDoe10 30-Jan-18 $333.00 No
    JohnDoe11 31-Jan-18 $521.00 No
    JohnDoe12 01-Feb-18 $333.00 Yes
    JohnDoe13 02-Feb-18 $965.00 No
    JohnDoe14 03-Feb-18 $145.00 No
    JohnDoe15 04-Feb-18 $225.00 No
    JohnDoe16 05-Feb-18 $336.00 No
    JohnDoe17 06-Feb-18 $365.00 No
    JohnDoe18 07-Feb-18 $124.00 No
    JohnDoe19 08-Feb-18 $321.00 No
    JohnDoe20 09-Feb-18 $333.00 No
    JohnDoe1 10-Feb-18 $521.00 No
    JohnDoe2 11-Feb-18 $333.00 No

    and


    Sheet2


    FirstDate LastDate PayDay
    19-Oct-17 01-Nov-17 16-Nov-17
    02-Nov-17 15-Nov-17 30-Nov-17
    16-Nov-17 29-Nov-17 14-Dec-17
    30-Nov-17 13-Dec-17 28-Dec-17
    14-Dec-17 27-Dec-17 11-Jan-18
    28-Dec-17 10-Jan-18 25-Jan-18
    11-Jan-18 24-Jan-18 08-Feb-18
    25-Jan-18 07-Feb-18 22-Feb-18
    08-Feb-18 21-Feb-18 08-Mar-18

    Today is 05FEB18

    If I run a report today (falls between 25-Jan-18 and 07-Feb-18 for pay period 22-Feb-18)


    I want to pick up all the records for Due Dates 25JAn18 to 07FEB18 which has no in the Paid column and create a report.


    Then update the paid column to yes.

    the output should be as follows

    JohnDoe5 25-Jan-18 $225.00
    JohnDoe6 26-Jan-18 $336.00
    JohnDoe7 27-Jan-18 $365.00
    JohnDoe8 28-Jan-18 $124.00
    JohnDoe9 29-Jan-18 $321.00
    JohnDoe10 30-Jan-18 $333.00
    JohnDoe11 31-Jan-18 $521.00
    JohnDoe12 01-Feb-18 $333.00
    JohnDoe13 02-Feb-18 $965.00
    JohnDoe14 03-Feb-18 $145.00
    JohnDoe15 04-Feb-18 $225.00
    JohnDoe16 05-Feb-18 $336.00
    JohnDoe17 06-Feb-18 $365.00
    JohnDoe18 07-Feb-18 $124.00


    Thanks for your help.
  • To post as a guest, your comment is unpublished.
    Ann · 2 years ago
    Hi,

    pls. explain how the formula works. Why use "2" as lookup values and "1/" in lookup vector?
  • To post as a guest, your comment is unpublished.
    Niher · 2 years ago
    How to solve the following problem
    Date Range 50000 100000 200000
    01/07/2010 30/06/2011 460 920 1840
    01/07/2011 29/02/2012 502 1005 2011
    01/03/2012 22/05/2015 560 1120 2241
    23/05/2015 16/05/2017 480 960 1920

    I want investment return of $100000 for the date 03/04/2013. What will be the formula?
  • To post as a guest, your comment is unpublished.
    Fayley · 2 years ago
    Can you explain why this works? What is the 2,1 for?
  • To post as a guest, your comment is unpublished.
    digvijay · 2 years ago
    sir how this formula work,pls get me step by step
    LOOKUP(2,1/($A$2:$A$50=$L$2),$C$2:$C$50
    • To post as a guest, your comment is unpublished.
      Manuelle · 2 years ago
      Yes, Why 2,1/

      In fact I need to Vlook up a date in a range of dates like bellow, but th formula doesn't work #REF ! I don't know why..
      2010-04-01 2010-10-31 À date P-6
      2011-04-01 2011-10-31 À date P-5
      2012-04-01 2012-10-31 À date P-4
      2013-04-01 2013-10-31 À date P-3
  • To post as a guest, your comment is unpublished.
    NT · 2 years ago
    When try with this in F2 =Lookup(F1,$A$2:$B$7,$C$2:$C$7) got the similar result. Can you pl explain the difference and why 2 been used as lookup value.
    • To post as a guest, your comment is unpublished.
      ryan · 1 years ago
      I think it's because that's the number of lookup factors you have. I tried it with three factors and I used 3 as the lookup value. I'm not sure exactly, but I think by putting "3" and then using the "/" to separate the lookup vectors you tell Excel to search for the three following inputs to return the output.
  • To post as a guest, your comment is unpublished.
    PAH · 3 years ago
    This is brilliant. Simplicity in explanation is perfect. One of the quickest formulae I've ever looked up to learn. Thank you.
  • To post as a guest, your comment is unpublished.
    José · 3 years ago
    Hi! Nice explanation, but how can we do the same exercise if we have multiple projects with the same dates? In that case I want the name of those projects to be returned not only a single value...

    Thanks!