SUMIFS with two Criteria in Same Field

LearnMeExcel

Well-known Member
Joined
Aug 11, 2009
Messages
746
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi Gurus
Excel Workbook
ABCDEFG
1DateItemValueItemFromTo
201/01/2011N 342N 101/02/201130/04/2011
311/01/2011N 163N 2
421/01/2011N 311
531/01/2011N 461For One Criteria in Field Item59
610/02/2011N 363For Two Criteria in Field Item0269
720/02/2011N 371269
802/03/2011N 149
912/03/2011N 292
1022/03/2011N 110
1101/04/2011N 281
1211/04/2011N 457
1321/04/2011N 237
1401/05/2011N 4100
1511/05/2011N 351
Sheet3
Excel 2010
Cell Formulas
RangeFormula
F5=SUMIFS(C2:C15,B2:B15,E2,A2:A15,">="&F2,A2:A15,"<="&G2)
F6=SUMIFS(C2:C15,B2:B15,E2,B2:B15,E3,A2:A15,">="&F2,A2:A15,"<="&G2)
F7=SUMPRODUCT(--(ISNUMBER(MATCH(B2:B15,E2:E3,0))),--(A2:A15>=F2),--(A2:A15<=G2),C2:C15)
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}. Note: Do not try and enter these manually yourself

this is my data
in CEll F6 i used this formula
=SUMIFS(C2:C15,B2:B15,E2,B2:B15,E3,A2:A15,">="&F2,A2:A15,"<="&G2)
the result zero
cuz i check the N1 and N2 in Sames Formula
but it works when i have two Criteria for date
here is the formula in F5
=SUMIFS(C2:C15,B2:B15,E2,A2:A15,">="&F2,A2:A15,"<="&G2)
why it doesn't work ?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi,

Maybe

=SUMPRODUCT(SUMIFS(C2:C15,B2:B15,E2:E3,A2:A15,">="&F2,A2:A15,"<="&G2))

HTH

M.
 
Upvote 0
F6, just enter:

=SUMPRODUCT(SUMIFS(C2:C15,B2:B15,E2:E3,A2:A15,">="&F2,A2:A15,"<="&G2)

As you see, E2:E3 is specified as a condition set for B2:B15. This set up yields effectively an OR-object. SumProduct collects (totals) them together.

ISNUMBER(MATCH(B2:B15,E2:E3,0)) has the same effect: an OR-object. [1]

If you list each criterion separately as you have done, we get an AND-specification, where a B-cell supposed to satisfy E2 as wel as E3.

Note. It would be interesting to know the history of spreadsheet expressions like this one: When, by whom, etc.
 
Upvote 0
Thanx Marcelo
and thanx Aladin
now it is clear for me, my Problem with type of condition AND , OR
with Date the condition was OR
but with Item the condition was AND
from this pionts : SUMIFS work with conditions OR if Criteria in same Field

you are so great Aladin

but sorry i can't get your idea from this Note
Note. It would be interesting to know the history of spreadsheet expressions like this one: When, by whom, etc.

 
Upvote 0
Thanx Marcelo
and thanx Aladin
now it is clear for me, my Problem with type of condition AND , OR
with Date the condition was OR
but with Item the condition was AND

The two date conditions are in fact yielding an AND-object: Thus, a date in the date range must satisfy >= F2 and <= G2 at the same time like in:

2 >= 1 and 2 <= 3

2 meets the two conditions at the same time.

from this pionts : SUMIFS work with conditions OR if Criteria in same Field
Yep...

you are so great Aladin

Thanks for providing feedback and compliment:oops:...

but sorry i can't get your idea from this Note

That was a side note for a call that somebody should write a spreadsheet history.
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,550
Members
452,927
Latest member
rows and columns

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