SUMPRODUCT if non-empty cells

Solved
Luc -  
 Luc -
Hello,

I would like to request your help regarding an Excel formula that exceeds my skills.

In cell H4, I calculated the average invested amount across all formats using the following formula: =SUMPRODUCT(C:C,E:E)/SUM(E:E)
In cell H6, I want to calculate the average invested amount only for format 1, meaning only when there is a value in column A.
So, I need to use a formula similar to the one above, but that calculates only when the cells in column A are not empty.

I apologize if my explanations are not clear enough, but I think you should understand thanks to the attached file.
https://www.cjoint.com/c/KEcdkA3wyNv

Thank you in advance.

Configuration: Macintosh / Chrome 90.0.4430.85

1 answer

  1. Mike-31 Posted messages 18405 Registration date   Status Contributor Last intervention   5 147
     
    Hello,

    From what I understand, look at it this way

    =SUMPRODUCT(C:C,E:E)/SUMPRODUCT((E2:E30)*(A2:A30<>""))

    --
    Best,
    Mike-31

    I am responsible for what I say, not for what you understand...
    1
    1. Luc
       
      Good evening,

      I realized in the end that this formula gives an incorrect result, but thank you anyway.
      However, this one works: =SUMPRODUCT((C2:C21)*(E2:E21)*(A2:A21<>""))/SUMPRODUCT((A2:A21<>"")*(E2:E21))
      0