sumif between date and time

kouangooo

New Member
Joined
Feb 26, 2018
Messages
1
Hi there,
I have following data:
A= Date + Time
B = Date
C= Time
D= Amount
I used Text to column to split the date / time (if that can help ?)

What I would need is to calc the sum of all transaction between certain time frame (between 7h and 11h for example) and per day

So the result should look like +/- something like this :
Breakfast (7h-10h)Lunch (11h - 15h)
1/1/18
2/1/18

<tbody>
</tbody>

I've been trying to figure out the right formulas for some time but can't come up with anything correct...

Thanks for your help :)

12-01-2018 07:32:1212-01-201807:32:1210
26-01-2018 12:26:5526-01-201812:26:5520
08-01-2018 18:34:1508-01-201818:34:1530

<tbody>
</tbody><colgroup><col><col><col span="2"></colgroup>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Please consider the following and clarify your question.



Excel 2010
ABCDEF
1StartEndTotal Time7:0011:0015:00
212-Jan-18 7:3212-Jan-18 22:3215.003.464.007.54
326-Jan-18 12:2626-Jan-18 22:3010.050.002.557.50
408-Jan-18 18:3408-Jan-18 22:303.930.000.003.93
528.983.466.5518.97
6
8c
Cell Formulas
RangeFormula
C2=ROUND((B2-A2)*24,2)
C5=SUM(C2:C4)
D2=(MOD(A2,1)<$E$1)*((MIN(MOD(B2,1),$E$1)-MAX(MOD(A2,1),$D$1))*24)
E2=(MOD(A2,1)<$F$1)*((MIN(MOD(B2,1),$F$1)-MAX(MOD(A2,1),$E$1))*24)
F2=C2-SUM(D2:E2)



Edit and expand this example to address your challenge.
7:00 column means start at 7: to 11:00.
 
Upvote 0

Excel 2010
ABCDEFG
1StartEndTotal Time7:0011:0015:00
212-Jan-18 7:3012-Jan-18 22:3015.003.504.007.50
326-Jan-18 12:2626-Jan-18 22:3010.050.002.557.50
408-Jan-18 18:3408-Jan-18 22:303.930.000.003.93
528.983.506.5518.93
6
7
8StartEnd
912-Jan-18 7:3007:30:0022:3015.003.504.007.50
1026-Jan-18 12:2612:26:5522:3010.050.002.557.50
1108-Jan-18 18:3418:34:1522:303.930.000.003.93
1228.983.506.5518.93
13
8c
Cell Formulas
RangeFormula
D2=ROUND((C2-A2)*24,2)
D9=ROUND((C9-B9)*24,2)
E2=(MOD(A2,1)<$F$1)*((MIN(MOD(C2,1),$F$1)-MAX(MOD(A2,1),$E$1))*24)
E9=(B9<$F$1)*((MIN(C9,$F$1)-MAX(B9,$E$1))*24)
F2=(MOD(A2,1)<$G$1)*((MIN(MOD(C2,1),$G$1)-MAX(MOD(A2,1),$F$1))*24)
F9=(B9<$G$1)*(MIN(C9,$G$1)-MAX(B9,$F$1))*24
G2=D2-SUM(E2:F2)
G9=D9-SUM(E9:F9)
B9=MOD(A9,1)
B10=MOD(A10,1)
B11=MOD(A11,1)
 
Upvote 0

Forum statistics

Threads
1,217,422
Messages
6,136,544
Members
450,020
Latest member
ddobrzynski

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