【问题标题】:Sum every second row only if cell below isn't empty?仅当下面的单元格不为空时才每隔一行求和一次?
【发布时间】:2020-08-17 21:09:30
【问题描述】:

我正在尝试编写一个 excel 公式来对给定列中的每隔一行求和,但前提是下方/上方的单元格不为空。

我的excel表格如下:

      A           B         C
1   Group1      First       3
2               Second      9
3   Group2      First       -
4               Second      8
5   Group3      First       4
6               Second      -

7   Sum         Firsts      <formula1 - should ignore Group3 because its Second cell is empty>   
8               Seconds     <formula2 - should ignore Group2 because its First cell is empty>

【问题讨论】:

  • 单元格是空的还是虚线的?
  • @basic 他们是空的而不是虚线,我的错

标签: excel excel-formula


【解决方案1】:

您可以先使用SUMPRODUCT函数:

=SUMPRODUCT((B9=$B$1:$B$7)*($C$1:$C$7)*(B10=$B$2:$B$8)*($C$2:$C$8<>""))

几秒钟:

=SUMPRODUCT((B9=$B$1:$B$7)*($C$1:$C$7<>"")*(B10=$B$2:$B$8)*($C$2:$C$8))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-06-13
    • 1970-01-01
    • 1970-01-01
    • 2019-12-11
    • 2017-03-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多