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
 Addition of values in columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ahc_hoyer

Germany
Posts

Posted - 08/10/2005 :  06:37:02 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: xp

Dear sirs,
How this can be done automatically, especially the calculation of %-value? Thanks in advance.

G. hoyer

1) Original Data
A(X): a, b, c, d
B(Y): 2, 3, 1, 4

2) Sort Descending:
A(X): d, b, a, c
B(Y): 4, 3, 2, 1

3) Calculate %:
A(X): d, b, a, c
B(Y): 4, 3, 2, 1
C(Y): 40, 30, 20, 10

Mike

USA
357 Posts

Posted - 08/10/2005 :  09:36:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ahc_hoyer:

You'll have to excuse my clumsy scripting, but I think this will do it for you:
wks.addCol(C);  // add column C
col(C)=(col(B)/sum.total)*100; // calculate %ages
sort.wksname$=Data1; // sort worksheet named Data1
sort.c1=0; // sort all columns;
sort.r1=1; // sort range begin row 1
sort.r2=4; // sort range end row 4
sort.cname1$=D:C; //use col C as primary sort, descending
sort.wks(); // execute sort


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