0

I'm trying to calculate the weighted average of some data for each person B3:B on a list. I pull in the values and weights from a separate sheet based on a filter to match the person in that row of my current sheet, and not include null data.

This is the formula to calculate a single person's weighted average: =AVERAGE.WEIGHTED(FILTER(Form!$G$2:$G, Form!$C$2:$C = $B3, Form!$J$2:$J <> ""), FILTER(Form!$J$2:$J, Form!$C$2:$C = $B3, Form!$J$2:$J <> ""))

But trying to Array it to avoid having the formula in every cell of the column still only gives me the first weighted average. =ARRAYFORMULA(AVERAGE.WEIGHTED(FILTER(Form!$G$2:$G, Form!$C$2:$C = $B3:B, Form!$J$2:$J <> ""), FILTER(Form!$J$2:$J, Form!$C$2:$C = $B3:B, Form!$J$2:$J <> "")))

Is there a way to make this work?

2
  • 1
    AVERAGE.WEIGHTED & FILTER are not supported under ARRAYFORMULA Commented Aug 3, 2021 at 19:40
  • 1
    Can you please provide a sample sheet which contains a sample input and your expected output? Share a test sheet Commented Aug 3, 2021 at 21:00

1 Answer 1

1

=ArrayFormula(VLOOKUP(B2:B,QUERY(QUERY(Form!C:J,"select C,G*J,J where J is not null",1),"select Col1,sum(Col2)/sum(Col3) group by Col1",1),2,FALSE))

  1. Compute the weighted value of each line with the first QUERY
  2. Compute the weighted average of each person with second QUERY
  3. Do ARRAYFORMULA(VLOOKUP on the output
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.