问题
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've hard-coded the expected outputs in the "desired output" column (column I
):
Sample dataset is in this sheet. Key pieces:
- Column
B
contains the date - Column
E
contains the T-shirt size severity of each Issue - Column
F
contains a numerical translation of columnE
- Column
G
contains a binary output of whether there was an Issue
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:
- this repeats values instead of giving blanks (e.g. row 8, 11)
- this gives 0s instead of giving blanks (e.g. row 3, 4)
See Validation (column L
).
Any ideas on how to get to what I'm looking for?
回答1:
Just wrap your formula in the IF
function
=ArrayFormula(IF(F3:F="",,YOUR.....FORMULA))
In other words
=ArrayFormula(IF(F3:F="",,
MMULT((ROW($B3:$B)>=TRANSPOSE(ROW($B3:$B))) * EXACT($B3:$B,TRANSPOSE($B3:$B))^1, ($G3:$G)^1)
))
来源:https://stackoverflow.com/questions/63893967/formula-for-tabulating-daily-running-counts-of-a-given-column