Creating a sleep/wake log - need to calculate average sleep and wake time

MLSNetworks

New Member
Joined
Jun 6, 2019
Messages
17
I have created a sleep/wake log for a sleep experiment where individuals enter in the time they went to bed at night on Row 2 and the time they got up in the morning on Row 3 for 7 days. I have a formula at the end of each row for those 7 days that gives me the average time in bed and average wake time over the 7 day period.

My issue is when I format the cells as Time for each day, excel needs you to enter in the time in "military time" in order to do the calculation at the end of the row and I don't want to have to tell the individuals to enter their time in military time for each day.

For example, if an individual goes to bed at 9:00 PM I don't want them to have to enter in 21:00, I want them to just enter in 9:00 PM because I want to make this log as easy as possible for the user so they don't have to think about what military time to enter. Btw, in case anyone is wondering, this is a manual exercise and using a sleep tracker is expressly not to be used as part of the experiment.;)


Below is an example of my data. I want the hour and minutes of the time the user went to bed and woke up to be "wizzywig" within the cell and have an average formula for the 7 days in cell I2 and I3.
Is there a way to force excel to recognize the cell format as military time when entering in hour and minutes or must the users enter their time in military time?
:confused:
<strike></strike>

ABCDEFGHI
1Week 1Day 1Day 2Day 3Day 4Day 5Day 6Day 7Average
2Time Went to Bed 9:45 PM9:15 PM9:00 PM9:30 PM
9:00 PM
<strike></strike>
<strike></strike>
9:15 PM
<strike></strike>
10:00 PM
3Time Woke Up6:00 AM6:15 PM6:30 PM6:00 AM6:00 PM6:30 PM7:30 AM

<tbody>
</tbody>

Thanks to anyone who can help me with this!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Format the time cells as h:mm;@ AM/PM

The user will enter time in this manner : 9:15 PM and the time will be displayed as 21:15

Or : 9:15 AM and the time will be displayed as 9:15

They must enter the AM or PM at the end.
 
Upvote 0
or try PowerQuery:

Week 1Day 1Day 2Day 3Day 4Day 5Day 6Day 7Average
Time Went to Bed
9:45 PM​
9:15 PM​
9:00 PM​
9:30 PM​
9:00 PM​
9:15 PM​
10:00 PM​
0.21.23.34​
Time Woke Up
6:00 AM​
6:15 PM​
6:30 PM​
6:00 AM​
6:00 PM​
6:30 PM​
7:30 AM​
0.13.15.00​

for last column Custom Format: d.hh.mm.ss
or hh:mm:ss AM/PM

Average
09:23:34 PM​
01:15:00 PM​

Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Avg = Table.AddColumn(Source, "Average", each List.Average({[Day 1], [Day 2], [Day 3], [Day 4], [Day 5], [Day 6], [Day 7]}), type number),
    ROC = Table.SelectColumns(Avg,{"Average"})
in
    ROC[/SIZE]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,326
Members
448,564
Latest member
ED38

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