Reputation: 1077
I am trying to return/sum-if the "total bonus" in column F if the "effective date" is in between the two dates listed in cells G2 and H2. My current formula is returning a "0". What is wrong here?
Formulas are set to automatic in settings.
Upvotes: 1
Views: 1703
Reputation: 3572
If you want to use SUMIF
you first have to sum everything after the first date (1/1/15) and then subtract everything after the second date (1/1/16)
=SUMIF($E$3:$E$5,">="&G2,$F3:F$5)-SUMIF($E3:$E5,">"&$H$2,$F$3:$F$5)
Which in this case results to 7750.
Another possibility is to use SUMIFS
:
=SUMIFS($F$3:$F$5,$E$3:$E$5,">="&G2,$E$3:$E$5,"<="&H2)
Upvotes: 2
Reputation:
Try a SUMIFS,
=sumifs(f$3:f$5, e$3:e$5, ">="&$g$2, e$3:e$5, "<="&$h$2)
Upvotes: 1