SUMIF By time range

Browneh89

Board Regular
Joined
Mar 8, 2019
Messages
55
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am attempting to use a SUMIF formula to calculate the number of units collected received between 3 shift patterns on a worksheet. I have attempted this myself but keep getting a 0 returned.

The time values I'm using as a range are actually a formula looking at another sheet splitting it from its date so I'm not sure if this could be a factor?

This is what I'm working with below I would appreciate any help offered!

Template 2.xlsx
ABCDE
122:00-06:0006:00-14:0014:00-22:00
2000
3
4TimeUnits
501:0048
605:0026
706:0052
806:105
906:2011
1007:0046
1107:304
1207:4028
1308:0052
1408:2016
1508:4016
1609:0028
1709:105
1809:2028
1909:4026
2009:5011
2110:0029
2210:109
2310:2020
2410:302
2510:407
2610:507
2711:0028
2811:108
2911:2052
3011:4015
3111:501
3212:102
3312:303
3412:508
3513:0026
3613:2026
3714:0027
3814:103
3914:2057
4014:4012
4115:0029
4215:106
4315:2020
4415:4026
4516:0028
4616:2020
4716:4026
4817:0029
4917:2020
5017:301
5118:0023
5220:0027
5320:308
5421:0026
5523:0029
Sheet1
Cell Formulas
RangeFormula
C2C2=SUMIFS($B$5:$B$98,$A$5:$A$98,">="&#REF!,$A$5:$A$98,"<"&A1)
D2D2=SUMIFS($B$5:$B$98,$A$5:$A$98,">="&A1,$A$5:$A$98,"<"&TIME(HOUR(A1),MINUTE(A1)+480,0))
E2E2=SUMIFS($B$5:$B$98,$A$5:$A$98,">="&#REF!,$A$5:$A$98,"<"&TIME(HOUR(#REF!),MINUTE(#REF!)+480,0))
A5:A55A5=RIGHT('sheet 2'!A2,5)
Named Ranges
NameRefers ToCells
Print_Area=Sheet1!$A$1:$J$43C2:D2
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Your times in column A are text, try changing the formula to

=RIGHT('sheet 2'!A2,5)+0

Also you have several #REF! errors in your formulas which means that they are referring to ranges that have been deleted.
 
Upvote 0
Your times in column A are text, try changing the formula to

=RIGHT('sheet 2'!A2,5)+0

Also you have several #REF! errors in your formulas which means that they are referring to ranges that have been deleted.

Ahh yeah ignore thoes i didn't realize they would flag. They where failed attempts at the formula even before I deleted the columns which caused the REF error. I have changed the formatting of the column to time with no effect.
 
Upvote 0
I had to overwrite the formulas in column A with the actual times as I don't have the source that they refer to, but this should work.

Note that I've assumed (for example) that 06:00 in column A should be counted in the 06:00-14:00 window, not the 22:00-06:00 window.
Book1
ABCDE
122:00-06:0006:00-14:0014:00-22:00
2103571388
3
4TimeUnits
501:0048
605:0026
706:0052
806:105
906:2011
1007:0046
1107:304
1207:4028
1308:0052
1408:2016
1508:4016
1609:0028
1709:105
1809:2028
1909:4026
2009:5011
2110:0029
2210:109
2310:2020
2410:302
2510:407
2610:507
2711:0028
2811:108
2911:2052
3011:4015
3111:501
3212:102
3312:303
3412:508
3513:0026
3613:2026
3714:0027
3814:103
3914:2057
4014:4012
4115:0029
4215:106
4315:2020
4415:4026
4516:0028
4616:2020
4716:4026
4817:0029
4917:2020
5017:301
5118:0023
5220:0027
5320:308
5421:0026
5523:0029
Sheet10
Cell Formulas
RangeFormula
C2C2=SUMIFS($B$5:$B$55,$A$5:$A$55,">="&TIME(22,0,0))+SUMIFS($B$5:$B$55,$A$5:$A$55,"<"&TIME(6,0,0))
D2D2=SUMIFS($B$5:$B$55,$A$5:$A$55,">="&TIME(6,0,0),$A$5:$A$55,"<"&TIME(14,0,0))
E2E2=SUMIFS($B$5:$B$55,$A$5:$A$55,">="&TIME(14,0,0),$A$5:$A$55,"<"&TIME(22,0,0))
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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