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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Create several comparisons in one line using function if

jkrulak-2
2-Explorer

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

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:jkrulak-2)

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
Werner_E
25-Diamond I
(To:jkrulak-2)

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

Werner_E
25-Diamond I
(To:jkrulak-2)

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

Announcements

Top Tags