跳到主要內容

如何在Excel中計算兩個日期之間的唯一值?

日期之間的文檔計數唯一性1
您是否曾經對在Excel中的日期範圍之間計算唯一值感到困惑? 例如,這裡有兩列,列ID包含一些重複的數字,列Date包含日期序列,現在我要計算8年2月2016日至8年5月2016日之間的唯一值,如何快速解決它在Excel中?
按公式計算日期範圍內的唯一值
通過Kutools for Excel計算日期範圍內的唯一值

箭頭藍色右氣泡 按公式計算日期範圍內的唯一值

要計算日期範圍內的唯一值,可以應用公式。

選擇要放置計數結果的單元格,然後鍵入此公式 =SUMPRODUCT(IF((B2:B8<=E2)*(B2:B8>=E1), 1/COUNTIFS(B2:B8, "<="&E2, B2:B8, ">="&E1, A2:A8, A2:A8), 0)), 按 轉移 + 按Ctrl + 輸入to得到正確的結果。 看截圖:
日期之間的文檔計數唯一性2

小提示: 在上面的公式中,B2:B8是數據范圍內的日期單元格,E1是開始日期,E2是結束日期,A2:A8是您要從中計算唯一值的id單元格。 您可以根據需要更改這些條件。


箭頭藍色右氣泡 通過Kutools for Excel計算日期範圍內的唯一值

要計算兩個給定日期之間的唯一值,您還可以應用 Kutools for Excel's 選擇特定的單元格 實用程序以選擇兩個日期之間的所有值,然後應用其 選擇重複和唯一單元格 實用程序來計算和查找唯一值。

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

免費安裝 Kutools for Excel,請執行以下操作:

1.選擇日期單元格,然後單擊 庫工具 > 選擇 > 選擇特定的單元格。 看截圖:
日期之間的文檔計數唯一性3

2。 在裡面 選擇特定的單元格 對話框,檢查 整行 選項 選擇類型 部分,選擇 大於或等於小於或等於 從兩個下拉列表中分別檢查 在兩個下拉列表之間,然後輸入 開始日期 結束日期 分別在兩個文本框中 特定類型 部分。 看截圖:
日期之間的文檔計數唯一性4

3。 點擊 Ok,然後會彈出一個對話框,提醒您選擇的行數,單擊 OK 關閉它。 然後按 按Ctrl + C 按Ctrl + V 將選定的行複制並粘貼到另一個位置。 看截圖:
日期之間的文檔計數唯一性5 日期之間的文檔計數唯一性6

4.從粘貼範圍中選擇ID號,然後單擊 庫工具 > 選擇 > 選擇重複和唯一單元格。 看截圖:
日期之間的文檔計數唯一性7

5.在彈出的對話框中,選中 所有唯一(包括第一個重複項) 選項,並檢查 填充背景色 or 填充字體顏色 如果要突出顯示唯一值,請單擊 Ok。 現在彈出另一個對話框,提醒您唯一值的數量,同時選擇並突出顯示唯一值。 看截圖:
日期之間的文檔計數唯一性8

doc下載1

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (12)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I was strugling and after3 days of trying on excel and google, I finally found your article :)

Thank you soooo much
This comment was minimized by the moderator on the site
{="TOTAL ORANGES: "&SUM(IF(FREQUENCY(IF($B$4:$B$59<>"",MATCH($B$4:$B$59,$B$4:$B$59,0)),ROW($B$4:$B$59)-ROW(B4)+1),$K$4:$K$59))}

1. This only counts an incident once
2. Sums the value associated with each incident
3. Needs to sum only values between two dates.
This comment was minimized by the moderator on the site
Hi there! This worked perfectly for what I needed but I need to alter it so that it does not county blank cells - do you have any recommendations for this?
This comment was minimized by the moderator on the site
Do you know what formula apply to count non repeated values within a date range? In the example above it is 2. Thanks!
This comment was minimized by the moderator on the site
Hi this formula works for me but i would like to add another criteria & say only find the uniques if

Table2[TASK]="PSHP" or "SHIP"



=SUMPRODUCT(IF((Table2[DATE]<=J2)*(Table2[DATE]>=I2),1/COUNTIFS(Table2[DATE],"<="&J2,Table2[DATE],">="&I2,Table2[ORDER],Table2[ORDER]),0))
This comment was minimized by the moderator on the site
could you please help me with this issue

i need special formulas, i will explain what i want, i have sheet contain two columns (Date & Item) i received different items in one day and its repeated randomly, ex-

1-Dec-2017 TV
1-Dec-2017 TV
1-Dec-2017 Radio
1-Dec-2017 TV
1-Dec-2017 Oven
2/3/4-Dec-2017 .....etc

in each day i want to count how many TV/Radio/Oven..etc in each day only.
This comment was minimized by the moderator on the site
I think the pivottable can do you a favor.
This comment was minimized by the moderator on the site
This formula doesn't
work for me just keeps giving me "0"
This comment was minimized by the moderator on the site
Sorry that is not work for you, but the formula works perfect in my way. Could you upload screenshot of your file or descibe much more details about your problem? Maybe we can find the reason. Thank u.
This comment was minimized by the moderator on the site
Did you get to the bottom of this one? Mine is showing '0' too.
This comment was minimized by the moderator on the site
Do you hold Shift + Ctrl and press Enter key? Or is there any unique values in your date range?This formula used to count unique values in a date range only.
This comment was minimized by the moderator on the site
Thanks for the great article. I tried using the below formula, but keep getting this error: "Function DIVIDE parameter 2 cannot be zero." [quote]=ArrayFormula(SUMPRODUCT(IF((D4:D200=M3), 1/COUNTIFS(D4:D200, "="&M3, C4:C200, C4:C200), 0)))[/quote] D4:D200 - date span C4:C200 - data span M3 - the date (1st day of the month)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations