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
 sumif function in origin?

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
Matzemas Posted - 12/10/2012 : 07:12:19 AM
Hello,

I'm new to Origin and now I have a Problem.
I'm searching for a function similar to the sumif function in Excel.
How can I realise this in Origin?

Thank you for your help!

Regards,
Matthias
3   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 12/13/2012 : 12:04:51 PM
HI Matthias,

So your orientation column has unique values (such as -5.0, -4.9 etc) but there could be multiple entries for same value (such as -4.8 appears many times), and then you want the entity values in the second column summed up for each unique orientation value.

Is the above correct? If yes, you can use Statistics->Descriptive Statistics->Statistics on Columns, expand the Range1 node in the dialog, assign the entity column to Data Range, and the Orientation column to Grouping range....and then the output will have the entities summed up for each unique value from the orientation column. You can turn off all stats other than Sum.

If this is not what you want, can you send us your worksheet/project? Use the "Send file to tech support" link on to right of this page, and refer to this post in your e-mail.

Easwar
OriginLab

Matzemas Posted - 12/13/2012 : 03:25:35 AM
Hello Hideo,

thank you for your Help. I understand your solution.
I think that solving my problem is possible with your solution although it is quite complicated. Maybe there is a better way? I try to explain my Problem a little bit further:

I have an ammount of entities with different parameters. I want to sum up one parameter
in condition of another one which is for example an orientation angle. The entities can have orientation angles in a range of -5:5 degree in 0.1 degree steps. I want to sum up all entities that have the same orientation angle.

Using your solution I'd need a row for every angle. What I am looking for is a way to get a column with the orientation angles and a column with the values for every orientation angle. Do you think there is a simple solution to that kind of problem?

Regards,
Matthias
Hideo Fujii Posted - 12/10/2012 : 1:30:49 PM
Hi Matthias,

Excel is cell-based, so the function generally returns a single value; However, Origin is
vector(i.e. column/dataset)-based, so it typically gives the result as a vector. Having this basic
conceptual difference in mind, you can consider the following approaches, corresponding an Excel formula like:
sumifF(A2:A25,"<=0.5")

Method-1) Use a "filter"; then use the "Set Column Values" tool:

You can set a column filter, and apply the sum command in the Set Column Values tool. This method is intuitive, but it gives the only conditional sum from row=1 to the last row.




Method-2) Use nested conditional operators in the "Set Column Values" tool:

You can set the formula which contains the conditional operators in the Set Column Values tool such as:
i==1?(col(A)[1]<=0.5?col(A)[1]:0):(col(A)[i]<=0.5?col(B)[i-1]+col(A)[i]:col(B)[i-1])
The syntax of the conditional operator is:
<condition> ? <valueOnTrue> : <valueOnFalse>
Here, "i" refers to the index (i.e., row#).


The advantage of this method is that it gives the conditional sum up to every row from row=1.

In either way above, you can set the Recalculation mode of the Set Column Values tool to "Auto"
if you dynamically update the summation when the source data get changed.

Hope this helps.

--Hideo Fujii
OriginLab

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