cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Create several comparisons in one line using function if

SOLVED
Newbie

Create several comparisons in one line using function if

Dear all,

I'm just wondering whether there is any chance how to create comparison of several variables in one line using function if or something different.

Please see a screenshot what I need to compare. I marked up one line as example.

Untitled.png

I'd like to make it in one line or make it work for all table because for instance the third line has too many variables.

Thank you for your help in advance.

Kind regards,

Jan

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Create several comparisons in one line using function if

The attached should help.

I used the explicit "return" statement because this immediately exits the program and so I don't have to use a lot of "otherwise" statements.

While I mentioned in the sheet that I often like to throw in dummy lines after an if-statement to force Mathcad to show the statements in the next line, I must confess that in this case I would prefer my condensed Thickness2 variant.

4 REPLIES 4

Re: Create several comparisons in one line using function if

You can use the AND operator (^) to combine two or more conditions.

I am not sure, what the input and what the output in your example should be.

Re: Create several comparisons in one line using function if

Dear Werner,

Thank you for your response, I think this is what I've been looking for.

I attached my example but I must have been doing something wrong because it gives me an error. The best output would be a number but text is fine as well.

Regards,

Jan

Re: Create several comparisons in one line using function if

The attached should help.

I used the explicit "return" statement because this immediately exits the program and so I don't have to use a lot of "otherwise" statements.

While I mentioned in the sheet that I often like to throw in dummy lines after an if-statement to force Mathcad to show the statements in the next line, I must confess that in this case I would prefer my condensed Thickness2 variant.

Re: Create several comparisons in one line using function if

Dear Werner,

Thank you for the example file, much appreciated.

The example is clear to me and all understood.

Many thanks again.

Jan