计算由另一个单元格中的某些特定值标识的每组行的 "running max" 数据

Calculate the "running max" of data for each set of rows identified by some particular values in another cell

请看附件照片。

在 Google sheet,我希望将具有特定月和周组合的行视为一个单独的集合。在每个这样的集合中,我想实现一个公式来计算 C 列中的 'running Max' 数据(我已经在 J​​ 列中展示了公式实现以供您理解)。 如何实现指示的“运行 Max”列?

这是 link 到 Google Sheet: https://docs.google.com/spreadsheets/d/1Af5-pYMFWZ1QtLoaAbPZYMGRvk43JBslUp4KyOFADfA/edit?usp=sharing

尝试 MAX

=ArrayFormula(transpose(query(
if(row(C3:C)>transpose(row(C3:C)),,C3:C)*(transpose(E3:E)=E3:E)*(transpose(D3:D)=D3:D),
"select " & join(",","max(Col" & sequence(1, count(C3:C)) & ")") &
"label "  & join(",","max(Col" & sequence(1, count(C3:C)) & ") ''") & "" )))

分钟

=ArrayFormula(transpose(query(
if(row(C3:C)>transpose(row(C3:C)),9^9,C3:C)*(if(transpose(E3:E)=E3:E,1,9^9))*(if(transpose(D3:D)=D3:D,1,9^9)),
"select " & join(",","min(Col" & sequence(1, count(C3:C)) & ")") & "label "  & join(",","min(Col" & sequence(1, count(C3:C)) & ") ''") & "" )))

看看公式

我的可以很容易地调整来回答你的问题:

=ArrayFormula(if(C3:C="",,vlookup(row(C3:C),
{if(countifs(C3:C,">"&C3:C,row(C3:C),"<"&row(C3:C),E3:E,E3:E)=0,row(C3:C)),C3:C}
,2)))

它适用于中等数量的数据,但正如您从 link 中看到的那样,接受的答案更适用于大量数据。不过我不知道你会怎么改编。

=ArrayFormula(if(C3:C="",,vlookup(row(C3:C),
{if(countifs(C3:C,"<"&C3:C,row(C3:C),"<"&row(C3:C),E3:E,E3:E)=0,row(C3:C)),C3:C}
,2)))

最低。