ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   formula (https://www.excelbanter.com/excel-discussion-misc-queries/110217-formula.html)

kano71

formula
 
I have a spreadsheet where, cell U6 is an average of Z6-AE6. i also need U6
to =0 if any cell within Z6 - AE6 is a 0. Can anyone help please

MyVeryOwnSelf

formula
 
I have a spreadsheet where, cell U6 is an average of Z6-AE6. i also
need U6 to =0 if any cell within Z6 - AE6 is a 0. ...


One way:
=IF(PRODUCT(Z6:AE6)=0,0,AVERAGE(Z6:AE6))

Caution: an empty cell doesn't count as zero with this formula. Neither
does text.

kano71

formula
 
Thank you that is brilliant.

"MyVeryOwnSelf" wrote:

I have a spreadsheet where, cell U6 is an average of Z6-AE6. i also
need U6 to =0 if any cell within Z6 - AE6 is a 0. ...


One way:
=IF(PRODUCT(Z6:AE6)=0,0,AVERAGE(Z6:AE6))

Caution: an empty cell doesn't count as zero with this formula. Neither
does text.


Dave F

formula
 
Try =IF(COUNTIF(Z6:AE6,"0")0,0,AVERAGE(Z6:AE6))

"IF the number of 0s in the range Z6:AE6 is greater than 0, THEN 0, ELSE
take the average of the range Z6:AE6."

Dave
--
Brevity is the soul of wit.


"kano71" wrote:

I have a spreadsheet where, cell U6 is an average of Z6-AE6. i also need U6
to =0 if any cell within Z6 - AE6 is a 0. Can anyone help please


Sandy Mann

formula
 
MyVeryOwnSelf

One way:
=IF(PRODUCT(Z6:AE6)=0,0,AVERAGE(Z6:AE6))


Won't that return zero if there is a zero anywhere in Z6:AE6?

Perhaps:

=IF(SUM(Z6:AE6)=0,0,AVERAGE(Z6:AE6))

or

=IF(SUM(Z6:AE6),AVERAGE(Z6:AE6),0)

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"MyVeryOwnSelf" wrote in message
...
I have a spreadsheet where, cell U6 is an average of Z6-AE6. i also
need U6 to =0 if any cell within Z6 - AE6 is a 0. ...


One way:
=IF(PRODUCT(Z6:AE6)=0,0,AVERAGE(Z6:AE6))

Caution: an empty cell doesn't count as zero with this formula. Neither
does text.





Dave F

formula
 
Yes it would return 0 if a 0 is in that range.

But that's what the original poster asked for.

Dave
--
Brevity is the soul of wit.


"Sandy Mann" wrote:

MyVeryOwnSelf

One way:
=IF(PRODUCT(Z6:AE6)=0,0,AVERAGE(Z6:AE6))


Won't that return zero if there is a zero anywhere in Z6:AE6?

Perhaps:

=IF(SUM(Z6:AE6)=0,0,AVERAGE(Z6:AE6))

or

=IF(SUM(Z6:AE6),AVERAGE(Z6:AE6),0)

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"MyVeryOwnSelf" wrote in message
...
I have a spreadsheet where, cell U6 is an average of Z6-AE6. i also
need U6 to =0 if any cell within Z6 - AE6 is a 0. ...


One way:
=IF(PRODUCT(Z6:AE6)=0,0,AVERAGE(Z6:AE6))

Caution: an empty cell doesn't count as zero with this formula. Neither
does text.






Sandy Mann

formula
 
My Apologies, you're quire right. I've got a good memory - it just short
that all <g

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Dave F" wrote in message
...
Yes it would return 0 if a 0 is in that range.

But that's what the original poster asked for.

Dave
--
Brevity is the soul of wit.


"Sandy Mann" wrote:

MyVeryOwnSelf

One way:
=IF(PRODUCT(Z6:AE6)=0,0,AVERAGE(Z6:AE6))


Won't that return zero if there is a zero anywhere in Z6:AE6?

Perhaps:

=IF(SUM(Z6:AE6)=0,0,AVERAGE(Z6:AE6))

or

=IF(SUM(Z6:AE6),AVERAGE(Z6:AE6),0)

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"MyVeryOwnSelf" wrote in message
...
I have a spreadsheet where, cell U6 is an average of Z6-AE6. i also
need U6 to =0 if any cell within Z6 - AE6 is a 0. ...

One way:
=IF(PRODUCT(Z6:AE6)=0,0,AVERAGE(Z6:AE6))

Caution: an empty cell doesn't count as zero with this formula. Neither
does text.









All times are GMT +1. The time now is 09:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com