计算连续小于 16 小时的单元格总数

Calucating the total number of cells in a row that are less than 16 hours

我需要 sheet-1 B 列中小于 16 小时的单元格总数,其中 Sheet-1 A 列不等于 sheet 1 中的 5 E4细胞.

Ex请看附件。

Please click on this link to find the example

假设

  • sheet1 的 A 列是 date/times,不是文本,并且
  • 您正在尝试找出有多少 date/times 超过 16 小时

那么您只需将以下公式放入 sheet2!F7:

=COUNTIF(sheet1!A:A,"<"&NOW()-0.75)

(16 小时是一天的 0.75 小时。)


如果 A 列中的数据是文本,那么它会变得稍微困难​​一些,因为您必须确保 Excel 不会将 NOW()-0.75 视为 date/time。您可以通过在格式化的 date/time 末尾添加一个无关字符来欺骗它,这样它就不再有效,例如

=COUNTIF(sheet1!A:A,"<"&TEXT(NOW()-0.75,"yyyy/mm/dd hh:mm:ss")&"#")

对我有用。 (最后的额外 "#" 迫使它不再是有效的 date/time 字符串。)