The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Conditional Operator with two conditions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

schpooky

Germany
1 Posts

Posted - 11/14/2017 :  05:02:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I want to use "Set column values" to output values in a column.

In Col(A) and Col(B) I have random numbers ranging from 1-100.

Now i want to calculate following operation in a new column:

If Col(A) <= 10, the Value "20" should appear.

If Col(A) >= 20, the Value "25" should appear.

If Col(A) >=10 & <=20, The Value of Col(B) should appear.


I know that it is a simple operation, but I am not familiar with the conditional operators in Origin and i don't know how to link this two conditions.

Any suggestions would be very much appreciated.

Thanks
schpooky

Edited by - schpooky on 11/14/2017 05:45:53 AM

cpyang

USA
1406 Posts

Posted - 11/14/2017 :  07:59:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
2017 or later

A<=10?20:(A<20?A:25)


Before 2017, similar but longer

col(A)<=10?20:(col(A)<20?col(A):25)


CP
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000