简体   繁体   English

在Excel中使用空白单元格计算连续增加值

[英]Count consecutive increase values with blank cell in Excel

I have a formula for counting consecutive increase of values in a row range. 我有一个计算行范围内值连续增加的公式。 It seem to work properly with #N/A values (which I have in my dataset) but I get some issues with the first blank value in a row. 它似乎与#N / A值(我在我的数据集中有)一起正常工作但我在连续第一个空白值时遇到了一些问题。 In my example below I should have 3 increases (green cells) for both rows. 在下面的示例中,我应该为两行增加3个(绿色单元格)。

Formulas are (they are array formulas, Ctrl + Shift + Enter): 公式是(它们是数组公式,Ctrl + Shift + Enter):

J2: {=SUM(IFERROR(--((C2:H2>B2:G2)=TRUE);0))} J2:{= SUM(IFERROR( - ((C2:H2> B2:G2)= TRUE); 0))}

J3: {=SUM(IFERROR(--((C3:H3>B3:G3)=TRUE);0))} J3:{= SUM(IFERROR( - ((C3:H3> B3:G3)= TRUE); 0))}

It seems that formula in J3 count D3 as 0 and therefore count an increase from 0 to 0,22. 似乎J3中的公式将D3计为0,因此计数从0增加到0.22。

在此输入图像描述

使用此数组公式使用ctrl + shift + enter完成它而不是只输入。

=SUMPRODUCT(IFERROR((C2:H2>B2:G2), 0)*IFERROR(B2:G2<>"", 0))

I think you're right about blank being treated as 0. I suggest dividing your first logical equation (C3:H3>B3:G3)=TRUE by B3:G3<>"", resulting in a divide-by-zero error on blanks: 我认为你对空白被视为0是正确的。我建议将你的第一个逻辑方程(C3:H3> B3:G3)= TRUE除以B3:G3 <>“”,导致零除错误空格:

J3: {=SUM(IFERROR(--((C3:H3>B3:G3)=TRUE / ((B3:G3)<>""));0))}

Does this fix it for you? 这可以解决吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM