I'm at my wits end and hope someone can help. I have two formulas that work, but I need to combine them and don't know how.
Sample Data:
A B C D 1 NAME START END 2 JOHN 23:49:11 01:32:09 3 MARY 00:28:28 02:12:47 4 ROBERT 00:27:26 02:16:14 5 ROBERT 22:49:22 23:38:45 6 MARY 23:14:26 00:15:57 7 JOHN 23:52:44 01:27:32 8 ROBERT 23:33:27 01:21:34 9 MARY 01:37:59 03:33:37 10 JOHN 00:50:59 02:37:30
I need to calculate the average START and END times for each person, which I can do by entering =AVERAGE(IF($A$2:$A$10=$A2,$B$2:$B$10)) as an array formula. The problem is that because both the start and end times are sometimes before midnight and sometimes after, the result is incorrect. (This formula returns the average of JOHN's START times as 16:10:58.)
I can generate the correct START time average for John by entering =MOD(AVERAGE(IF(B2:B4<=TIME(2,0,0),1+B2:B4,B2:B4)),1), also as an array formula. This provides the correct result of 00:10:58.
What I need to do is combine both of these. I've tried =MOD(AVERAGE(IF(AND(A2:A10=A2,B2:B10<=TIME(2,0,0)),1+B2:B10,B2:B10)),1) but the results are all wrong. For John, it returns 13:24:54.
I'm attaching a workbook with the sample data - I hope someone can make sense of this. Thanks so much!
Bookmarks