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

J

japc90

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.
 
G

Guest

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).
 
J

japc90

THANKS!!! Worked perfect.
duane said:
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).
 
R

Ragdyer

How about this shorter *array* formula:

=SUM(IF((N20:V20>0)*(B20:J20>0),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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top