PDA

View Full Version : [SOLVED:] Sumif a weekly total



NY2DR
04-21-2005, 09:01 PM
Hello everyone,

I have been looking at this site for quite some time now some. I happen to like it alot. I aslo am beggining to learn VBA and I am finding it additive. I would hope to be contributing to this forum once I am up to VBA code speed.

:banghead: Now for the other reason I'm here. I have been looking at a workbook that showed some array formulas and I would like to create one to sumif all totals from lets say 3/13/2005 to 3/19/2005. How would this be done? I have honestly been working on this for 2 days now. I have been using this formula

{=SUM(IF(F16>=Dates&F17<Dates,Amounts))} to no avail.

Is this correct??
I am using excel 2002 on win xp.

Thank you.:friends:

Jacob Hilderbrand
04-21-2005, 09:13 PM
Try this:


=SUMPRODUCT(--(A1:A6>=DATE(2005,3,13)), --(A1:A6<=DATE(2005,3,19)),B1:B6)

Where A1:A6 are the dates, B1:B6 are the values. Or if "Dates" and "Amounts" are Named Ranged then:


=SUMPRODUCT(--(Dates>=DATE(2005,3,13)), --(Dates<=DATE(2005,3,19)),Amounts)

You can also replace the Date function with a cell reference.



Or you can use a Sum(If Array Formula:


=SUM(IF((Dates>=DATE(2005,3,13))*(Dates<=DATE(2005,3,19)),Amounts))

Confirmed with Ctrl + Shift + Enter.

NY2DR
04-21-2005, 09:27 PM
Thank you!!

I would have never guessed using
=SUMPRODUCT(--(Dates>=DATE(2005,3,13)), --(Dates<=DATE(2005,3,19)),Amounts)
But I am familiar with
{=SUM(IF((Dates>=DATE(2005,3,13))*(Dates<=DATE(2005,3,19)),Amounts))} as an array.

I was very close with this formula but I guess I strayed to far.

Thank you again:beerchug:

Jacob Hilderbrand
04-21-2005, 09:35 PM
You're Welcome :beerchug:

Take Care