Thread: Tough one...
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default Tough one...

Peter,

I understand that you have 4 columns. First two columns contain some
field values, third is the year, 4th is the amounts to be averaged.
Assuming that a value for A is in K1, a value for B in K2 and hte year
in K3, the following formula will give you the average of the entries
meeting all three criteria.

=SUMPRODUCT(--(A2:A100=K1),--(B2:B100=K2),--(C2:C100=K3),D2:100)/SUMPRODUCT(--(A2:A100=K1),--(B2:B100=K2),--(C2:C100=K3))

If you further want to chart only permissible entries, you can use an
additional column, where the following formula, to be placed in E2, can
be copied down:

=IF((A2=K1)*(B2=K2)*(B2=K3),D2,NA())

You can base your new chart on column E:E and it will only include the
non-#N/A values.

HTH
Kostis Vezerides