Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Calculating a Grouped Weighted Average Rate

I need to calculate the weighted-av-rate using the table below. The
groupings is the TX. The wieghted-av-rate, WVR for 1st day in a TX
group remains same as the rate. E.g in TX A, weighted-av-rate = 1. for
day 2 in TX A, the WVR = ((30*1)+(40*5))/(30+40) and so on. The WVR for
TX B, day 4 is same as the rate,i.e 9. day 5 is obtained using the same
formulae in TX A

pls generate a macro to accomplish this.



DAY TX BALANCE RATE WEIGHTED-AV-RATE
1 A 30 1
2 A 40 5
3 A 10 6
4 B 20 9
5 B 50 5
6 B 30 3
7 C 20 3

thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Calculating a Grouped Weighted Average Rate

I can do it with worksheet formulas, if you can allow one additional
calculated column. Will assume your columns (DAY, TX, BALANCE, RATE) are
A-D. I inserted a column for E and entered this formula in E2 (and copied
down):
=D2*C2
Then for the weighted avg rate, I use this formula in F2 and copied down:
=SUMIF(B:B,B2,E:E)/SUMIF(B:B,B2,C:C)

This puts the weighted avg on each line, if you want to only have it on the
last row for any particular value of TX, I would qualify it as follows:
=IF(B2=B3,"",SUMIF(B:B,B2,E:E)/SUMIF(B:B,B2,C:C))

"sylink" wrote:

I need to calculate the weighted-av-rate using the table below. The
groupings is the TX. The wieghted-av-rate, WVR for 1st day in a TX
group remains same as the rate. E.g in TX A, weighted-av-rate = 1. for
day 2 in TX A, the WVR = ((30*1)+(40*5))/(30+40) and so on. The WVR for
TX B, day 4 is same as the rate,i.e 9. day 5 is obtained using the same
formulae in TX A

pls generate a macro to accomplish this.



DAY TX BALANCE RATE WEIGHTED-AV-RATE
1 A 30 1
2 A 40 5
3 A 10 6
4 B 20 9
5 B 50 5
6 B 30 3
7 C 20 3

thanks.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculate weighted average effective interest rate GK Excel Worksheet Functions 4 May 11th 23 11:43 AM
Calculating Weighted Average sfmoored Excel Worksheet Functions 7 February 28th 11 03:36 AM
Calculating a weighted average in a pivot table mrogge Excel Discussion (Misc queries) 1 April 16th 09 06:15 PM
calculating a weighted average using formula bob green Excel Worksheet Functions 1 August 1st 05 10:33 PM
calculating a weighted average uisng formula bob green Excel Worksheet Functions 1 August 1st 05 06:31 AM


All times are GMT +1. The time now is 03:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"