Sum based on value between two cells

S

Sherry N.

Hello,
I have 3 fields, Date, OldestDate and Received. I need to sum the values of
Received between, when Date = Oldestdate. For instance below:

I want to sum the range (Received) between 1/12/2009 in the Date field and
1/12/09 in the OldestDate field for a total of 558.


Date OldestDate Received
1/12/2009 12/23/2008 208
1/13/2009 12/23/2008 20
1/14/2009 12/23/2008 44
1/15/2009 12/23/2008 81
1/16/2009 12/23/2008 42
1/19/2009 1/12/2009 163

Thanks.
 
J

Jacob Skaria

With the query date in D1 try the below formula

=SUM(OFFSET(C1,MATCH(D1,A:A,0)-1,0,MATCH(D1,B:B,0)-MATCH(D1,A:A,0)+1,1))

If this post helps click Yes
 
E

edvwvw

Sumproduct will also work on this

=SUMPRODUCT(--(A2:A7>12/1/9),(B2:B7>12/1/9)*C2:C7)
 
J

joel

On the worksheet use

=SUMPRODUCT(--(A2:A7<=DATEVALUE("1/12/09")),--(A2:A7>=DATEVALUE("1/12/09")),C2:C7)


In VABA use
MyTotal
evalute("SUMPRODUCT(--(A2:A7<=DATEVALUE(""1/12/09"")),--(A2:A7>=DATEVALUE(""1/12/09"")),C2:C7)"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top