为什么这个 LO-calc 公式会包括不应该计入的月底条目?

huangapple go评论72阅读模式
英文:

Why does this LO-calc formula with end of month count entries that it shouldn't?

问题

这个公式=IF(ISTEXT(AK4),"Data Gap",COUNTIFS(Date,">"&EOMONTH(TODAY(),-1),Examinee,$A4))正在计算从上个月的最后一天开始的条目,但根据我的理解,它应该只计算日期大于上个月底的条目。

有什么想法吗?根据我的知识,这完全不符合逻辑。

提前感谢 =)

英文:

The formula =IF(ISTEXT(AK4),"Data Gap",COUNTIFS(Date,">"&EOMONTH(TODAY(),-1),Examinee,$A4)) is counting entries from the last day of last month, but to my understanding, it should only be counting entries with dates larger than ">" the end of last month.

Any ideas why? It defies all logic according to my knowledge.

Thanks in advance =)

答案1

得分: 1

如@JohnSUN所说,EOMONTH获取指定日期午夜的数字值,为了使其工作,我们应该使用"+1"参数引用月末的后一天,并告诉函数考虑等于或大于该参考点的任何内容。

=IF(ISTEXT(AK4),"数据间隙",COUNTIFS(Date,">="&(EOMONTH(TODAY(),-1)+1),Examinee,$A4))

这不是最直观的公式,您必须记住这个细节。

英文:

So, as @JohnSUN said, EOMONTH takes the numeric value for midnight on the specified day, for it to work, we should reference the day after the end of month with a "+1" argument and tell the function to account for anything equal or bigger to that point of reference.

=IF(ISTEXT(AK4),"Data Gap",COUNTIFS(Date,">="&(EOMONTH(TODAY(),-1)+1),Examinee,$A4))

It is not the most intuitive formula and you have to keep that detail in mind.

huangapple
  • 本文由 发表于 2023年7月13日 22:02:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76680253.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定