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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Create several comparisons in one line using function if

jkrulak-2
1-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

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.

View solution in original post

4 REPLIES 4

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.

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

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.

Dear Werner,

Thank you for the example file, much appreciated.

The example is clear to me and all understood.

Many thanks again.

Jan

Top Tags