简体   繁体   中英

MS-EXCEL: time averages + numbers to time

I am working on a project for my work and I am having an issue trying to take times and averaging them out. I am getting a #DIV/0! When I convert the cells to XX:XX .

Below are screen shots of the same data and function. The top is with regular numbers the bottom is where I formatted all cells to display in time XX:XX.

Numbers (works fine)

  = AVERAGE(H29,J29,P29,V29,AE29,AJ29)

数字

Time (XX:XX) however I get the #DIV/0! . The AVERAGE Function I am using looks like this:

 =AVERAGE(H29,J29,P29,V29,AE29,AJ29)

时间

Also, if possible, could I enter the data in regular numbers (not time) then have it display in average time ( hours:min ) on the right?.

Thank you.

When working in Excel with dates and times always leave the value as a number and apply formatting. where you have tried to enter a time in hh:mm, you need to show the hours even if they are blank, or the value of that cell becomes a string. But you can't average a string.

These are valid entries 00:23 or 0:23

:23 is not valid time, so is treated as a string

Valid times are stored as a number where 24 hours = 1.

Times are stored as a fraction for example 0:45 = 0.031250000

To fix it, add in the missing leading zeros, or if you have explicitly entered text strings: type a 1 in any cell and copy it, then select all of your time cells and do paste special multiply. That will convert them back to numbers and your average should work. Then apply your custom formatting of required .

I would suggest that users enter the time in minutes eg 17, 23, 92 and you average these, but for the conversion I suggest that you use a formula like this:

=AVERAGE(H29,J29,P29,V29,AE29,AJ29)/(24*60)

This will convert the average time in minutes, into a fraction of a day.

You can then put custom formatting onto the cell to change the format to hh:mm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM