Conditional Weighted Average

lager1001

Board Regular
Joined
May 17, 2019
Messages
88
Need help with a weighted average formula. I've tried AverageIfs but get #DIV/0 errors because some of the numbers being calculated in the average are "0".

See below example.

There are 4 unique accounts (but 7 line items) in CW24, each with their respective Score. If I do a simple average, it takes all scores for all line items and I get 63.86. What I need is the weighted average so it calculates each score only once for each account and provide the average by the unique number of accounts for the calendar week. The desired outcome is the "Weighted Average Column" which would be 70.39+65.45+99.96+0.00 / 4. Some of my scores are 0.00 so these have to be inclusive to the formula. Can anyone assist?

Year/CWAccountScoreAverage ScoreWeighted Average
2020-CW24ABC70.3963.8658.95
2020-CW24ABC70.3963.8658.95
2020-CW24ABC70.3963.8658.95
2020-CW24ABC70.3963.8658.95
2020-CW24DEF65.4563.8658.95
2020-CW24GHI99.9663.8658.95
2020-CW24JKL0.0063.8658.95
 
You probably need to confirm the formula with Ctrl Shift Enter, rather than just enter & then fill it down.

I see. It won't allow it because the report is a table. "Multi-cell array formulas aren't allowed in tables". I will have to find a different approach. Thanks for trying.
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
The same formula with Excel table is working in our sheet why is it not working in yours???

I suppose you are making some mistake. I insist please try it will help
 
Upvote 0
Delete the formula from the table, then re-enter it in the first row and confirm it with Ctrl Shift Enter.
If the formula does not automatically propagate down the entire table, then drag it down.
 
Upvote 0
First 1. Copy and paste the data from fluff post.
2. Delete the formula column ie D
3. Go to B2 and Press Ctrl T
4, Press Ok
5. Copy the formula from Fluff post and paste it on D2 with Ctrl+Shift+Enter
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Glad we could help & thanks for the feedback.

Possible to get this to work with an additional IF statement out front? If Date >= CutOff Date then (this formula) else 0.00.

Tried this approach but doesn't seem to be working with the Ctrl+Shift+Enter nature of the weighted average. Any ideas?
 
Upvote 0
=AVERAGE(IFERROR(C2:C8/IF(FREQUENCY(MATCH(B2:B8,B2:B8,0),MATCH(B2:B8,B2:B8,0))>0,1,0),FALSE))

Moving this report into Power BI. Can you assist with getting this same output in DAX? I'm trying different arguments to see if I can get it but thought I'd drop a post here to see if anyone could help.

Thank you.
 
Upvote 0
As this is a totally different question, you need to start a new thread in the Power BI section. Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,303
Members
449,078
Latest member
nonnakkong

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top