代码之家  ›  专栏  ›  技术社区  ›  Davidson

根据Google表格中的条件自动减法

  •  -2
  • Davidson  · 技术社区  · 1 年前

    如何根据Google表格中的条件垂直向下进行自动减法

    SKU SKU余额 我要奶油 客户订单 欲望公式
    10100 100 115501 90 10
    10100 100 115502 10 0
    10036 100 115503 25 75
    10036 100 115504 25 50
    10036 100 115505 5. 45
    10040 100 115506 50 50
    10040 100 115507 25 25
    10040 100 115508 30 5.
    10041 100 115519 50 重复
    10041 100 115519 50 重复
    10041 100 115519 50 重复
    10036 100 115520 45 0

    https://docs.google.com/spreadsheets/d/1lJKWrmMXNtvNoVY7KiBSX-_b7yKPh6Ooa3gcnubqi3o/edit?gid=0#gid=0

    1 回复  |  直到 1 年前
        1
  •  0
  •   rockinfreakshow    1 年前

    这里有一个通用的公式方法,您可以相应地进行调整

    此外,目前的公式也不适用于SKU的情况 10041 只有两个副本 ID CUST 不,还有一个明显的不,因为这样的事情没有明确说明!

    =map(A2:A,lambda(Σ,if(Σ="",,if(let(Λ,filter(C:C,A:A=Σ),counta(Λ)<>countunique(Λ)),"DUPLICATE",+filter(B:B,A:A=Σ)-sum(chooserows(filter(D:D,A:A=Σ),sequence(countif(A2:Σ,Σ))))))))
    

    enter image description here