SUMIFS and between two dates

thart21

Board Regular
Joined
Mar 3, 2005
Messages
159
I am trying to use SUMIFS to sum "Covered By Supply" where, among other criteria, the "Task - Last" dates are "> the end of the "RptgMonth" -6 days" and "<= the last day of the "RptgMonth".

=IFERROR(SUMIFS(Data[Covered by Supply],Data[CCD Bus Mo Yr],$N$1,Data[Div],
$M$1,Data[RptgMonth],$P$1,Data[Task - Last],">"&DATE(YEAR($P$1),MONTH($P$1)+1,-6,Data[Task - Last],"<="&DATE(YEAR($P$1),MONTH($P$1)+0),Data[WeekNo],D9),"-")

As an example, I want to sum where the Task - Last falls between 8/25/2011 and 8/31/2011. When I add the "<=" part to the formula I get a "too many arguments for this function" error. In looking at other posts, I see that I am formatting it correctly, but cannot see where I am getting the error. It is highlighting "Task - Last" in my formula but I think it's because it's expecting something else in it's place as far as the flow of the formula. (???) Any ideas?

Thanks!

Toni
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Looks like you have a missing parenthesis to end the first DATE function (and the second DATE function needs a day), try this version

=IFERROR(SUMIFS(Data[Covered by Supply],Data[CCD Bus Mo Yr],$N$1,Data[Div],
$M$1,Data[RptgMonth],$P$1,Data[Task - Last],">"&DATE(YEAR($P$1),MONTH($P$1)+1,-6),Data[Task - Last],"<="&DATE(YEAR($P$1),MONTH($P$1)+1,0),Data[WeekNo],D9),"-")

...or in Excel 2007 you can use EOMONTH to simplify

=IFERROR(SUMIFS(Data[Covered by Supply],Data[CCD Bus Mo Yr],$N$1,Data[Div],
$M$1,Data[RptgMonth],$P$1,Data[Task - Last],">"&EOMONTH($P$1,0)-6,Data[Task - Last],"<="&EOMONTH($P$1,0),Data[WeekNo],D9),"-")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

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