# SUMPRODUCT Issue - Need to calculate weighted average of multiple ranges

1. ## SUMPRODUCT Issue - Need to calculate weighted average of multiple ranges

I am having an issue with a SUMPRODUCT Formula. In the attached excel, I am trying to take a weighted average of the square footage, versus the office. I know the formula would be (square footatage x the % of office)/total square footage. However, due to the format of my company's spreadsheet, I have to use multiple ranges in order to not include the totals for each building.

All help is appreciated. My guess at the formula is in cell E565 (highlighted yellow in red font)

Thanks.Sumproduct Issue.xlsx  Register To Reply

2. ## Re: SUMPRODUCT Issue - Need to calculate weighted average of multiple ranges

The "totals" for each building are the weighted average for that building. If you include them within the grand weighted average formula, they will not affect the result.

=SUMPRODUCT(D6:D564,E6:E564)/SUM(D6:D564)

Alternatively, you could have a criteria to exclude rows where column D is greater than say 1,000,000. All the building subtotals are greater than that and each datum is less.

=SUMPRODUCT(D6:D564,E6:E564,--(D6:D564<1000000))/SUMIF(D6:D564,"<1000000")

Both of these formulas should yield the same result (17.00% for your example data).  Register To Reply

3. ## Re: SUMPRODUCT Issue - Need to calculate weighted average of multiple ranges

Perfect! Thanks for all the help!  Register To Reply