Summing valuesif associated date falls within a range.

bravos111

New Member
Joined
Mar 28, 2006
Messages
5
This has got to be fairly simple, but my brain is fried.

I have two data sets like so as an example:

12-Dec-05 $50
13-Dec-05 $60
14-Dec-05 -$35
04-Jan-06 $100
10-Jan-06 -$20

etc.

Now I have another data set which is to just be the sums of the monthly totals.

example:

Dec-05 (need to do a sumif when the data is in Dec-05)
Jan-06 (same for this month)
etc.

I can not figure out how to get sumif to work, and I'm not even sure sumif will work best or at all here?

Thanks for any help..
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi,
Welcome to the board!

You need a SUMPRODUCT():

=SUMPRODUCT(--(A1:A100>=Z1),--(A1:A100<=Z2),B1:B100)

Where Col A houses the dates, B the values and
Z1 = start date
Z2 = end date

Adjust ranges to suite :)

Regards,
Jon
 
Upvote 0
Hi Bravos111

A couple of possibilities:

Assuming data starts in A1:B5 (as per your example above - adjust ranges to suit)

Code:
=SUMPRODUCT(--(TEXT(A1:A5,"mmmyy")=TEXT(A1,"mmmyy")),B1:B5)

or using Sumif:

Code:
=SUM(SUMIF(A1:A5,{">=1/12/2005",">31/12/2005"},B1:B5)*{1,-1})
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,314
Members
449,153
Latest member
JazzSingerNL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top