Ask LibreOffice - RSS feedhttps://ask.libreoffice.org/en/questions/Questions and answers for LibreOfficeenWed, 11 Jan 2017 19:01:53 +0100COUNTIF criteria evaluation - function applied on range cells?https://ask.libreoffice.org/en/question/85416/countif-criteria-evaluation-function-applied-on-range-cells/ My friend asked me for help and we only found a solution we don't like 100%.
**Problem:**
I have a table with angle values in degrees (0, 10, 20, ..., 180) - that is range A2:A20. I want to use COUNTIF to tell me, how many of these have SIN > 0,95.
**My solution:**
In column B I use RADIANS to convert degrees to radians. In column C I calculate the SIN value. Then I can write COUNTIF(C2:C20;">0,95").
I don't like this solution because I had to add two extra columns that hold values I don't need to see, I only have them so that COUNTIF can tell me what I need.
![image description](http://i.imgur.com/0vRnsC5.png)
----------
**Anything like this?**
I was hoping for something like this:
- COUNTIF(SIN(RADIANS(A2:A20)); "> 0,95") or better
- COUNTIF(A2:A20; "SIN(RADIANS(value))>0,95")
The "value" would be the value of the evaluated cell. In ">0,95" you can feel this keyword... "value > 0,95"... but not having it means not being able to apply functions to it.
Is there a better solution to my problem?Wed, 11 Jan 2017 15:31:36 +0100https://ask.libreoffice.org/en/question/85416/countif-criteria-evaluation-function-applied-on-range-cells/Answer by m.a.riosv for <p>My friend asked me for help and we only found a solution we don't like 100%.</p>
<p><strong>Problem:</strong>
I have a table with angle values in degrees (0, 10, 20, ..., 180) - that is range A2:A20. I want to use COUNTIF to tell me, how many of these have SIN > 0,95.</p>
<p><strong>My solution:</strong>
In column B I use RADIANS to convert degrees to radians. In column C I calculate the SIN value. Then I can write COUNTIF(C2:C20;">0,95").
I don't like this solution because I had to add two extra columns that hold values I don't need to see, I only have them so that COUNTIF can tell me what I need.</p>
<p><img alt="image description" src="http://i.imgur.com/0vRnsC5.png"></p>
<hr>
<p><strong>Anything like this?</strong>
I was hoping for something like this:</p>
<ul>
<li>COUNTIF(SIN(RADIANS(A2:A20)); "> 0,95") or better</li>
<li>COUNTIF(A2:A20; "SIN(RADIANS(value))>0,95")</li>
</ul>
<p>The "value" would be the value of the evaluated cell. In ">0,95" you can feel this keyword... "value > 0,95"... but not having it means not being able to apply functions to it.</p>
<p>Is there a better solution to my problem?</p>
https://ask.libreoffice.org/en/question/85416/countif-criteria-evaluation-function-applied-on-range-cells/?answer=85418#post-id-85418`=SUMPRODUCT(SIN(A2:A20)>0.95)`Wed, 11 Jan 2017 16:05:05 +0100https://ask.libreoffice.org/en/question/85416/countif-criteria-evaluation-function-applied-on-range-cells/?answer=85418#post-id-85418Comment by Michal Pták for <p><code>=SUMPRODUCT(SIN(A2:A20)>0.95)</code></p>
https://ask.libreoffice.org/en/question/85416/countif-criteria-evaluation-function-applied-on-range-cells/?comment=85423#post-id-85423I admit I am not used to working with matrices. And "matrices" are key ingredient of the solution. I will learn about matrices in Calc more. Thanks for help! :)Wed, 11 Jan 2017 19:01:53 +0100https://ask.libreoffice.org/en/question/85416/countif-criteria-evaluation-function-applied-on-range-cells/?comment=85423#post-id-85423