Do not calculate a sum if the cell is empty

Solved
Hello,

I would like to know the formula to display an error message if one of the cells in my calculation is empty.

For example, my cell A5:
=A1+A2+A3+A4

But if one of these cells is empty, I would like cell A5 to show a message saying that the sum is impossible because one of these cells is empty. I think I need to use the ISBLANK function, but I'm not sure how.

Thank you for your help.

2 answers

  1. Contributor
    Hello

    =IF(COUNTIF(A1:A4,"");"calculation impossible";SUM(A1:A4))

    cheers
    --
    The quality of the answer mostly depends on the clarity of the question, thank you!
    1
    1. Thank you for your response. However, I am facing a limitation because if the cells are not adjacent (E3, H3, M3, P3, R3), Excel tells me that I have entered too many arguments...

      It seems that it only accepts 3 non-adjacent cells...

      Do you have any idea?
      0
    2. Contributor
      @Aztek33Re
      Indeed, it's not the same question!
      =IF(OR(E3="",H3="",M3="",P3="",R3=""),"",E3+H3+M3+P3+R3)
      Cheers
      0