用于将给定列的每日运行计数制表的公式 [英] Formula for tabulating daily running counts of a given column

查看:31
本文介绍了用于将给定列的每日运行计数制表的公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个公式,给出给定日期问题的运行计数.换句话说:输出应该枚举给定日期的每个 Issue(如果 Issue 为空白,则返回空白),然后在后续的第一个问题中再次从 1 开始日期.

I'm trying to write a formula that gives a running count of Issues for a given day. In other words: the output should enumerate each Issue for a given date (returning blank if Issue is blank), and then start again at 1 for the first issue in a subsequent date.

我已经在期望输出"中对期望输出进行了硬编码.列(列 I):

I've hard-coded the expected outputs in the "desired output" column (column I):

示例数据集位于此.关键部分:

Sample dataset is in this sheet. Key pieces:

  • B 包含日期
  • E 列包含每个问题的 T 恤尺寸严重性
  • F 包含列 E
  • 的数字转换
  • G 包含是否存在问题的二进制输出
  • Column B contains the date
  • Column E contains the T-shirt size severity of each Issue
  • Column F contains a numerical translation of column E
  • Column G contains a binary output of whether there was an Issue

我的尝试(列J)中,我已经接近使用

In my attempt (column J), I've gotten close using

=ArrayFormula(MMULT((ROW($B3:$B)>=TRANSPOSE(ROW($B3:$B))) * EXACT($B3:$B,TRANSPOSE($B3:$B))^1, ($G3:$G)^1))

...但这不是我想要的,因为:

...but it's not quite what I want, as:

  1. 这会重复值而不是给出空格(例如第 8、11 行)
  2. 这会给出 0 而不是给出空格(例如第 3、4 行)

请参阅验证(列 L).

关于如何找到我要找的东西有什么想法吗?

Any ideas on how to get to what I'm looking for?

推荐答案

只需将您的公式包装在 IF 函数中

Just wrap your formula in the IF function

=ArrayFormula(IF(F3:F="",,YOUR.....FORMULA))

换句话说

=ArrayFormula(IF(F3:F="",, 
                   MMULT((ROW($B3:$B)>=TRANSPOSE(ROW($B3:$B))) * EXACT($B3:$B,TRANSPOSE($B3:$B))^1, ($G3:$G)^1) 
                      ))

这篇关于用于将给定列的每日运行计数制表的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆