跳到主要内容

如何在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 计算日期范围内的唯一值

要计算两个给定日期之间的唯一值,您还可以应用 Excel 的 Kutools's 选择特定的单元格 实用程序以选择两个日期之间的所有值,然后应用其 选择重复和唯一单元格 实用程序来计算和查找唯一值。

Kutools for Excel, 与超过 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 Tab 为 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