Calculating average time with a dd/mm/yyyy hh/mm notation

Maurits

New Member
Joined
Mar 11, 2011
Messages
6
Hey all,

I'm new here and I have an Excel question which is probably very easy for you. I have row of times in the dd/mm/yyyy hh/mm notation. If I calculate the average by =average(A1;A3;A5) it all goes well but at a (for me random) date the average isn't correct any more. It probably has to do with the dd/mm/yyyy part I think but I can't figure it out.

How can I get the average time (only the hh/mm part) if I have a row of dd/mm/yyyy hh/mm cells.

I hope somebody can help me.

Maurits
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hello Maurits,

What sort of times will you have - will they be between certain hours? Averaging clock time is problematic because of the circular nature of time, e.g. what result would you expect to get if you averaged 2 minutes past midnight and two minutes before, i.e. 23:58 and 00:02.

If you average those 2 then you get 12 noon, you might expect 12 midnight......

Notwithstanding the above caveats you might be able to use an "array formula" like

=AVERAGE(MOD(A2:A10;1))

but are you looking to average every other cell?
 
Upvote 0
Hello Barry,

Thank you for your reply but it does not work in my case. I am indeed looking for the average of every other cell. The circular nature of time is indeed the problem here, but is there no way in Excel to cover this? All the the times are close to each other (all between 21.15 and 22.15).
 
Upvote 0
OK, if the times are all in that range it shouldn't be a problem to average them. Assuming you have data in A1:A99 this will average the time only in every other cell, starting at A1

=AVERAGE(IF(MOD(ROW(A1:A99)-ROW(A1);2)=0;IF(ISNUMBER(A1:A99);MOD(A1:A99;1))))

That's an "array formula" that needs to be confirmed with CTRL+SHIFT+ENTER
 
Upvote 0
It works! Thanks a lot. I had to adapt it from row to colum and to Dutch (my Excel version is Dutch) but it works.
 
Upvote 0
Hey all,

I still have one question, the formula works but I would like to understand it to. I have been using it now for some time but I have no clue how it works. If somebody could explain that to me, that would be great.
 
Upvote 0
And there is one more problem. Because some of the times of which I need the average are before and after midnight the average is not "correct". For example, when I have the times 23:50 and 00:10 the average time should be 00:00. Is this possible within the same formula?
 
Upvote 0
Hey guys,

I'm still hoping that somebody can explain the following formula

=AVERAGE(IF(MOD(ROW(A1:A99)-ROW(A1);2)=0;IF(ISNUMBER(A1:A99);MOD(A1:A99;1))))

to me. I want to know how it works but I can't figure it out. I have already solved the problem of average time at midnight btw.

Greetings,

Maurits
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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