A family of Microsoft word processing software products for creating web, email, and print documents.
Use
{ IF B1<=0 0 { = A1/B1 } }
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
So I am having an issue with Word Fields.
I want to create a column, c, that divides the number in column a by the number in column b.
However, if b is equal to or less than 0, I want to get 0.
This seems like a simple if statement: { =IF(B1<=0,0,A1/B1) }
Regardless of the value of A, this works fine. For my example, A will equal 5.
If B equals 1, it will evaluate correctly. B is not less than or equal to 0, 5/1=5
If B equals -1, it will also evaluate correctly. B is less than or equal to 0, 0
If B equals 0, it will NOT evaluate correctly. B is less than or equal to 0, 0, but since the true would have evaluated to 5/0, the field gives up and returns nothing.
Is there a fix?
I could use A1/(B1+verySmallNumber), but I'd rather prefer not to if there is another way.
Thanks,
Christopher
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Use
{ IF B1<=0 0 { = A1/B1 } }
Thank you so much!
It took me a bit to catch on that you can't just add curly braces into a field, but you actually need to add another field.