10-Marble
November 19, 2025
Solved
Division by zero error
- November 19, 2025
- 1 reply
- 537 views
@IA_12699372 wrote:
Thank you, I don't have a copy of the Mathcad original sheet. Asking for a colleague.
So he has to say what the outcome should be in which case and he may be able to provide a worksheet to play with.
He may also ask here himself which could make it easier for him and us. After all taking part in this forum is free anyway.
As I already wrote I see two ways to go. Either trap the error using "try..on error" or avoid the division by zero by adding an additional "if". In both cases we would have to know what the result should be and if we have to distinguish between 'nominator is zero as well" and "nominator is different from zero" or not.
EDIT: Here are two implementations. Both distinguish between 'nominator equals zero' or not in case of denominator is zero. If this is not necessary you may just replace the last "if" by the desired return text.
The second looks much smaller because I used the "if" function instead of the "if" program statement. Of course we could use either "if" in both versions.
As you can see I prefer using functions as its more versatile and also makes it easier to demonstrate the various situations.

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.