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
 Different formulas for different cells of column

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
JonasKlim Posted - 10/08/2017 : 08:06:20 AM
Hi,
A as long time user of Excel I am curious if different formulas can be used for calculation of values of different cells of the same column.
For example, C[1]= max(A), C[2]= min(A). If yes, how to write a script?
5   L A T E S T    R E P L I E S    (Newest First)
JonasKlim Posted - 10/12/2017 : 01:25:07 AM
Hi, Nikolay,
Thank you. I started using LabTalk.
Best regards,
Jonas
quote:
Originally posted by nick_n

Hi,
First of all, sorry for confusing. I thought that you tell about LabTalk script, whereas it was "Set value" dialog. Both of them are powerful features and have some basic similarities. Nevertheless, there are some differences in using.
However, "Set value" is much more easy to use, LabTalk gives more flexibility (it's my personal opinion).

Well, in this case I would prefere to use LabTalk, just simple run from Script window (Alt+Shift+3 to open).
Put there your script like: col(P)[1]=list(min(col(G)[1:55]), col(G)[1:55]); select your script e.g. Ctrl+A, press Enter.
Regards,

Nikolay

nick_n Posted - 10/09/2017 : 3:55:08 PM
Hi,
First of all, sorry for confusing. I thought that you tell about LabTalk script, whereas it was "Set value" dialog. Both of them are powerful features and have some basic similarities. Nevertheless, there are some differences in using.
However, "Set value" is much more easy to use, LabTalk gives more flexibility (it's my personal opinion).

Well, in this case I would prefere to use LabTalk, just simple run from Script window (Alt+Shift+3 to open).
Put there your script like: col(P)[1]=list(min(col(G)[1:55]), col(G)[1:55]); select your script e.g. Ctrl+A, press Enter.
Regards,

Nikolay
JonasKlim Posted - 10/09/2017 : 05:21:49 AM
Hello, Nikolay,
Thank you. Now I understood the trick: while in dialog window, I have to put the cursor on the cell I want to enter formula and then edit the formula in dialog window.
Could you please help with one more issue: if I write an expression to calculate row number, like "P[1]=list(min((F[60:160]));F)", and then use P[1] as an input to calculate simple formulas, like N[1]=K[P[1]+5], it works fine.
But, if I try to do the same with functions, like changing fixed row numbers in formula "list(min(G[0:55]);G[0:55])" to calculated row numbers in "list(min(G[0:P[1]]);G[0:P[1]])", I do not get result.
Regards, Jonas




quote:
Originally posted by nick_n

Hi,

For your example it will be: col(C)[1]=max(col(A)); and col(C)[2]=min(col(A));. See more at http://www.originlab.com/doc/LabTalk/ref/Col-func.

Moreover, pay attention for ranges (http://www.originlab.com/doc/LabTalk/guide/Range-Notation). They provide access to any book, sheet, or plot. BR,

Nikolay

cpyang Posted - 10/08/2017 : 8:29:40 PM
In the upcoming Origin 2018, that would be exactly what you do,

put "=max(A)" into C[1] and "=min(A)" into C[2].

CP
nick_n Posted - 10/08/2017 : 3:16:36 PM
Hi,

For your example it will be: col(C)[1]=max(col(A)); and col(C)[2]=min(col(A));. See more at http://www.originlab.com/doc/LabTalk/ref/Col-func.

Moreover, pay attention for ranges (http://www.originlab.com/doc/LabTalk/guide/Range-Notation). They provide access to any book, sheet, or plot. BR,

Nikolay

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