Excluding Specific Date Range in SumIFs Formula

Tres1981

New Member
Joined
Apr 5, 2010
Messages
42
I have your standard sumifs formula:

Sumifs(Sales[Totals],Sales[Agent],"="&A1,Sales[Start Date],">="&E1,Sales[Start Date],"<"&F1....

I the dates in E1 and F1 are 6 months apart. I would like to exclude any dates/totals from this formula that are within a particular month in the middle of the period (Month Start/End dates are in cells G1/H1). Any ideas?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi

Perhaps (not tested in SUMIFS) -

Code:
Sumifs(Sales[Totals],Sales[Agent],"="&A1,],OR(ISNUMBER(MATCH(Sales[Start Date],ROW(INDIRECT($E$1&":"&($G$1-1))),0)),ISNUMBER(MATCH(Sales[Start Date],ROW(INDIRECT($H$1+1&":"&$F$1)),0))),....

The ROW(INDIRECT... sets up an array of qualifying dates for the first and second periods respectively and the MATCH ensures that the Sales Date is in one of the periods.

The formula will have to be entered with Control - Shift - Enter as it is an Array Formula.

hth
 
Upvote 0
Hi

Or resort to SUMPRODUCT with -

Code:
=SUMPRODUCT(Sales[Totals],--(Sales[Agent]=$A$1),--(ISNUMBER(MATCH(Sales[Date],ROW(INDIRECT($E$1&":"&($G$1-1))),0)))+--(ISNUMBER(MATCH(Sales[Date],ROW(INDIRECT($H$1+1&":"&$F$1)),0))))

Btw there is a superfluous "]," in the formula in Post #2 before the OR.

hth
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,812
Members
452,945
Latest member
Bib195

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