Let's assum that:

- then count the number of rows in range A:A is range A1:A8

- Cell A is = "SP" or cell A = "DP", is cell C1

- Cell B = "X" is cell D1

- any Cell in Range (D:F) <> "" is range E1:E3

then you can use:

=IF(AND(OR(C1="SP";C1="DP");D1="X";SUMPRODUCT(--((E1:E3)<>"")));SUM(A1:A8);"")

I suposse that translation of Excel functions to english is OK. Sorry, but i use spanish language. Also i think that in english you should use , instead of ;

=SI(Y(O(C1="SP";C1="DP");D1="X";SUMAPRODUCTO(--((E1:E3)<>"")));SUMA(A1:A8);"")

## Bookmarks