request help adding an Excel condition

Copper Contributor

There are formulas in cells B, C, and D. I want the answer to be a blank when both B and C are blank. Currently the answer is #DIV/0!. 

=IF(C7>0,D7/C7,D7/B7)

 

2 Replies

@RobertsTrying 

Option 1:

=IFERROR(D7/IF(C7>0, C7, B7), "")

Option 2:

=IF(AND(B7:C7=0), "", D7/IF(C7>0, C7, B7))

Thank you Hans, they both work perfectly!