ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   hiding error message when dividing by 0 (https://www.excelbanter.com/excel-worksheet-functions/172747-hiding-error-message-when-dividing-0-a.html)

Patrick

hiding error message when dividing by 0
 
I have a formula calling for an average in a workbook that refers to a cell
group that is sometimes not used. To keep the cells from averaging, I insert
an X. That works fine, but when ALL the cells are X I get that irritating
"You are trying to divide something by 0" message. I understand that and
just don't want it to show up in the cell. Can't think of a way. Any help?

Gary''s Student

hiding error message when dividing by 0
 
=IF(ISERROR(AVERAGE()),"",AVERAGE())
--
Gary''s Student - gsnu200765


"Patrick" wrote:

I have a formula calling for an average in a workbook that refers to a cell
group that is sometimes not used. To keep the cells from averaging, I insert
an X. That works fine, but when ALL the cells are X I get that irritating
"You are trying to divide something by 0" message. I understand that and
just don't want it to show up in the cell. Can't think of a way. Any help?


ShaneDevenshire

hiding error message when dividing by 0
 
Hi Patrick,

You can use a formula like:

=IF(ISERR(AVERAGE(A1:A20)),"",AVERAGE)

or if you are using 2007

=IFERROR(AVERAGE(A1:A20),"")

or if you are only concerned with print the errors then choose the following
command in 2003:

File, Page Setup, Sheet, Cell errors as, Blank.

This last feature is available in 2007 also.

You can replace the "" with 0 or anything else.

You may also be able to use the slightly shorter form in 2003 of:

=IF(SUM(A1:A10)=0,"",AVERAGE(A1:A10))
--
Thanks,
Shane Devenshire


"Patrick" wrote:

I have a formula calling for an average in a workbook that refers to a cell
group that is sometimes not used. To keep the cells from averaging, I insert
an X. That works fine, but when ALL the cells are X I get that irritating
"You are trying to divide something by 0" message. I understand that and
just don't want it to show up in the cell. Can't think of a way. Any help?


PatrickP

hiding error message when dividing by 0
 
Thank you!

"Gary''s Student" wrote:

=IF(ISERROR(AVERAGE()),"",AVERAGE())
--
Gary''s Student - gsnu200765


"Patrick" wrote:

I have a formula calling for an average in a workbook that refers to a cell
group that is sometimes not used. To keep the cells from averaging, I insert
an X. That works fine, but when ALL the cells are X I get that irritating
"You are trying to divide something by 0" message. I understand that and
just don't want it to show up in the cell. Can't think of a way. Any help?


PatrickP

hiding error message when dividing by 0
 
Thank you very much

"ShaneDevenshire" wrote:

Hi Patrick,

You can use a formula like:

=IF(ISERR(AVERAGE(A1:A20)),"",AVERAGE)

or if you are using 2007

=IFERROR(AVERAGE(A1:A20),"")

or if you are only concerned with print the errors then choose the following
command in 2003:

File, Page Setup, Sheet, Cell errors as, Blank.

This last feature is available in 2007 also.

You can replace the "" with 0 or anything else.

You may also be able to use the slightly shorter form in 2003 of:

=IF(SUM(A1:A10)=0,"",AVERAGE(A1:A10))
--
Thanks,
Shane Devenshire


"Patrick" wrote:

I have a formula calling for an average in a workbook that refers to a cell
group that is sometimes not used. To keep the cells from averaging, I insert
an X. That works fine, but when ALL the cells are X I get that irritating
"You are trying to divide something by 0" message. I understand that and
just don't want it to show up in the cell. Can't think of a way. Any help?



All times are GMT +1. The time now is 05:33 AM.

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