View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Woody13 Woody13 is offline
external usenet poster
 
Posts: 16
Default Forumla for averaging within a month

I'm still unable to get the basic SUMIF formula to work:
SUMIF(Dates,"="&StartDate,Values)

My exact formula reads like this: =SUMIF(C6:C429,"="H3,D6:D429) where H3
is the Start date. C column is dates, D is Value. It says there is an
error. It lets me do it if I change the criteria to this
=SUMIF(C6:C429,"=H3",D6:D429) but it just returns 0. Thanks for your
help.

"Ron Rosenfeld" wrote:

On Thu, 28 Sep 2006 15:49:02 -0700, Woody13
wrote:

I realized I need to include =start date cell all in " ", but then the
answer came back zero. It seems as if SUMIF is meant to work when the
criteria is in the cells you are summing (VALUES) and not in the DATES. Is
there a way to toggle how the formula looks at criteria? Thanks


No. That's not it.

The problem is a typo in what I had posted:


=(SUMIF(Dates,"="&StartDate,Values) - SUMIF(Dates,""&EndDate,Values))
/(COUNTIF(Dates,"="&StartDate) - COUNTIF(Dates,""&EndDate))


Here are the data I tested it on:

3/1/2006 StartDate
3/31/2006 EndDate


Dates Values
5-Jan 1
6-Jan 2
4-Mar 3
5-Mar 4
4-Sep 5
5-Jun 6


Result: 3.5

I used NAME'd ranges, but you can use direct references.
--ron