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
 Problem with "IF" function in column formula

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
Sabin1989 Posted - 11/26/2018 : 11:56:19 PM
Hi all!

I have a simple workbook of the form:

Col(A) Col(B) Col(C) Col(D)
0 0 0
0.5 0 0.5
1 0 0

This keeps going on, but the rest is irrelevant for my question.
Basically, I would like Col(D) to have the values of Col(A), but only IF Col(C)==0.
So I made a simple formula as: C==0?A:""

For reasons I cannot comprehend, Origin then only calculates this for the very first row.
Basically, as soon as a non-0 value is found in the second row, where Col(C) is 0.5, everything else remains blank.
How can I avoid this?

So basically I should get:

Col(A) Col(B) Col(C) Col(D)
0 0 0 0
0.5 0 0.5
1 0 0 1

Many thanks!
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2018b b9.5.5.409
Operating System: Windows 10
2   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 11/27/2018 : 02:01:02 AM
Hi,

If you are using Origin 2019, you could type in function row directly:

if(C=0, A)

If you are using older version, you can type the following without "" after :

C==0?A:


Regards,
Yuki

OriginLab
yuki_wu Posted - 11/27/2018 : 01:38:55 AM
Hi,

I am sorry that this is a bug and we have added it to our bug tracking database (ID: ORG-19433). In fact, it works fine if we change “” (string) to 0 (numeric), like C==0?A:0.

You could use Set Values dialog either:
1. Select column and right click to select Set Columns Values
2. Enter the following script in Before Formula Script box:

string temp$="";

3. Enter

C==0?A:%(temp$)

in Col(D)= box

4. Click OK button.


Regards,
Yuki

OriginLab

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