【问题标题】:SUM values in one column if criteria exists at least once per value in another column如果条件在另一列中的每个值至少存在一次,则对一列中的值求和
【发布时间】:2020-11-04 08:24:50
【问题描述】:
    |    A      B             C                 D        |    E          F       |     G        H
----|----------------------------------------------------|-----------------------|-------------------
1   |                                                    |                       |    
2   |        Products        date            quantity    |                       |
----|----------------------------------------------------|-----------------------|-------------------
3   |        Product_A       2020-01-08          0       |   From     2020-01-01 |  Result:     800
4   |        Product_A       2020-12-15          0       |   to       2020-10-31 |
5   |        Product_A       2020-12-23          0       |                       |
6   |        Product_A                         500       |                       |
----|----------------------------------------------------|-----------------------|------------------
7   |        Product_B       2020-11-09          0       |                       | 
8   |        Product_B       2021-03-14          0       |                       |
9   |        Product_B                         700       |                       |
----|----------------------------------------------------|-----------------------|------------------
10  |        Product_C       2020-02-05          0       |                       |
11  |        Product_C       2020-07-19          0       |                       |
12  |        Product_C       2020-09-18          0       |                       |
13  |        Product_C       2020-09-25          0       |                       |
14  |        Product_C                         300       |                       |
14  |                                                    |                       |
15  |                                                    |                       |

在表格中,我列出了每个产品有多个日期的不同产品。
每个产品下方都有一行显示数量。

现在在Cell H3 中,我想获取在Cell F3Cell F4 的日期之间至少有一个日期的所有产品数量的Sum。在示例中,这适用于Product_AProduct_C,因此总和为500+300=800

我不知道我需要什么样的公式来实现这一点。
我想它一定是这样的:

SUMIFS(Date in Cell F3 OR in Cell F4 exists for Product in Column C THEN SUM over Column D)

你知道这个公式的样子吗?

【问题讨论】:

    标签: excel excel-formula


    【解决方案1】:

    一种方法是将SUMPRODUCT()COUNTIFS() 结合使用:

    =SUMPRODUCT((COUNTIFS(B3:B14,B3:B14,C3:C14,">="&F3,C3:C14,"<="&F4)>0)*D3:D14)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-19
      • 2012-06-26
      • 2020-07-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多