Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jeffsfas
 
Posts: n/a
Default Non zero weighted average


I've used sumproduct and array formulas before, but does anyone know how
to calculate a non-zero weigthted average in Excel for a range of
numbers? Thanks for the help.


--
jeffsfas
------------------------------------------------------------------------
jeffsfas's Profile: http://www.excelforum.com/member.php...o&userid=24462
View this thread: http://www.excelforum.com/showthread...hreadid=380573

  #2   Report Post  
bj
 
Posts: n/a
Default

what weighting do you want to use?

"jeffsfas" wrote:


I've used sumproduct and array formulas before, but does anyone know how
to calculate a non-zero weigthted average in Excel for a range of
numbers? Thanks for the help.


--
jeffsfas
------------------------------------------------------------------------
jeffsfas's Profile: http://www.excelforum.com/member.php...o&userid=24462
View this thread: http://www.excelforum.com/showthread...hreadid=380573


  #3   Report Post  
N Harkawat
 
Posts: n/a
Default

=AVERAGE(IF(A1:A6<0,(B1:B6)*(A1:A6)))
array entered (ctrl+shift+enter)

where A1:A6 are the values from where non zeros are to excluded and
B1:b6are the weights


"bj" wrote in message
...
what weighting do you want to use?

"jeffsfas" wrote:


I've used sumproduct and array formulas before, but does anyone know how
to calculate a non-zero weigthted average in Excel for a range of
numbers? Thanks for the help.


--
jeffsfas
------------------------------------------------------------------------
jeffsfas's Profile:
http://www.excelforum.com/member.php...o&userid=24462
View this thread:
http://www.excelforum.com/showthread...hreadid=380573




  #4   Report Post  
jeffsfas
 
Posts: n/a
Default


I have 2 columns, first range is a set of numbers (which includes
zeroes) and the other is balances. I need to weight by the balance
column, excluding the zeroes in the first range of numbers, to get the
Non-zero weighted average of the first range of numbers.

Ex/ Columns
Row A B
1 0 200
2 4 1000
3 16 1400
4 7 1050
5 0 300
6 29 5000

A zero-weighted average would just be the following formula
sumproduct(A1:A6,B1:B6)/sum(B1:B6)
-- but I need to do this as nonzero.

Hope this clarifies, the help is greatly appreciated.


--
jeffsfas
------------------------------------------------------------------------
jeffsfas's Profile: http://www.excelforum.com/member.php...o&userid=24462
View this thread: http://www.excelforum.com/showthread...hreadid=380573

  #5   Report Post  
anilsolipuram
 
Posts: n/a
Default


Try this

=SUMPRODUCT(--(A1:A6<0),B1:B6,A1:A6)/(SUMPRODUCT(--(A1:A6<0)))


--
anilsolipuram
------------------------------------------------------------------------
anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271
View this thread: http://www.excelforum.com/showthread...hreadid=380573



  #6   Report Post  
jeffsfas
 
Posts: n/a
Default


Not sure what this syntax "--" means in this formula:
SUMPRODUCT(--(A1:A6<0),B1:B6,A1:A6)/(SUMPRODUCT(--(A1:A6<0)))

Does this weight by the balances in column B?


--
jeffsfas
------------------------------------------------------------------------
jeffsfas's Profile: http://www.excelforum.com/member.php...o&userid=24462
View this thread: http://www.excelforum.com/showthread...hreadid=380573

  #7   Report Post  
Harlan Grove
 
Posts: n/a
Default

anilsolipuram wrote...
Try this

=3DSUMPRODUCT(--(A1:A6<0),B1:B6,A1:A6)/(SUMPRODUCT(--(A1:A6<0)))


WRONG! Try reading the OP's follow-up. Column *B* contains the weights.

"A zero-weighted average would just be the following formula
sumproduct(A1:A6,B1:B6)/sum(B1=AD:B6)"

There's no need for a conditional expression in the numerator, only the
denominator.

=3DSUMPRODUCT(A1:A6,B1:B6)/SUMIF(A1:A6,"<0",B1:B6)

since the 0s in col A will effectively exclude the corresponding col B
values from the SUMPRODUCT result.

  #8   Report Post  
bj
 
Posts: n/a
Default

try
=sumproduct(A1:A6,B1:B6)/Sumproduct(--(A1:A6<""),B1:B6)
the --( in the sumproduct makes the logical True-False response inside ther
parenthesis become a 1-0 value

"jeffsfas" wrote:


I have 2 columns, first range is a set of numbers (which includes
zeroes) and the other is balances. I need to weight by the balance
column, excluding the zeroes in the first range of numbers, to get the
Non-zero weighted average of the first range of numbers.

Ex/ Columns
Row A B
1 0 200
2 4 1000
3 16 1400
4 7 1050
5 0 300
6 29 5000

A zero-weighted average would just be the following formula
sumproduct(A1:A6,B1:B6)/sum(B1:B6)
-- but I need to do this as nonzero.

Hope this clarifies, the help is greatly appreciated.


--
jeffsfas
------------------------------------------------------------------------
jeffsfas's Profile: http://www.excelforum.com/member.php...o&userid=24462
View this thread: http://www.excelforum.com/showthread...hreadid=380573


  #9   Report Post  
Harlan Grove
 
Posts: n/a
Default

N Harkawat wrote...
=AVERAGE(IF(A1:A6<0,(B1:B6)*(A1:A6)))
array entered (ctrl+shift+enter)

....

This is wrong. Given 1 and 9 in A1 and A2 with A3:A6 blank, 1 and 2 in
B1 and B2, B3:B6 irrelevant. The weighted average of 1 and 2 with
respective weights 1 and 9 should be 1.9 [(1 * 1 + 9 * 2) / (1 + 9)].
The formula above gives 9.5. Do you know what a weighted average is?

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
weighted average in pivot table nasser Excel Discussion (Misc queries) 3 January 18th 06 04:36 PM
Can you calculate "weighted average cost of capital? Dennis Excel Discussion (Misc queries) 1 June 20th 05 07:33 AM
Show weighted average value after filter. BillC Excel Worksheet Functions 3 May 3rd 05 04:13 PM
Weighted Average Aloysicus Excel Discussion (Misc queries) 4 January 5th 05 11:10 AM
What is the formula for weighted average? Seth23hare Excel Worksheet Functions 1 November 23rd 04 08:49 PM


All times are GMT +1. The time now is 09:19 PM.

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

About Us

"It's about Microsoft Excel"