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
 How to write countif-formel?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

elnino

20 Posts

Posted - 10/11/2016 :  08:50:59 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I am trying to calculate with origin. I want that it Counts for col16 the first (and then go on)number of col15 if col2 is 12. I tried it to write as formel in differen ways. E.g.: if(col(C2)=12);Indexcount(col(C15));else type -b "0";
But it doesnt work.
Or this one: if(col(C2)=12);countif(col(C15));else type -b "0";
It doesnt work again.
I think I am writing the formel in a wrong way. Is there anyone who can help me?

There also occures a error message: Mathematik kann nicht auf Textspalte angwandt werden/mathematics is not possible to apply in textcolumn

Hideo Fujii

USA
1582 Posts

Posted - 10/11/2016 :  2:05:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi elnino

> if(col(C2)=12);countif(col(C15));else type -b "0";

You need the condition in the CountIf function as described in the document:
http://www.originlab.com/doc/LabTalk/ref/Countif-func

For example, you can use the function like in the sample below which counts for each cell in column B by searching the column A:



The following script is equivalent to the use ofabove Set Column Values toollike:
for(ii=1; ii<=3; ii++) {
  col(C)[ii]=COUNTIF(col(A),"col(A)==col(B)[ii]");
}

Hope this helps.

--Hideo Fujii
OriginLab
Go to Top of Page

elnino

20 Posts

Posted - 10/12/2016 :  04:26:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo Fujii!

Thank you very much for helping me!!
I tried to calculate with the formel you wrote. But then the same error message like before occured.

Is the cell in the wrong Format or where is the Problem?

I hope you can help me again!
Go to Top of Page

elnino

20 Posts

Posted - 10/12/2016 :  04:56:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

maybe i have to write something in the box below the formel box? could it be the Problem?
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