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 |
|
|