![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Texas
Posts: 233
|
In 1-2-3 If I type in the following formula @weightavg(e2..e6,f2..f6) I get a weighted average of the two columns. Is there a formula in Excel that does the same? Thanks in advance for your help. -asa
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
=SUMPRODUCT(E2:E6,F2:F6)/SUM(F2:F6)
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Hi,
No standard function, but you can create one easily =SUMPRODUCT(Values, Weights)/Sum(Weights) or in investment terms, =SUMPRODUCT(Shares, Prices)/Sum(Shares) note the above. It makes a big difference which range/array you put into the denominator, so be careful. =SUMPRODUCT(A1:A5,B1:B5)/SUM(B1:B5) is a specific example. Bye, Jay |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Texas
Posts: 233
|
That gives me the answer I need. Thanks. But by the answer, there is no weighted average function, unless I wanted to write one correct?
__________________
Excel 2002 XP SP1 |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
That is correct. Excel does *not* have a weighted average function.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|