View Single Post
  #9   Report Post  
puck1263 puck1263 is offline
Junior Member
 
Posts: 20
Default

Hello again -
I now have a variation on this.

What the above is looking at is looking for the average of the "last" 4 values in a column, (skipping blanks).
Those values happened to be averages of defects/month (# of defects in month/shipments in month) (See column E in attached spreadhseet...it looks at value in column D)

That's all fine and good, except (see example) the # of shipments greatly varies month to month, making this not the best representation.

What I would rather do is break up the avg calculation.
(If column B is blank, column C will always be 0 as defects are tied to the shipment in the month it shipped.)

Instead of (say all fields have a value as they do in this example) what I have now, which is AVG(D2:D5) or effectively: (C2/B2 + C3/B3 + C4/B4 + C5/B5)/4
I would rather have (C2+C3+C4+C5)/(B2+B3+B4+B5) where these are the last 4 rows that have values.
I have simulated this manually in column F.
Any idea how to do this?