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
 Sum up several values in one coloumn

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
islan Posted - 11/07/2013 : 06:25:32 AM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 5.1.5 G
Operating System: Windows 7, 64-bit

Hello together

I am new to Orgin and I would like to sum up the values highlighted in the graph.


How can I tell Origin that it has to check if the value in the coloumn is positive and if so that Origin shall built the sum of all positive values in that coloumn?

Thanks

Ursina
3   L A T E S T    R E P L I E S    (Newest First)
lkb0221 Posted - 11/15/2013 : 4:32:34 PM
Hi Ursina,

If you don't want use script window, you can also implement this by set column values.
Assume you have data in Col(A) and want put sum into col(D), see the screenshot below:



Hope this will help.

Zheng
OriginLab
lkb0221 Posted - 11/07/2013 : 3:17:43 PM
Hi Ursina,

You can try the following script:

range rr = !A3[13:32]; //Specify the data range you want to sum
double ss=0;
loop (ii, 1, rr.getsize())
{
If (rr[ii]>0) // If data is positive, add to the sum
{
ss = ss + rr[ii];
}
}
ss=; // Show the result in script window
Hideo Fujii Posted - 11/07/2013 : 2:52:32 PM
Hi Ursina,

The sum value of the highlighted cells is always shown in the status bar at the bottom of the Origin window.
If you want to put a condition, only when all cells are positive, you can run the following 4-line script in the Script window;
range rr=wcol(wks.c1)[wks.r1:wks.r2];
sum(rr);
if(sum.min>0) type All cells are positive (or missing). Sum is $(sum.total);
else type Some are negative or zero;
This works as you wanted?

--Hideo Fujii
OriginLab

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