If than Formula.

Copper Contributor

If I want to run a formula that is IF cell E1 is less than 0, than 0, if greater than, then e1/d1 what would it look like. Thanks for any help as I am not great with IF than formulas.

5 Replies
=IF(E1<0,0,E1/D1) that said if D1 is always positive then =MAX(0, E1/D1) would also work
Thank you. This works great with one exception. When E1 is zero I get a #DIV/0! In the F1 cell the formula is in. It works great if the value of E1 is higher than zero.
best response confirmed by VI_Migration (Silver Contributor)


The formula would return #DIV/0! if D1 equals 0, not if E1 equals 0.




Solved thank you. I appreciate the assistance everyone. Thank you


As variant

=IFERROR( E1/D1 *(E1 > 0 ), 0 )