Formula sum if for tot time calculation.

asyamonique

Well-known Member
Joined
Jan 29, 2008
Messages
1,280
Office Version
  1. 2013
Platform
  1. Windows
Good Day,
How can I get customers total time visit base on below table?
Many Thanks.

Customer IDFirst NameLast NameTime InTime OutCustomer IDFirst NameLast NameTot.Hrs.
12345xxxxxxxxxxxx9:1512:2112345xxxxxxxxxxxx?
12345xxxxxxxxxxxx12:1514:1098765xxxxxxxxxxxx?
12345xxxxxxxxxxxx22:052:05
12345xxxxxxxxxxxx2:154:22
98765xxxxxxxxxxxx14:2216:45
98765xxxxxxxxxxxx15:3018:22
98765xxxxxxxxxxxx18:2421:35
98765xxxxxxxxxxxx19:3523:00
98765xxxxxxxxxxxx22:1022:55
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I show you 2 options.

Option 1:
Dante Amor
ABCDEFGHIJ
1Customer IDFirst NameLast NameTime InTime OutCustomer IDFirst NameLast NameTot.Hrs.
212345xxxxxxxxxxxx09:1512:2112345xxxxxxxxxxxx11:08
312345xxxxxxxxxxxx12:1514:1098765xxxxxxxxxxxx12:36
412345xxxxxxxxxxxx22:0502:05
512345xxxxxxxxxxxx02:1504:22
698765xxxxxxxxxxxx14:2216:45
798765xxxxxxxxxxxx15:3018:22
898765xxxxxxxxxxxx18:2421:35
998765xxxxxxxxxxxx19:3523:00
1098765xxxxxxxxxxxx22:1022:55
Sh1
Cell Formulas
RangeFormula
J2:J3J2=SUM(($A$2:$A$10=G2)*($B$2:$B$10=H2)*($C$2:$C$10=I2)*($E$2:$E$10)+ IF(($A$2:$A$10=G2)*($B$2:$B$10=H2)*($C$2:$C$10=I2)*($E$2:$E$10)< ($A$2:$A$10=G2)*($B$2:$B$10=H2)*($C$2:$C$10=I2)*($D$2:$D$10),24)- ($A$2:$A$10=G2)*($B$2:$B$10=H2)*($C$2:$C$10=I2)*($D$2:$D$10))
Press CTRL+SHIFT+ENTER to enter array formulas.


Option 2 with a helper column:
Dante Amor
ABCDEFGHIJ
1Customer IDFirst NameLast NameTime InTime OutAuxCustomer IDFirst NameLast NameTot.Hrs.
212345xxxxxxxxxxxx09:1512:2103:0612345xxxxxxxxxxxx11:08
312345xxxxxxxxxxxx12:1514:1001:5598765xxxxxxxxxxxx12:36
412345xxxxxxxxxxxx22:0502:0504:00
512345xxxxxxxxxxxx02:1504:2202:07
698765xxxxxxxxxxxx14:2216:4502:23
798765xxxxxxxxxxxx15:3018:2202:52
898765xxxxxxxxxxxx18:2421:3503:11
998765xxxxxxxxxxxx19:3523:0003:25
1098765xxxxxxxxxxxx22:1022:5500:45
Sh2
Cell Formulas
RangeFormula
J2:J3J2=SUMIFS($F$2:$F$10,$A$2:$A$10,G2,$B$2:$B$10,H2,$C$2:$C$10,I2)
F2:F10F2=E2+IF(E2<D2,24)-D2


🤗
 
Upvote 0
Thanks Dante,
I did some changes and used ur below formula.
Cheers.

Excel Formula:
=SUM(($A$2:$A$10=G2)*($E$2:$E$10)+
IF(($A$2:$A$10=G2)*($E$2:$E$10)<
($A$2:$A$10=G2)*($D$2:$D$10),24)-
($A$2:$A$10=G2)*($D$2:$D$10))
 
Upvote 0
T202309a.xlsm
ABCDEFGHIJ
1Customer IDFirst NameLast NameTime InTime OutCustomer IDFirst NameLast NameTot.Hrs.
212345xxxxxxxxxxxx09:1512:2112345xxxxxxxxxxxx11:08
312345xxxxxxxxxxxx12:1514:1098765xxxxxxxxxxxx12:36
412345xxxxxxxxxxxx22:0502:05
512345xxxxxxxxxxxx02:1504:22
698765xxxxxxxxxxxx14:2216:45
798765xxxxxxxxxxxx15:3018:22
898765xxxxxxxxxxxx18:2421:35
998765xxxxxxxxxxxx19:3523:00
1098765xxxxxxxxxxxx22:1022:55
2d
Cell Formulas
RangeFormula
J2:J3J2=SUMPRODUCT(--($A$2:$A$10=G2),$E$2:$E$10-$D$2:$D$10+($D$2:$D$10>$E$2:$E$10))
 
Upvote 0
Solution
How can we add below text into the result as hr and min?

Excel Formula:
"[h]\h\r\s m\m\i\n"
 
Upvote 0
Hello again,
I did add by using from my old datas. :))
Fixed already.
Thanks

Excel Formula:
=IF(TEXT(SUMPRODUCT(--($B$3:$B$2000=J3),$E$3:$E$2000-$D$3:$D$2000+($D$3:$D$2000>$E$3:$E$2000)),"[h]\h\r\s m\m\i\n")="0hrs 0min","",TEXT(SUMPRODUCT(--($B$3:$B$2000=J3),$E$3:$E$2000-$D$3:$D$2000+($D$3:$D$2000>$E$3:$E$2000)),"[h]\h\r\s m\m\i\n"))
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,111
Members
449,205
Latest member
ralemanygarcia

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