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
 sum over col(A)[3:6]

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
EigenGoofy Posted - 10/06/2011 : 1:20:43 PM
Origin Ver. and Service Release (Select Help-->About Origin): 8.0pro
Operating System: vista

I wanna calculate the sum from row 3 to row 6 on the column A on the active work sheet. The follow code does not work,

int i1 = 3;
int i2 = 6;
range a = col(A)[$(i1):$(i2)];
sum(a) =

it will return on the Classic script window:
SUM(a)=--


Thank you!

By the way, if I wanna calculate the sum from row 1 to the end on the column A on the active work sheet, how can I do this by mouse instead of writting code please?
2   L A T E S T    R E P L I E S    (Newest First)
EigenGoofy Posted - 10/08/2011 : 08:43:34 AM
quote:
Originally posted by Hideo Fujii

Hi EigenGoofy,

sum(...) is a function to create various statistical properties like sum.N, sum.Total, sum.Mean, etc. (Try sum.=<ENTER> in Script window to see all properties.) Therefore the way like following should work:
int i1 = 3;
int i2 = 6;
range a = col(A)[$(i1):$(i2)];
sum(a);
mytotal=sum.total;


--Hideo Fujii
OriginLab



I restarted my Origin, in the first time that I tried your code, it returned "MYTOTAL=--". Then I changed to

range a2 = col(A)[$(i1):$(i2)];
sum(a2);
mytotal=sum.total;

It returned the correct value.

Then I changed back by useing "a" for the range again. It returned the correct value again.

Although I was confused by its odd behavior, my question was finally solved. Thank you very much, Hideo!
Hideo Fujii Posted - 10/06/2011 : 2:36:25 PM
Hi EigenGoofy,

sum(...) is a function to create various statistical properties like sum.N, sum.Total, sum.Mean, etc. (Try sum.=<ENTER> in Script window to see all properties.) Therefore the way like following should work:
int i1 = 3;
int i2 = 6;
range a = col(A)[$(i1):$(i2)];
sum(a);
mytotal=sum.total;


--Hideo Fujii
OriginLab

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