how can I calculate a conditional average for a preset sum. I have a the following table:
stock qty type price
msft 2 b 50
msft 2 b 50
dell 2 b 40
msft 2 s 100
msft 2 b 45
I am trying to find the average price of a preset 'qty' where stock is 'msft' and type is 'b'
I am using the following
=AVERAGEIFS(D2:D6,A2:A6,"msft",C2:C6,"b")
which returns 48.33
but i would like to calc average of a preset qty sum (cell F1).e.g avg for total qty '5' along with above conditions should be:
(2*50 + 2*50 + 1*45)/5= 49
VBA function would be real helpful
stock qty type price
msft 2 b 50
msft 2 b 50
dell 2 b 40
msft 2 s 100
msft 2 b 45
I am trying to find the average price of a preset 'qty' where stock is 'msft' and type is 'b'
I am using the following
=AVERAGEIFS(D2:D6,A2:A6,"msft",C2:C6,"b")
which returns 48.33
but i would like to calc average of a preset qty sum (cell F1).e.g avg for total qty '5' along with above conditions should be:
(2*50 + 2*50 + 1*45)/5= 49
VBA function would be real helpful