code function for weighted average

dennisli

Well-known Member
Joined
Feb 20, 2004
Messages
1,070
Good morning,
Right now I have one formula to get weighted average. If highlight this formula and hold and drag it to right, I can automatically to get each weighted average.
I tried to write function to express this formula in a simple way. Can you guys to help me to write a function code for this?
Thanks lot.
Dennis

Col A Col B

Year 12 24 36 48 60
1996 360 416 346 456 421
2002 400 500 430 230
2003 388 459 389
2004 390 466
2005 393
Weighted Average =SUM(C2:C6)/SUM(B2:OFFSET(B6,-B1/12,0))
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,207,438
Messages
6,078,564
Members
446,349
Latest member
Malroos7912

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