Search code examples
google-sheetsgoogle-sheets-formulaweighted-average

Google sheets weighted average function: How do I set this to only use non-zero values?


I'm new to Google sheets / excel and I'm a bit lost. Column E is found by D/C. How do I find the weighted average (B6), but only for values in the E column that have not been filled in yet?

I tried <>"" but it showed an error.

screenshot of relevant portion of google sheet


Solution

  • There are many ways to achieve that, here is a simple one

    =AVERAGE.WEIGHTED(filter(E2:E5,D2:D5<>""),filter(B2:B5,D2:D5<>""))