Sum if with date range

italy16

New Member
Joined
May 9, 2014
Messages
34
Contract End Dateamounts

1/2/14

<tbody>
</tbody>
50
2/5/1460
4/6/1470

<tbody>
</tbody>

Hello - I'm trying a sumif (I think) where I need to sum the "amounts" column if the contract end date is within a certain number of months from a beginning date. For example, how would I sum the "amounts" column if I wanted all contracts that started within 2 months of Jan. 1 2014? It should sum the 50+60 since they are in the range but not 4/6/14 since it is out of the 2 months window.

Thanks very much
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
If you have the start date in a cell say C1, you would use

=SUMIFS($B$2:$B$500,$A$2:$A$500,"<="&DATE(YEAR($C$1),MONTHS($C$1)+2,DAY($C$1))

I'm assuming the dates above are US format MM/DD/YY
Also, SUMIF and SUMIFS have different order of parameters, it's a good idea to ignore SUMIF and stick to SUMIFS, even if there's only 1 condition, in case you need to add conditions in the future.
You need to tweak the <= as needed to include or exclude contracts that finished before or on the date in C1

I've assumed your dates are in col A and amounts in col B. Also only rows down to 500, you need to adjust the references as needed
 
Last edited:
Upvote 0
Thank you. I'm getting a missing parentheses error (I'm using a Mac) - I can never figure out the parenthese thing :). Any ideas? Thanks in advance.

=sumifs(N14:N16,O14:O16,"<="&DATE(year(N12),months(N12)+2,day(N12))
 
Upvote 0
You just need one on the end. Usually Excel suggests one but it didn't on this occasion, sometimes it doesn't it there's lots of groups of brackets. I don't think using a Mac is the problem, it's just Excel.
=sumifs(N14:N16,O14:O16,"<="&DATE(year(N12),months(N12)+2,day(N12)))
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,813
Members
449,469
Latest member
Kingwi11y

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