SUMIFS Between Date Range

betapiper

New Member
Joined
Apr 9, 2018
Messages
5
Probably a repeat question but i just cant figure this out.

Im trying to sum the number of times a persons name appears in a range on my "classes" sheet if the date in column A is between a range of dates in my "passes" sheet.

Apologies for the terrible formatting of my tables im not familiar with the sticky interface.

classes sheet

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]1[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][TABLE="width: 173"]
<tbody>[TR="class: grid"]
[TD="width: 173, align: right"]Friday, 11 January 2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 130"]
<tbody>[TR="class: grid"]
[TD="width: 130"]Phillip Watson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 130"]
<tbody>[TR="class: grid"]
[TD="width: 130"]Mary Woodson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 130"]
<tbody>[TR="class: grid"]
[TD="width: 130"]Phillip Watson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 130"]
<tbody>[TR="class: grid"]
[TD="width: 130"]Mary Woodson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][TABLE="width: 173"]
<tbody>[TR="class: grid"]
[TD="width: 173, align: right"]Saturday, 12 January 2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 130"]
<tbody>[TR="class: grid"]
[TD="width: 130"]Phillip Watson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 130"]
<tbody>[TR="class: grid"]
[TD="width: 130"]Mary Woodson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 130"]
<tbody>[TR="class: grid"]
[TD="width: 130"]Phillip Watson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 130"]
<tbody>[TR="class: grid"]
[TD="width: 130"]Mary Woodson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][TABLE="width: 173, align: left"]
<tbody>[TR="class: grid"]
[TD="width: 173, align: right"]Sunday, 13 January 2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Phillip Watson[/TD]
[TD]Mary Woodson[/TD]
[TD]Phillip Watson[/TD]
[TD]Mary Woodson[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][TABLE="width: 173"]
<tbody>[TR="class: grid"]
[TD="width: 173, align: right"]Monday, 14 January 2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]Phillip Watson[/TD]
[TD]Phillip Watson[/TD]
[TD]Mary Woodson[/TD]
[TD]Mary Woodson[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 757"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

passes sheet

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]1[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Phillip Watson[/TD]
[TD]Friday, 11 January 2019[/TD]
[TD]Friday, 12 January 2019[/TD]
[TD]xxxxxx[/TD]
[TD]xxxxxx[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]









So essentially what i want to do in the "passes" D2 is sum the number of times Phillip Watson appears within "classes" B2:E5 if the date in "classes" A:A is between "passes" B2:C2

I was trying this but getting nowhere:
=SUMIFS(Classes!$C$2:$V$1000,Classes!A:A,>=Passes!C2,Classes!$A$2:$A$1000,<=Passes!D2)

Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
See if this works:

=SUMPRODUCT((classes!$B$2:$E$5=A2)*(classes!$A$2:$A$5>=B2)*(classes!$A$2:$A$5<=C2))
 
Upvote 0
Sorry for the late reply, xmas and all.

Thanks for the tip. i got it to work with the below:
=SUMPRODUCT((Classes!$B$2:$E$5=A2)*((Classes!$A$2:$A$5>=C2)+(Classes!$A$2:$A$5<=C2)))

Cheers,
 
Upvote 0
What you have there cant work for what you asked for. For your test data it gives result of 10. From what i can see it should be 4.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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