Averaging + & - times in Text format

charliemike9285

New Member
Joined
Jan 21, 2023
Messages
14
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Web
I have 3 different groups of employees (RN, PCA, UAA). For the simplicity of this post I've only included a few of the results for PCAs.
I can't figure out what I'm doing wrong in the yellow cells - formulas to count the # of times one of those categories clocked out > 30 mins (0:30) late and the average of the times they left late.
I think it has to do with the fact that the formula I had to use in column R to be able to get negative times to show (if they clocked out early) is in text format because of the formula TEXT(ABS()).
*I cannot use the 1904 time in options though because "options" is locked due to it being a company computer/program*

Current formula for "# of times left late":
=SUMIFS(Table19[Column1],Table19[Job Code Description], [@[Job Desc]],Table19[Time left late (h:mm)], ">0:30")

Current formula for "Avg of time left late (h:mm)":
=AVERAGEIFS(Table19[Time left late (h:mm)], Table19[Job Code Description], [@[Job Desc]], Table19[Time left late (h:mm)], "<>0")

I'm hoping it's just a simple error with how I'm writing the condition of >30mins.....any help would be greatly appreciated, thanks!



Employee Clocking Times.xlsx
TUVWX
2Job DescTotal Shifts# Times left lateAvg Mins left lateColumn1
3RN6670#DIV/0!
4PCA3440#DIV/0!
5UAA610#DIV/0!
reg time format
Cell Formulas
RangeFormula
U3:U5U3=COUNTIFS(Table19[Job Code Description], [@[Job Desc]])
V3:V5V3=SUMIFS(Table19[Column1],Table19[Job Code Description], [@[Job Desc]],Table19[Time left late (h:mm)], ">0:30")
W3:W5W3=AVERAGEIFS(Table19[Time left late (h:mm)], Table19[Job Code Description], [@[Job Desc]], Table19[Time left late (h:mm)], "<>0")

Employee Clocking Times.xlsx
AFGIJKNOR
7Column1Job Code DescriptionShiftShift End TimeClock DateClock-In TimeShift End DateClock-Out TimeTime left late (h:mm)
311PCAAM07:15 PM05/09/202406:37 AM 07:30 PM0:15
321PCAAM07:15 PM05/09/202406:50 AM 07:24 PM0:09
331PCAAM07:15 PM05/09/202406:45 AM 07:23 PM0:08
341PCAAM07:15 PM05/09/202406:35 AM 07:21 PM0:06
351PCAAM07:15 PM05/09/202406:38 AM 07:09 PM-0:06
361PCAAM07:15 PM05/09/202406:44 AM 07:08 PM-0:07
371PCAPM07:15 AM05/08/202406:48 PM5/9/202407:37 AM0:22
381PCAAM07:15 PM05/08/202406:49 AM 07:28 PM0:13
391PCAAM07:15 PM05/08/202406:45 AM 07:27 PM0:12
401PCAAM07:15 PM05/08/202406:40 AM 07:17 PM0:02
411PCAAM07:15 PM05/08/202406:41 AM 07:15 PM0:00
421PCAPM07:15 AM05/08/202406:38 PM5/9/202407:15 AM0:00
431PCAPM07:15 AM05/08/202405:57 PM5/9/202407:12 AM-0:03
441PCAAM07:15 PM05/08/202406:35 AM 07:11 PM-0:04
451PCAPM07:15 AM05/08/202406:43 PM5/9/202407:09 AM-0:06
461PCAAM07:15 PM05/07/202406:54 AM 07:41 PM0:26
471PCAAM07:15 PM05/07/202406:40 AM 07:30 PM0:15
481PCAPM07:15 AM05/07/202406:46 PM5/8/202407:23 AM0:08
491PCAAM07:15 PM05/07/202406:38 AM 07:17 PM0:02
501PCAAM07:15 PM05/07/202406:52 AM 07:17 PM0:02
511PCAPM07:15 AM05/07/202406:36 PM5/8/202407:13 AM-0:02
521PCAPM07:15 AM05/07/202406:43 PM5/8/202407:12 AM-0:03
531PCAPM07:15 AM05/07/202406:45 PM5/8/202407:02 AM-0:13
541PCAPM07:15 AM05/07/202406:55 PM5/8/202407:09 AM-0:06
551PCAAM07:15 PM05/07/202406:43 AM 07:08 PM-0:07
561PCAAM07:15 PM05/07/202406:51 AM 07:08 PM-0:07
571PCAPM07:15 AM05/06/202406:36 PM5/7/202407:50 AM0:35
581PCAAM07:15 PM05/06/202406:47 AM 07:39 PM0:24
591PCAAM07:15 PM05/06/202406:44 AM 07:34 PM0:19
601PCAPM07:15 AM05/06/202406:43 PM5/7/202407:28 AM0:13
611PCAPM07:15 AM05/06/202406:33 PM5/7/202407:27 AM0:12
621PCAPM07:15 AM05/06/202407:09 PM5/7/202407:20 AM0:05
631PCAAM07:15 PM05/06/202406:38 AM 07:19 PM0:04
641PCAAM07:15 PM05/06/202406:39 AM 07:19 PM0:04
651PCAPM07:15 AM05/06/202406:36 PM5/7/202407:14 AM-0:01
reg time format
Cell Formulas
RangeFormula
I31:I65I31=TEXT([@[Shift End Time (Mil)]], "hh:mm AM/PM")
K31:K65K31=TEXT([@[In Time3]], "hh:mm AM/PM")
N31:N65N31=IF([@Shift]="PM",([@[Clock Date]]+1),"")
O31:O65O31=TEXT([@[Out Time3]], "hh:mm AM/PM")
R31:R65R31=IF([@[Clock-Out Time]]-[@[Shift End Time]]>=0, TEXT([@[Clock-Out Time]]-[@[Shift End Time]], "h:mm"),TEXT(ABS([@[Clock-Out Time]]-[@[Shift End Time]]),"-h:mm"))
 
In W3 I made sure the Time(0,0,0) was changed to Time(0,30,0) however, it did not change the times...so I am unsure how to fix that.
You previously had a requirement to Exclude time = 0 (<> in the formula). Since > 30 mins already excludes 0 you can replace that part with > 30 mins.
Try this:
Excel Formula:
=LET(strTime,TEXT(Table1914[Time left late (h:mm)],"hh:mm"),
            valTime,IF(LEFT(strTime,1)="-",
                                     -1*TIMEVALUE( RIGHT( strTime,LEN(strTime)-1 ) ),
                                     TIMEVALUE(strTime)),
             toleranceTime, TIME(0,30,0),
              sumTime,SUM((valTime > toleranceTime)*(Table1914[Job Code Description]=[@[Job Desc]])*valTime),
              countTime,SUM((valTime > toleranceTime)*(Table1914[Job Code Description]=[@[Job Desc]])),
              avgTime,IFERROR(sumTime/countTime,0),
               IF(avgTime<0,"-"&TEXT(ABS(avgTime),"hh:mm"),avgTime))
 
Upvote 1

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.

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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