Adding time [t]:mm:ss

J

Jan G. Thorstensen

Hi.
I try to figure out the average time spent in a range but cant figure out
how.

This is how it looks like:

00:00:10
00:00:06
00:00:00
00:00:04
00:00:04
------------
=AVERAGE(A2:A6)
===============
Here is a total of 24 seconds.
These seconds should be divided with 4 and return the answer; 00:00:06.

The problem is:
1) One row does not contain any hours, minutes or seconds and should not be
counted.
2) Even when there is no figures in that particular row, the answer returned
is wrong?

Anybody have a suggestion?

Thanks in advance for your help!

Jan
 
B

Biff

Hi!

Try this:

Enter this formula using the key combination of CTRL,SHIFT,ENTER (not just
ENTER):

=AVERAGE(IF(A2:A6>0,A2:A6))

Format the cell as h:mm:ss

Biff
 
J

Jan G. Thorstensen

Hi, again. One more problem with this.
When I try to calculate with more arguments,
it fails?
Say I have different ranges I want to include.

=AVERAGE(IF(A2:A6,A10:A14>0,A2:A6,A10:A14))
or
=AVERAGE(IF((A2:A6,A10:A14>0),(A2:A6,A10:A14)))

Now, it returns an error? It say the formula contains too
many arguments. How can I avoid this or how should the
formula look like?

Thank you for your help!

Regards
Jan.

PS I am using the key combination of CTRL,SHIFT,ENTER.
 
B

Biff

Hi!

You can't use multiple disjointed ranges in that manner.

What do you have in the cells that are between the 2 ranges? A7, A8 and A9?
If these cells are empty or have text in them then you can just include them
in the reference as a contiguous range like:

=AVERAGE(IF(A2:A14>0,A2:A14))

Text and empty cells will be ignored in the formula.

If the cells between the ranges contain numbers then try one of these. The
first one is an array. (array entered - CTRL,SHIFT,ENTER)

=AVERAGE(IF(CHOOSE({1,2},A2:A6,A10:A14)>0,CHOOSE({1,2},A2:A6,A10:A14)))

Or, normally entered (with just ENTER):

=(SUMIF(A2:A6,">0")+SUMIF(A10:A14,">0"))/(COUNTIF(A2:A6,">0")+COUNTIF(A10:A14,">0"))

Biff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Conditional Time Calculation 10
Subtracting time...again 2
Vlookup/Hlookup confusion 1
Formula not being Friendly 3
Goal Seek using Time 2
Time query 9
Peak call times/hours 2
Total Minutes Worked Within IVR Timing 1

Top