简体   繁体   中英

How to create different output with 4 conditions in excel using COUNTIF and COUNT?

I am trying to create a formula which will display the following;

if =>1 is NOK out of 10, overall is NOK

if out of 10 is, =>1 but <10 is OK, overalll is In Progress

if out of 10 is, 10 is Not Started, overall is Not Started

if out of 10, 10 is OK, overall is OK

I used the following formula;

=IF(COUNTIF(K102:K111,"NOK"),"NOK",IF(COUNTIF(K102:K111,"OK")>=1,"In Progress",IF(COUNT(COUNTIF(K102:K111,"Not Started")=10),"Not Started","In Progress")))

I can get the first 3 conditions correctly, but the last one, if 10 out of 10 is OK, i still get overall is "In Progress"

Kindly help. Thank you~

Your error is here:

IF(COUNTIF(K102:K111,"OK")>=1,"In Progress",...)

10>=1 is true so it returns "In Progress" . Instead, check for 10 first:

IF(COUNTIF(K102:K111,"OK")=10,"OK",IF(COUNTIF(K102:K111,"OK")>=1,"In Progress",...))

Besides, nowhere in your formula returns "OK" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM