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
 Number of values in a specific range

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
pewterschmidt Posted - 10/20/2011 : 05:05:59 AM
Hi,

I have a large set of data. One Column shows the solid fraction of a melt which ranges between 0 and 1. Now I'd like to know the number of values in that column that are equal or greater than 0.75

In MS Excel I did some sort of workaround by setting up an autofilter and then using "SUBTOTAL" in that specific column. Unfortunately some of my datasets are so huge that Excel can't handle them. That's why I'd like to use Origin for this task..

Is there any (preferably easy :-)) solution?

Origin Ver. and Service Release (Select Help-->About Origin): 8.0
Operating System: Win 7
3   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 10/21/2011 : 10:28:06 AM
Hi pewterschmidt,

To specify the sheet to be output, you need to declare a range. For example, the following script outputs the result to the cell in the corresponding row at the sheet position (indicated by the variable "ln"):
  sum(col(C));
  ln=page.active;
  range ra=Summary!col(A);
  range rb=Summary!col(B);
  ra[ln]=sum.total;
  rb[ln]$=layer.name$;
(Make sure that the columns in the Summary sheet are not locked with a lock icon.)

--Hideo Fujii
OriginLab
pewterschmidt Posted - 10/20/2011 : 7:15:26 PM
Hi,
that works great so far, thanks a lot!

But I have one further question: I now have 20 worksheets, every sheet storing the "sum.total" value in column D - Cell [1]. I would now like to copy (or link to) all those 20 values to one column of a new workbook or worksheet (called e.g. "Summary") for further calculations.

[Sheet1] Col(D)[1] ---> [Summary] Col(A)[1]
[Sheet2] Col(D)[1] ---> [Summary] Col(A)[2]
[Sheet3] Col(D)[1] ---> [Summary] Col(A)[3]
...
[Sheet20] Col(D)[1] ---> [Summary] Col(A)[20]


Is this possible?
Hideo Fujii Posted - 10/20/2011 : 10:39:38 AM
Hi pewterschmidt,

There should be varieties of methods to achieve what you want. Here is one, which utilizes the Set Column Values tool:

Let's say, your source data in the column B.
1) Add extra two columns, say C and D.
2) For col(C), in Set Column Value tool, enter the formula: col(B)>0.75?1:0 ,
    and set the Recalculate to Auto. This sets flags.
3) For col(D), in Set Column Value tool, enter the formula in Before Formula Scripts:
      sum(col(C));
      col(D)[1]=sum.total;
    and set the Recalculate to Auto. This counts the flags.

You can easily change the criterion, also update the source data to get the updated result.

--Hideo Fujii
OriginLab

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