jeudi 26 avril 2018

Using averageifs function for time point

I'm stuck with an AVERAGEIFS function in excel and I'm hoping to get some input here. I'm working with data on sleep and have multiple entries per person. I want to know what the average midsleep (the time you go to bed + sleep duration/2) on free days is for one person in week 1 and week 2. So basically just a time point in hh:mm. I already have calculated midsleep for each data point.

What I already did and has worked for sleep duration, e.g. =AVERAGEIFS(BZ2:BZ266, B2:B266, "8469", CC2:CC266, "1", CG2:CG266, "1") the average sleep duration for person 8469 in week 1 on work days (1).

For midsleep it also has worked, but not always. I think there must be going on something with how time works in excel. For example I get 17:49 as person 8470's average midsleep in week 2, but the average sum is 11:39. If I then divide 11:39 into two, it's 17:49 again.

I used the same formula here: =AVERAGEIFS(CB2:CB266,C2:C266,"8470",CG2:CG266,"2",CH2:CH266,"2") - the midlsleep point in week 2 on free days (2).

Do you have any idea what's happening here? It seems to be a time issue. My columns are formatted as hh:mm.

Let me know if you need more information.

All the best, Anita

Aucun commentaire:

Enregistrer un commentaire