Skip to main content
1-Visitor
February 26, 2026
Question

IF OTHERWISE RETURN VS IF ELSE RETURN

  • February 26, 2026
  • 2 replies
  • 34 views
I used the MCD converter to convert an old worksheet. The converter changed a conditional statement from IF-OTHERWISE-RETURN to IF-ELSE-RETURN. It stated the results are still accurate, but that is not entirely the case. I don't know how to change it back to the original conditional statement. Is there a way to change it?

2 replies

23-Emerald IV
February 26, 2026

Sure , there is a way to change it. But. regarding such branching:
• Mathcad supports only IF and OTHERWISE

• Prime supports IF, ELSE, ELSEIF and ALSOIF.

(In all cases a 'THEN'  is implied between the condition and the statement at the end of the line.)

Note that I do not consider RETURN as part of an IF... branch. RETURN provides its argument (whatever follows it) as an unconditional result of the function. It can be used as an expression in an IF construct, but also in a WHILE or FOR construct, and (preferably) at the (normal) end of the function.

 

I would assume that ELSE is a correct replacement of OTHERWISE, but it may depend on the structure of your program. Can you post the file(s) or at least the snippets, both from Mathcad and Prime?

 

Success!
Luc

Community Manager
March 9, 2026

Hi @EC_14511170,

 

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation. 

 

Thanks,
Anurag