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