ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I stop #DIV/0! when some of my values are zero? (https://www.excelbanter.com/excel-discussion-misc-queries/98267-how-do-i-stop-div-0-when-some-my-values-zero.html)

japc90

How do I stop #DIV/0! when some of my values are zero?
 
I wrote the following formula
=(B20/N20)+(C20/O20)+(D20/P20)+(E20/Q20)+(F20/R20)+(G20/S20)+(H20/T20)+(I20/U20)+(J20/V20).
The problem I am having is that if any of these cells have zeros or no
values in them then I receive #DIV/0! error message. All of these
fields will not always be filled in so I need it to ignore the
empty/zeroed out fields.

I appreciate any suggentions.


duane

How do I stop #DIV/0! when some of my values are zero?
 
one way

=if(n20=0,0,B20/N20)+if(o20=0,0,C20/O20)+if(p20=0,0,D20/P20)+if(q20=0,0,E20/Q20)+if(r20=0,0,F20/R20)+if(s20=0,0,G20/S20)+if(t20=0,0,H20/T20)+if(u20=0,0,I20/U20)+if(v20=0,0,J20/V20).

"japc90" wrote:

I wrote the following formula
=(B20/N20)+(C20/O20)+(D20/P20)+(E20/Q20)+(F20/R20)+(G20/S20)+(H20/T20)+(I20/U20)+(J20/V20).
The problem I am having is that if any of these cells have zeros or no
values in them then I receive #DIV/0! error message. All of these
fields will not always be filled in so I need it to ignore the
empty/zeroed out fields.

I appreciate any suggentions.



japc90

How do I stop #DIV/0! when some of my values are zero?
 
THANKS!!! Worked perfect.
duane wrote:
one way

=if(n20=0,0,B20/N20)+if(o20=0,0,C20/O20)+if(p20=0,0,D20/P20)+if(q20=0,0,E20/Q20)+if(r20=0,0,F20/R20)+if(s20=0,0,G20/S20)+if(t20=0,0,H20/T20)+if(u20=0,0,I20/U20)+if(v20=0,0,J20/V20).

"japc90" wrote:

I wrote the following formula
=(B20/N20)+(C20/O20)+(D20/P20)+(E20/Q20)+(F20/R20)+(G20/S20)+(H20/T20)+(I20/U20)+(J20/V20).
The problem I am having is that if any of these cells have zeros or no
values in them then I receive #DIV/0! error message. All of these
fields will not always be filled in so I need it to ignore the
empty/zeroed out fields.

I appreciate any suggentions.




RagDyeR

How do I stop #DIV/0! when some of my values are zero?
 
How about this shorter *array* formula:

=SUM(IF((N20:V200)*(B20:J200),B20:J20/N20:V20))

--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead of
the regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually.
You *must also* use CSE when revising the formula.


--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"japc90" wrote in message
ups.com...
THANKS!!! Worked perfect.
duane wrote:
one way


=if(n20=0,0,B20/N20)+if(o20=0,0,C20/O20)+if(p20=0,0,D20/P20)+if(q20=0,0,E20/
Q20)+if(r20=0,0,F20/R20)+if(s20=0,0,G20/S20)+if(t20=0,0,H20/T20)+if(u20=0,0,
I20/U20)+if(v20=0,0,J20/V20).

"japc90" wrote:

I wrote the following formula

=(B20/N20)+(C20/O20)+(D20/P20)+(E20/Q20)+(F20/R20)+(G20/S20)+(H20/T20)+(I20/
U20)+(J20/V20).
The problem I am having is that if any of these cells have zeros or no
values in them then I receive #DIV/0! error message. All of these
fields will not always be filled in so I need it to ignore the
empty/zeroed out fields.

I appreciate any suggentions.






All times are GMT +1. The time now is 07:14 AM.

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