Average Of Time Values, Ignore Errors

mouse88

Board Regular
Joined
May 24, 2011
Messages
148
I have the following formula:

{=AVERAGE(TIMEVALUE(I4:I9))}

This works fine until one of the values in the range has a #N/A! error. Is there any way I can get it to ignore these errors and only use the time values?

Thanks

Matt
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I got it working with this:

=(SUMIF(E6:E8,"<>#N/A"))/COUNTIF(E6:E8,"<>#N/A")

However if all the values are #N/A then it returns a #VALUE! error. I need to return TIMEVALUE("00:00:00") instead of an error.
 
Upvote 0
Maybe:

=IFERROR(SUMIF(E6:E8,"<>#N/A")/COUNTIF(E6:E8,"<>#N/A"),"00:00:00")

Matty
 
Upvote 0
Why do you need TIMEVALUE?

=AVERAGE(IF(ISNUMBER(I4:I9),I4:I9))

Confirm with CTRL-SHIFT-ENTER rather than just Enter.
 
Upvote 0
Because im averaging time values in the format hh:mm:ss and not numbers.
True time values are numbers. They just look different due to formatting that's applied (sometimes automatically without you having to do it).

12:00 PM = numeric 0.5
8:00 AM = numeric 0.333333333333333

Select a cell that contains a time entry
Change the cell format to General
You'll see the TRUE numeric value of the cell
 
Upvote 0
TIMEVALUE doesn't work when applied to real times, only text values, so I'm confused how the original formula could work, i.e.

{=AVERAGE(TIMEVALUE(I4:I9))}

but that this would also work

=(SUMIF(E6:E8,"<>#N/A"))/COUNTIF(E6:E8,"<>#N/A")

unless you really are talking about two different ranges.....
 
Upvote 0
Both these formulas work:

=(SUMIF(E6:E8,"<>#N/A"))/COUNTIF(E6:E8,"<>#N/A")

=AVERAGE(IF(ISNUMBER(I4:I9),I4:I9))

But if all values in the range have the #N/A error then it returns a #DIV/0 error.
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,421
Members
452,913
Latest member
JWD210

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