EXCEL统计数字大于0在一行中连续出现的最大次数,用数组公式求的,怎么求最大次数的各个数值的和?

2024-11-18 07:28:47
推荐回答(2个)
回答1:

=SUM(OFFSET(A1,MATCH(MAX(FREQUENCY(IF(A1:A12>0,ROW(A1:A12)),IF(A1:A12>0,,ROW(A1:A12)))),FREQUENCY(IF(A1:A12>0,ROW(A1:A12)),IF(A1:A12>0,,ROW(A1:A12))),)-MAX(FREQUENCY(IF(A1:A12>0,ROW(A1:A12)),IF(A1:A12>0,,ROW(A1:A12))))-1,,MAX(FREQUENCY(IF(A1:A12>0,ROW(A1:A12)),IF(A1:A12>0,,ROW(A1:A12))))))

回答2:

=SUM(OFFSET($A$1,LOOKUP(,0/(FREQUENCY(IF(A1:A12>0,ROW(A1:A12)),IF(A1:A12>0,,ROW(A1:A12)))=MAX(FREQUENCY(IF(A1:A12>0,ROW(A1:A12)),IF(A1:A12>0,,ROW(A1:A12))))),ROW($1:$13))-MAX(FREQUENCY(IF(A1:A12>0,ROW(A1:A12)),IF(A1:A12>0,,ROW(A1:A12))))-1,,MAX(FREQUENCY(IF(A1:A12>0,ROW(A1:A12)),IF(A1:A12>0,,ROW(A1:A12))))))

数组公式,按ctrl+shift+enter三键结束