Getting Div/0 Error with time average on a range

michael.b

New Member
Joined
Apr 23, 2009
Messages
5
I'm trying to get an average time from a range of columns. Some of the cells seem to have a null value or a zero value that I'm not able to account for. I've tried multiple variations and each pulls up a divide by zero error. Here is what I've used so far:
=IF(COUNT(G174:G345)>0,"",AVERAGE(TIMEVALUE(RIGHT(G174:G345,5))))
and this gives me a #Div/0! Error
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I assume that you must have at least one time in your range, therfore in your first formula the count must be true and the "" will be returned.

If your times are in the format 07:30, 01:24 etc then why not use =average(K174:K345) which in my tests has produced the corect answer. Null and zeros should have no effect.
Remembering that a zeo is a value and is used in the calculation. A null is ignored.

Kelbo
 
Upvote 0
Everything I was doing was good, it was just that the application from where the data was coming from was somehow inserting a blank character and I cannot figure out how to account for it.

Once I copied the data and put it into a fresh spreadsheet, and ran the same formula, everything worked fine....

Hmmmmm
 
Upvote 0
I spoke too soon. I'm still getting the error. It doesn't make any sense to me. The 1st 143 rows have some columns that are empty and the same formula works with this range, but the next range (144-286) always gives me an error.
 
Upvote 0
Try this:

=SUMPRODUCT(1-ISERROR(G174:G345*1),G174:G345)/COUNT(G174:G345)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,975
Members
449,200
Latest member
Jamil ahmed

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