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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Number of values in a specific range
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

pewterschmidt

Germany
2 Posts

Posted - 10/20/2011 :  05:05:59 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Hideo Fujii

USA
1582 Posts

Posted - 10/20/2011 :  10:39:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - Hideo Fujii on 10/20/2011 10:54:29 AM
Go to Top of Page

pewterschmidt

Germany
2 Posts

Posted - 10/20/2011 :  7:15:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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?
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 10/21/2011 :  10:28:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000