Johnnyboy1x
New Member
- Joined
- Jan 11, 2013
- Messages
- 32
Hello All --
I have been struggling with this. I want to be able to filter and return a result for a percent of cells that meet a condition. In my case -30 ---> +30 are green results and I am calculating the percentage of green from the whole total.
I tried to accomplish this using multiple subtotal formulas, from which the results would then calculate the percentage.
It works in theory, and when not filtering, but not when filtering. I can't get the countif statements right for the first formula.
DATA SET EXAMPLE --
<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
FIRST FORMULA -- (where I am having the problem)
'=SUM(COUNTIF(D:D,">30")+(COUNTIF(D:D,"<-30"))) --- This works as it should and returns a result of 5 for the above data set. But, when I filter out the result doesn't change (as it shouldn't.
So I tried to do this (next formula below), but no matter what i do I can't get excel to like it...ask for missing parenthesis or arguments and no matter what I do its not happy. '=SUBTOTAL(109,(COUNTIF(D:D,">30")+(COUNTIF(D:D,"<-30")))
SECOND FORMULA --
'=SUBTOTAL(2,D:D). This works as it should and returns a count of 8 for the above data set and changes when filtering. GREAT!
THIRD FORMULA --
Cell formated as a percent and I calculate the percentage of the above 2 results with the formula below. Returns 38% as it should.
'=(F2-E2)/F2
HOW CAN I ACHIEVE THE SUBTOTALS FOR THE COUNT IF IN THE FIRST FORMULA OR DO I NEED A COMPLETELY DIFFERENT APPROACH.
Thanks, Johnnyboy1x
I have been struggling with this. I want to be able to filter and return a result for a percent of cells that meet a condition. In my case -30 ---> +30 are green results and I am calculating the percentage of green from the whole total.
I tried to accomplish this using multiple subtotal formulas, from which the results would then calculate the percentage.
It works in theory, and when not filtering, but not when filtering. I can't get the countif statements right for the first formula.
DATA SET EXAMPLE --
status | serial | type | days from target |
Closed | 136761/13 | PM | -35 |
Closed | 128083/09 | PM | -31 |
Closed | 141305/15 | PM | -3 |
Closed | 123013/07 | PM | -1 |
Closed | 137902/14 | INST | -1 |
Closed | 133326/11 | INST | 32 |
Closed | 125949/08 | INST | 33 |
Closed | 141734/15 | PM | 34 |
<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
FIRST FORMULA -- (where I am having the problem)
'=SUM(COUNTIF(D:D,">30")+(COUNTIF(D:D,"<-30"))) --- This works as it should and returns a result of 5 for the above data set. But, when I filter out the result doesn't change (as it shouldn't.
So I tried to do this (next formula below), but no matter what i do I can't get excel to like it...ask for missing parenthesis or arguments and no matter what I do its not happy. '=SUBTOTAL(109,(COUNTIF(D:D,">30")+(COUNTIF(D:D,"<-30")))
SECOND FORMULA --
'=SUBTOTAL(2,D:D). This works as it should and returns a count of 8 for the above data set and changes when filtering. GREAT!
THIRD FORMULA --
Cell formated as a percent and I calculate the percentage of the above 2 results with the formula below. Returns 38% as it should.
'=(F2-E2)/F2
HOW CAN I ACHIEVE THE SUBTOTALS FOR THE COUNT IF IN THE FIRST FORMULA OR DO I NEED A COMPLETELY DIFFERENT APPROACH.
Thanks, Johnnyboy1x