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
 set column values - sum up values of other column

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
MacS73 Posted - 09/16/2016 : 10:02:16 AM
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
4   L A T E S T    R E P L I E S    (Newest First)
MacS73 Posted - 09/19/2016 : 05:48:13 AM
Does exactly what I wanted. I knew there's a simple sulution in Origin for it.

Thank you!
yuki_wu Posted - 09/19/2016 : 03:26:01 AM
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
MacS73 Posted - 09/19/2016 : 01:40:10 AM
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!
KenLefebvre Posted - 09/16/2016 : 11:23:07 AM
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

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