Google Sheets Formula – Display Message When Range Contains ‘0’

google sheets

I have a spreadsheet with three columns. In Column A and B are two numbers, and in Column C is a formula to produce a ratio from those two numbers. Here is that formula:

=CONCATENATE(round(B2/min(B2,C2),2)," : ",round(C2/min(B2,C2),2))

My problem is that sometimes one of these numbers is zero, and that causes the formula to produce the error:

Function DIVIDE parameter 2 cannot be zero.

Self-explanatory.

How can I change my formula to instead produce a ratio with a zero in it? So for example:

1.89 : 0

Best Answer

Does this do what you want:?

=CONCATENATE(if(C6=0,B6,round(B6/min(B6,C6),2))," : ",if(C6=0,"0",round(C6/min(B6,C6),2)))