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
 set column values - sum up values of other column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

MacS73

Germany
7 Posts

Posted - 09/16/2016 :  10:02:16 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
How can I sum up the values of another column in a new one: e.g.:
(first column is given, secons is to be calculated):


0 0
1 1
3 4
5 9
0 9
0 9
3 12
2 14

I think this should be working with the set comumn value function however I would need to memorize the value of the previous index, don't know how to do this...

Thank you.

Origin Ver. and Service Release: Origin 2015 SR3
Operating System: Windows 7

KenLefebvre

USA
66 Posts

Posted - 09/16/2016 :  11:23:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi there-
I'm not sure I entirely understand your question, do you mean how to add two columns together? Or rather how to sum all values in that column? To add them together you would simply type in the f(x) row col(A) + col(B), but if you wanted to create a column C that was equal to the sum of all values in column B, you would enter SUM(col(B)) in C's f(X) box.

If you wanted to take a single value from any of these columns you would type in the syntax as col(B)[3], which in this case would equal the third value of column B, 4.

Sorry if this isn't the information you were looking for, I hope this helps but if not, if you could reword your question I'd be glad to help you figure this out!

Ken


Ken Lefebvre
Technical Service Engineer
OriginLab

Edited by - KenLefebvre on 09/16/2016 12:00:42 PM
Go to Top of Page

MacS73

Germany
7 Posts

Posted - 09/19/2016 :  01:40:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I'm sorry I did not clearly express my intention. Please let me try again:

I have a given colum of numbers, say col(A)[1], col(A)[2], ... col(A)[n]

What I want to create is the setp wise integration of col(A), i.e. the result of col(B) I want to create is:

col(B)[1] = col(A)[1]
col(B)[2] = col(A)[1]+ col(A)[2]
col(B)[3] = col(A)[1]+ col(A)[2]+ col(A)[3]
col(B)[4] = col(A)[1]+ col(A)[2]+ col(A)[3]+ col(A)[4]

...

col(B)[n] = col(A)[1]+ col(A)[2]+ ... + col(A)[n]

Now it should be clear what I mean. Do I need a script with a loop for that or can this be done in a sompler manner? Thank you!
Go to Top of Page

yuki_wu

896 Posts

Posted - 09/19/2016 :  03:26:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can try the function sum(vd).

1. Highlight Column B and then right click to select Set Column Values… in the context menu.
2. Type sum(col(A)) in the Column Formula box
3. Click OK button


Hope it helps.

Regards,
Yuki
OriginLab

Edited by - yuki_wu on 09/19/2016 03:29:47 AM
Go to Top of Page

MacS73

Germany
7 Posts

Posted - 09/19/2016 :  05:48:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Does exactly what I wanted. I knew there's a simple sulution in Origin for it.

Thank you!
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