exclude blank cell from formulae

roninn75
3StarLounger
Posts: 229
Joined: 15 Feb 2013, 08:25

exclude blank cell from formulae

Post by roninn75 »

Good day

i am trying to calculate the average time in a row. the formula i am using to calculate the average time is:
=IFERROR(AVERAGEIF(D4:F4,"<>0"),0)
the range is D4:F25
the calculated value is in column H
in column D however i might not always have a time value.
if this is true, i dont want a result in the total column which is H

i've tried the formula:
=If(D4<>"","", AVERAGEIF(D4:F$,"<>0),0)

this creates an error though.
can you please assist?

User avatar
HansV
Administrator
Posts: 72233
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: exclude blank cell from formulae

Post by HansV »

Shouldn't that be

=IF(D4="","",IFERROR(AVERAGEIF(D4:F4,"<>0"),0))
Regards,
Hans

roninn75
3StarLounger
Posts: 229
Joined: 15 Feb 2013, 08:25

Re: exclude blank cell from formulae

Post by roninn75 »

thank you