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

2024年11月18日 07:28
有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三键结束