Want to calculate a percentage by dividing one cell by the other,

K

KMHarpe

I want to calculate a percentage, but don't want it to calculate if the cells
have a zero OR Negative numbers. How do I do this?
 
J

joeu2004

Nick said:
=if(A1<=0,0,A1/B1)

More precisely (because the OP said "cells"):

=if(or(A1<=0,B1<=0), 0, A1/B1)

and format the cell appropriately.

But the OP was unclear about what to do when the "cells"
are zero or negative. Nick's solution puts a zero into
the "percentage" cell. If you want the cell to remain
empty, simply do:

=if(or(A1<=0,B1<=0), "", A1/B1)
 
Top