Search code examples
google-sheetsarray-formulas

How to subtract two cells if another cell has text of "Lost"?


Is it possible to subtract G4:G100 and H4:H100 if I:4:I100 equals "Lost"?

From G4 to G100 I have the amount set to currency as well as H4:H100.

I hope that makes sense.


Solution

  • =ARRAYFORMULA(IF(LEN(G4:G), IF(I4:I="lost", G4:G-H4:H, ), ))
    

    0