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 for Programming
 LabTalk Forum
 Sum of only certain rows on a colum,

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
arub Posted - 08/18/2017 : 06:01:17 AM
OriginPro Ver. 8 SR0 (v8.0724)
Operating System: win7.

Hello,

From experimental results, I would like to get the sum of certains specific cells of a column. As an example, I would like to sum all the values of the D data, get the mean value and the standard deviation of the result (see image)



It seems that the sum function only authorizes a range of rows in a column, not to select some.

I know the cell() function, but the real experimental workshhet as more than 2500 rows... and I would like to automate more or less ! Or is it possible to ask for a specific cell (example: cell (4,2)) and then all the cells translated from 5 rows ?

Is there any solution to this ?

Thanks
2   L A T E S T    R E P L I E S    (Newest First)
arub Posted - 08/18/2017 : 1:29:33 PM
Hello Hideo,

I did not know this wdeldup function, thanks. But unfortunaltely, as you expected, my pro version is too old.

I will try to extract "D" rows, from the loop you proposed, in another sheet and then do sum, sd, etc. It may sound rather complicated but it should work.

If I have an answer I will post it for "old version" users.

Anne
Hideo Fujii Posted - 08/18/2017 : 10:04:00 AM
Hi arub,

How about the following snippet?
wdeldup irng:=[Book1]1!A keep1st:=sum ow:=<new>; //Get sum of each group
for(ii=1; ii<=wks.col1.nRows; ii++) { //loop to pick up the desired group
  if(wcol(1)[ii]$=="D") {  //when the group is D
     type -a $(col(B)[ii]);
     Return;
  }
}
To get the mean or standard deviation, you can run the same routine by replacing the
argument of the "keep1st" option to "average" or "sd" in the wdeldup x-function.

Hope this works, though not sure if it does in your old Origin 8.

--Hideo Fujii
OriginLab

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