SOLVED

# If than Formula.

Copper Contributor

# If than Formula.

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

# Re: If than Formula.

=IF(E1<0,0,E1/D1) that said if D1 is always positive then =MAX(0, E1/D1) would also work

# Re: If than Formula.

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)
Solution

# Re: If than Formula.

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

Perhaps

=IF(OR(E1<0,D1=0),0,E1/D1)

# Re: If than Formula.

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

# Re: If than Formula.

As variant

``=IFERROR( E1/D1 *(E1 > 0 ), 0 )``
1 best response

Accepted Solutions
best response confirmed by VI_Migration (Silver Contributor)
Solution

# Re: If than Formula.

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

Perhaps

=IF(OR(E1<0,D1=0),0,E1/D1)