Forum Discussion

Jacodw0901's avatar
Jacodw0901
New Member
6 years ago
Solved

Weighted average calculation

Hi,

 

I would like to calculate the weighted average values on a matrix. This is a sample dataset:

 

UserIdCritIDCritSelValPoolCritIDPoolSelVal
130.2045.00
120.1457.00
120.2045.00
120.1437.00
110.2055.00
147.0050.14
110.1447.00
135.0050.20
115.0030.20
115.0020.20
145.0030.20
157.0020.14
145.0020.20
137.0020.14
155.0010.20
150.1447.00
147.0010.14
150.2035.00
130.2015.00
120.2015.00

 

This is the matrix view, using CritID and PoolCritID. Values in Matrix is the PoolSelVal

 
 
 12345
1 5.0005.0000.1430.200
20.200 0.1430.2000.143
30.2007.000 0.2005.000
47.0005.0005.000 7.000
55.0007.0000.2000.143 
Total12.40024.00010.3430.68612.343

I have a problem calculating the weighted average in the table below as the calculation in the row is not the same calculation in the total column

Normalised based on PoolCritID (Column) Column Total used to calculate the normalised value

Weighted average should be the average for each row excluding the 0

 

 12345Weighted Average
10.0000.2080.4830.2080.0160.23
20.0160.0000.0140.2920.0120.08
30.0160.2920.0000.2920.4050.25
40.5650.2080.4830.0000.5670.46
50.4030.2920.0190.2080.0000.23

 

Thanks

2 Replies