Divide by 0 error in formula column

The AND() function in Formula Columns should only return true only if BOTH arguments are true, right?

That does not seem to be the case. This formula will produce a “Can’t Divide by 0” error when {column2} is blank OR zero…

	IF(
		AND(
			{column1}<>0,
			{column2}<>0
		),
		{column1}/{column2}
	)
1 Like

Hey @robzinn – thanks for posting this here! This is a known issue that our developers have been made aware of.

I’ll add your note to the open issue, so our devs know you’re asking for it as well.

Hi @dipro any update on this? thanks

Hi, @peppinob - For now, we work around this issue by adding a check in our formulas that inserts “N/A” into the column if a zero would cause an error and/or result in an incorrect value. Would that help in your situation?

1 Like

Here are two ways to make this work. (For both of these, added null string to the else portion of the if statement to prevent a false return value.)

The first, make all parts of a formula always work:

IF(AND({column1}<>0,{column2}<>0),{column1}/IF({column2}<>0,{column2},1),"")

Second, use the DIVIDE function instead of the operation:

IF(AND({column1}<>0,{column2}<>0),DIVIDE({column1},{column2}),"")
5 Likes

@JCorrell @PolishedGeek

Thank you for your advices, it helped a lot!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.