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
 How to use IF and OR together

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
sivanml Posted - 08/04/2015 : 01:07:34 AM
Hi,
I have a data set in columns (say) A, B, C. I want to perform a calculation such that if the data in either of col(A) or col(B) is negative, then multiply the data in col(c) by (-1). Otherwise read the col(c) data as it is. The result is required in another col (D). How do I go about it in Orgin 8?

Siva
2   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 08/04/2015 : 12:09:44 PM
Hi Siva,

Just a minor correction, it should be:
((col(A)>=0)&&(col(B)>=0))?col(C):-col(C)
or, followed your original logical formulation, the conditional formula may be:
((col(A)<0)||(col(B)<0))?-col(C):col(C)

--Hideo Fujii
OriginLab

P.S. With no logical operator, try
2*(sign((sign(col(A))+1))*sign((sign(col(B))+1))-0.5)*col(C)
jasonzhao Posted - 08/04/2015 : 02:30:57 AM
Hello,

Please right click the column D and select Set Column Values to open the Set Values dialog, then use the formula below, click OK to apply:


((col(A)>0)&&(col(B)>0))?col(C):-col(C)



Best regards!
Jason
OriginLab Technical Service

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