How to sum a column between 2 dates and times

ascott523

New Member
Joined
Oct 5, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I have a report that I need to sum all values between 9 am on day 1 and 5 am on day 2. Unfortunately my report format is the below. This report updates every day so I need a dynamic formula that will always sum 9 am to 5 am based on a date stated in a different cell. So for example, if my reference cell says 10/4/22, I need the sum of column 2 for 10/4/22 9:00:00 AM through 10/5/2022 5:00:00 AM. I've tried just reformatting the first cell into a date but the time format won't let me do a between formula because the dates are different and the time isn't in a 24 hour format and I'm not sure how to get it to that point. Formulas or macro solutions would be welcome, thanks in advance!

10/5/2022 5:00:00 AM
61​
10/5/2022 4:00:00 AM
40​
10/5/2022 3:00:00 AM
25​
10/5/2022 2:00:00 AM
15​
10/5/2022 1:00:00 AM
69​
10/5/2022 12:00:00 AM
107​
10/4/2022 11:00:00 PM
107.84​
10/4/2022 10:00:00 PM
110.95​
10/4/2022 9:00:00 PM
104​
10/4/2022 8:00:00 PM
108​
10/4/2022 7:00:00 PM
115​
10/4/2022 6:00:00 PM
113​
10/4/2022 5:00:00 PM
116​
10/4/2022 4:00:00 PM
114​
10/4/2022 3:00:00 PM
120​
10/4/2022 2:00:00 PM
123​
10/4/2022 1:00:00 PM
120​
10/4/2022 12:00:00 PM
117​
10/4/2022 11:00:00 AM
116​
10/4/2022 10:00:00 AM
119​
10/4/2022 9:00:00 AM
121​
10/4/2022 8:00:00 AM
123​
10/4/2022 7:00:00 AM
117​
10/4/2022 6:00:00 AM
104​
10/4/2022 5:00:00 AM
67​
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
MrExcelPlayground12.xlsx
ABCDE
2TimeThing
310/5/2022 5:006110/4/20222041.79
410/5/2022 4:0040
510/5/2022 3:0025
610/5/2022 2:0015
710/5/2022 1:0069
810/5/2022 0:00107
910/4/2022 23:00107.84
1010/4/2022 22:00110.95
1110/4/2022 21:00104
1210/4/2022 20:00108
1310/4/2022 19:00115
1410/4/2022 18:00113
1510/4/2022 17:00116
1610/4/2022 16:00114
1710/4/2022 15:00120
1810/4/2022 14:00123
1910/4/2022 13:00120
2010/4/2022 12:00117
2110/4/2022 11:00116
2210/4/2022 10:00119
2310/4/2022 9:00121
2410/4/2022 8:00123
2510/4/2022 7:00117
2610/4/2022 6:00104
2710/4/2022 5:0067
2810/4/2022 4:00125
2910/4/2022 3:00124
3010/4/2022 2:00148
3110/4/2022 1:00111
3210/4/2022 0:00114
3310/3/2022 23:0017
3410/3/2022 22:0063
3510/3/2022 21:005
3610/3/2022 20:00105
3710/3/2022 19:00115
3810/3/2022 18:0018
3910/3/2022 17:00130
4010/3/2022 16:00145
4110/3/2022 15:0062
4210/3/2022 14:00121
4310/3/2022 13:0080
4410/3/2022 12:0072
4510/3/2022 11:00138
4610/3/2022 10:0043
4710/3/2022 9:0014
4810/3/2022 8:0063
4910/3/2022 7:0093
5010/3/2022 6:0038
5110/3/2022 5:0052
5210/3/2022 4:0065
5310/3/2022 3:0079
5410/3/2022 2:00150
5510/3/2022 1:00126
5610/3/2022 0:0099
5710/2/2022 23:0087
5810/2/2022 22:0074
5910/2/2022 21:00114
6010/2/2022 20:00120
6110/2/2022 19:00104
6210/2/2022 18:0042
6310/2/2022 17:0021
6410/2/2022 16:00101
6510/2/2022 15:0047
6610/2/2022 14:0066
6710/2/2022 13:0085
6810/2/2022 12:0043
6910/2/2022 11:0014
7010/2/2022 10:0063
7110/2/2022 9:0093
Sheet21
Cell Formulas
RangeFormula
E3E3=SUMIFS(Table1[Thing],Table1[Time],">="&(INT(D3)+9/24),Table1[Time],"<="&(INT(D3)+29/24))
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,521
Members
449,088
Latest member
RandomExceller01

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