+ Reply to Thread
Results 1 to 61 of 61

Non zero weighted average

  1. #1
    Registered User
    Join Date
    06-20-2005
    Posts
    4

    Question 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.

  2. #2
    bj
    Guest

    RE: Non zero weighted average

    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. #3
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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. #4
    Registered User
    Join Date
    06-20-2005
    Posts
    4

    Weighting

    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.

  5. #5
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    Try this

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

  6. #6
    Registered User
    Join Date
    06-20-2005
    Posts
    4
    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?

  7. #7
    Forum Contributor
    Join Date
    11-09-2004
    Posts
    451
    To clarify the importance of -- go to mcgimpsey site at:

    http://www.mcgimpsey.com/excel/formulae/doubleneg.html

  8. #8
    Registered User
    Join Date
    06-20-2005
    Posts
    4
    Thanks everyone for all the help. I'm not an Excel expert but these formulas seemed to work for me in calculating what I needed:

    Array formula
    {=SUMPRODUCT(IF(a1:a6<>0,(b1:b6)*(a1:a6)))/SUM(IF(a1:a6<>0,b1:b6))}

    Does not need to be an array formula
    =SUMPRODUCT(--(a1:a6<>0),b1:b6,a1:a6)/(SUMPRODUCT(--(a1:a6<>0),b1:b6))

    This seems to work because I need to weight by what is in column B. I think I copied these formulas into the new thread correctly. There may be a better way to write this but these seem to work for now. I should try this out on more than a few examples. Back to crunching numbers.

  9. #9
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  10. #10
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  11. #11
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  12. #12
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  13. #13
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  14. #14
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  15. #15
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  16. #16
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  17. #17
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  18. #18
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  19. #19
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  20. #20
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  21. #21
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  22. #22
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  23. #23
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  24. #24
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  25. #25
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  26. #26
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  27. #27
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  28. #28
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  29. #29
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  30. #30
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  31. #31
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  32. #32
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  33. #33
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  34. #34
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  35. #35
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  36. #36
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  37. #37
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  38. #38
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  39. #39
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  40. #40
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  41. #41
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  42. #42
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  43. #43
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  44. #44
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  45. #45
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  46. #46
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  47. #47
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  48. #48
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  49. #49
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  50. #50
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  51. #51
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  52. #52
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  53. #53
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  54. #54
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  55. #55
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


  56. #56
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  57. #57
    bj
    Guest

    RE: Non zero weighted average

    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
    >
    >


  58. #58
    N Harkawat
    Guest

    Re: Non zero weighted average

    =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" <bj@discussions.microsoft.com> wrote in message
    news:3E0DA853-66A5-4639-8289-1F0899778F49@microsoft.com...
    > 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
    >>
    >>




  59. #59
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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?


  60. #60
    Harlan Grove
    Guest

    Re: Non zero weighted average

    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.


  61. #61
    bj
    Guest

    Re: Non zero weighted average

    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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1