SUMIF with 2 criteria

elevenaminla

New Member
Joined
Jan 13, 2011
Messages
28
hey guys...

From a data table I've created, I'm trying to summarize expenses MONTHLY based on:

a - CATEGORY
b - DATE

I currently have DATE, EXPENSE, CATEGORY as column headers. DATE is in actual date (e.g. 03/05/11), expense is number (e.g. $5,000), category is textual (e.g. Marketing).

What I want to do is SUM by category and by date (e.g. sum all Marketing expenses in March 2011).

I tried a Pivot Table but I can't figure out how to just show March 2011 as a header labels instead of actual dates (03/05/11, 03/06/11, etc).

Any thoughts?

Thank you!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
It's really helpful if you post the version of Excel that you are using so we can give you appropriate instructions.
 
Upvote 0
try this
Excel Workbook
ABCDEF
1DateExpenseCategory
23/5/20115000MarketingMarketing/March 20116000
32/1/20112000Sales
43/1/20111000Marketing
51/15/20111500Accounting
6
Sheet2
Excel 2003
Cell Formulas
RangeFormula
F2=SUMPRODUCT(--(MONTH(A2:A5)=3),--(YEAR(A2:A5)=2011),--(C2:C5="Marketing"),(B2:B5))
 
Upvote 0
Try...

=SUMPRODUCT(--(DateRange-DAY(DateRange)+1=E2),--(CategoryRange=F2),ExpenseRange)

where E2 houses a first day date of a relevant month/year pair
and F2 a category of interest like Marketing.

On Excel 2007 or later, try...

=SUMIFS(ExpenseRange,DateRange,">="&E2,DateRange,"<="&EOMONTH(E2,0),CategoryRange, F2)
 
Last edited:
Upvote 0
Thanks guys!!! Got it to work using the older Excel formula. Wanted to get it a bit more automated with SUMIFS but wasn't working right.

Thanks once again.. this board is a life saver :)
 
Upvote 0
This is the formula I tried

=SUMIFS(ExpenseRange,DateRange,">&F2,DateRange,"<=""&EOMONTH(F2,0),CategoryRange,D3)

Where F2 = 12/1/2010
And D3 = Marketing
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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