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
 All Forums
 Origin Forum
 Origin Forum
 Conditional Operator with two conditions

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
schpooky Posted - 11/14/2017 : 05:02:48 AM
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
1   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 11/14/2017 : 07:59:25 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000