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
 Origin Forum
 Adding and averaging dataset columns using script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

neutrondude

Brunei
Posts

Posted - 03/23/2007 :  07:25:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,
I have a long serie of data which are organized using the form: DATAi where i is a number that ranges from a certain value to another.
I would like to sum the columns B of all worksheet and average over them- means sum all B coloumns and divide by the number of worksheets to get a mean value. I want to write the results in worksheet called Background (Column Background_I). How can I do this with a script?

Thanks a lot

Mike Buess

USA
3037 Posts

Posted - 03/23/2007 :  08:26:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Not sure if this is what you want. It sums column B in all worksheets in the project and puts the results in a new worksheet.

wo -d; // duplicate active wks window
%W=%H; // save its name
nn=1;
doc -e W {
if("%W"!="%H") {
%W_B+=%H_B; // add column
nn++; // count
};
};
%W_B/=nn; // divide by count
win -r %W Background; // rename wks

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 03/23/2007 08:27:52 AM
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