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
 Adding and averaging dataset columns using script

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
neutrondude Posted - 03/23/2007 : 07:25:07 AM
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

1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 03/23/2007 : 08:26:28 AM
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

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