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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Sum of only certain rows on a colum,
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

arub

2 Posts

Posted - 08/18/2017 :  06:01:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Edited by - arub on 08/18/2017 06:03:12 AM

Hideo Fujii

USA
1582 Posts

Posted - 08/18/2017 :  10:04:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - Hideo Fujii on 08/18/2017 10:22:52 AM
Go to Top of Page

arub

2 Posts

Posted - 08/18/2017 :  1:29:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000