ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   using percentages in an if statement (https://www.excelbanter.com/excel-discussion-misc-queries/45845-using-percentages-if-statement.html)

matt

using percentages in an if statement
 
Is there a way I can incorporate the percentage of values that meet a
critiera into an If statement. For instance, say I've got

1
2
3
4
5
6
7
8
9
10

Is there any way that I can return TRUE if 90% of the values are larger than
1, but FALSE if less than 90% are greater than 1?

Biff

Hi!

Really don't need an IF:

=COUNTIF(A1:A10,"1")/COUNT(A1:A10)=0.9

But, IF you really want one:

=IF(COUNTIF(A1:A10,"1")/COUNT(A1:A10)=0.9,TRUE)

You might also want to make sure there are enough values in the range so
that you don't get an error return:

=IF(COUNT(A1:A10)<1,"",IF(COUNTIF(A1:A10,"1")/COUNT(A1:A10)=0.9,TRUE))

Biff

"matt" wrote in message
...
Is there a way I can incorporate the percentage of values that meet a
critiera into an If statement. For instance, say I've got

1
2
3
4
5
6
7
8
9
10

Is there any way that I can return TRUE if 90% of the values are larger
than
1, but FALSE if less than 90% are greater than 1?




Ragdyer

Is this what you mean:

=COUNTIF(A1:A10,"1")=9
?
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"matt" wrote in message
...
Is there a way I can incorporate the percentage of values that meet a
critiera into an If statement. For instance, say I've got

1
2
3
4
5
6
7
8
9
10

Is there any way that I can return TRUE if 90% of the values are larger
than
1, but FALSE if less than 90% are greater than 1?




All times are GMT +1. The time now is 07:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com