View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Christy Christy is offline
external usenet poster
 
Posts: 89
Default Is there a better way to do this?

This is what I have
E16:E39 are various dates (some duplicated)
G16:G39 are numbers
When H16:H39 = "in" or "ti" then the values in G16:G39 should be added,
however
When H16:H39 = "dd" or "ot" or "s" or "m" the values in G16:G39 should be
subtracted.

I've come up with:
=SUMPRODUCT(--(E16:E39=DATE(2008,1,1)),--(H16:H39="IN")--(H16:H39="TI")-(H16:H39="DD")-(H16:H39="OT")-(H16:H39="S")-(H16:H39="M"),G16:G39)

This works but can it be consolidated? Also, I need to enter this for every
day of the year and when I drag it the date stays the same and only the
reference cells change. I need to know the sum of the items for each day of
the year so I'm wondering what is the fastest way.
Thanks.