Use a formula in the SUMIFS criteria range

mcleester

New Member
Joined
Feb 13, 2012
Messages
3
Is there a way to use a formula in the sumifs function criteria range?

For example, say there column A has dates and column B has sales figures. If I wanted to find all the sales in December 2011, I would normally create two extra columns C =year(A1) and D =month(A1).

Then my formula would be sumifs(B1:B10,C1:C10,2011,D1:D10,12). It would obviously be ideal to not have to create extra columns and be able to do:

sumifs(B1:B10,year(A1:A10),2011,month(A1:A10),12)

That doesn't work and I can't seem to use array formulas (the ones with the {}) to do it within the function either. Anyone know a way?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Welcome to the board...
=SUMPRODUCT(--(YEAR(A1:A10)=2011),--(MONTH(A1:A10)=12),(B1:B10))
 
Upvote 0
Is there a way to use a formula in the sumifs function criteria range?

For example, say there column A has dates and column B has sales figures. If I wanted to find all the sales in December 2011, I would normally create two extra columns C =year(A1) and D =month(A1).

Then my formula would be sumifs(B1:B10,C1:C10,2011,D1:D10,12). It would obviously be ideal to not have to create extra columns and be able to do:

sumifs(B1:B10,year(A1:A10),2011,month(A1:A10),12)

That doesn't work and I can't seem to use array formulas (the ones with the {}) to do it within the function either. Anyone know a way?

Try...

E1: 1-Dec-11

F1:

=SUMIFS($B$1:$B$10,$A$1:$A$10,">="&$E1,$A$1:$A$10,"<"&EDATE($E1,1))
 
Upvote 0
Is there a way to use a formula in the sumifs function criteria range?

For example, say there column A has dates and column B has sales figures. If I wanted to find all the sales in December 2011, I would normally create two extra columns C =year(A1) and D =month(A1).

Then my formula would be sumifs(B1:B10,C1:C10,2011,D1:D10,12). It would obviously be ideal to not have to create extra columns and be able to do:

sumifs(B1:B10,year(A1:A10),2011,month(A1:A10),12)

That doesn't work and I can't seem to use array formulas (the ones with the {}) to do it within the function either. Anyone know a way?

if you have 2011data with 2011dates and 2011amounts try,

=SUMIFS(2011AMOUNT,2011DATES,">=1-DEC-2011",2011DATES,"<=31-DEC-2011)

or you can put those criteria in a cell and reference them try,
A1 = 1-DEC-2011
A2 = 31-DEC-2011

=SUMIFS(2011AMOUNTS,2011DATES,">="&A1,2011DATES,"<="&A2)

hope this help.:cool:
 
Upvote 0
You may also use

=SUMPRODUCT(Sales,(MONTH(Date)=12)+0,(YEAR(Date)=2011)+0)

Date = dates in column A
Sales = Amounts in column B
 
Upvote 0
Welcome to the board...
=SUMPRODUCT(--(YEAR(A1:A10)=2011),--(MONTH(A1:A10)=12),(B1:B10))

That works great! can you explain to me why you need the double negative signs? The other replies are really cool too...this board is crazy. Thanks for all the help.
 
Upvote 0
SumIfs faster...

I will have to take the time to more fully understand that formula then too. I think if I used yours, I would just create a "report table" that had start date and end dates for "reporting periods" and reference those dates in your formula. Thanks so much!
 
Upvote 0
Hi!!! I have a question. Is it possible for me to have sumifs function and use criteria range that consists of formulas.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,020
Messages
6,175,970
Members
452,691
Latest member
Tony_Almeida

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