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
 Averaging multiple worksheets

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
Tobytall Posted - 06/20/2003 : 09:42:30 AM
Can anyone help me - is it possible to average multiple worksheets into a new, single worksheet? If so, how?
2   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 06/20/2003 : 10:51:16 AM
There are many ways to do it. Here are a couple of easy ways...

1> Average all worksheets in the project.
%W=%H; // save the name of the active worksheet
win -d; // duplicate it
doc -e W {%A=%H};
// The previous command goes through all worksheets and assigns its name to %A.
// %A ends up with name of the new wks.
nn=1;
doc -e W {
// loop through worksheets again and pick out those that are not %A or %W
if("%H"!="%A" && "%H"!="%W")
{
nn++; // increment wks count
loop (ii,1,wks.ncols)
{
%(%A,ii)+=%(%H,ii); // add corresponding columns to those in new wks
}
}
}
loop (ii,1,wks.ncols) {
%(%A,ii)/=nn; // average (divide columns by wks count)
};

2> Average all worksheets in the active project folder.
Same script, but replace "doc -e" with "doc -ef".

Hope that helps.

Mike Buess
Origin WebRing Member
CStorey Posted - 06/20/2003 : 10:39:40 AM
What do you mean by average all worksheets? Average every column? Average every row? Or all similar columns in all worksheets?

You'll have to explain this a little more before people can suggest a course of action. Eventually you will likely want to write iether a LabTalk or OriginC script to handle the job I imagine.

Craig

Craig Storey
Origin WebRing Member - http://g.webring.com/hub?ring=originwebring

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