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
 Averaging multiple worksheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Tobytall

UK
1 Posts

Posted - 06/20/2003 :  09:42:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Can anyone help me - is it possible to average multiple worksheets into a new, single worksheet? If so, how?

CStorey

Canada
137 Posts

Posted - 06/20/2003 :  10:39:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/20/2003 :  10:51:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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