简体   繁体   中英

Excel formula to return different results for all cells equal to, blank or count of a value

I am trying to create a formula that will look at a column of cells and do the following;

  • if all cells blank then return no value
  • if some cells "Unapproved" then count and show the number of these
  • if all cells "Approved" then return "All Approved"

This is as far as got but will appreciate any help. This is an array; =IF(ISBLANK(AD14:AD23)," ",CONCATENATE(COUNTIF(AD14:AD23,"Unapproved")," Awaiting Approval"))

Look forward to hearing from you.

You could use something like

=IF(COUNTIF($AD$14:$AD$23,"Approved")=ROWS($AD$14:$AD$23),"All approved",IF(COUNTIF($AD$14:$AD$23,"Unapproved"),COUNTIF($AD$14:$AD$23,"Unapproved"),IF(COUNTBLANK($AD$14:$AD$23)=ROWS($AD$14:$AD$23),"","undefined return value")))

If your blank cells are actually empty string literals (""), returned by formulas then I would update to:

=IF(COUNTIF($AD$14:$AD$23,"Approved")=ROWS($AD$14:$AD$23),"All approved",IF(COUNTIF($AD$14:$AD$23,"Unapproved"),COUNTIF($AD$14:$AD$23,"Unapproved"),IF(COUNTIF($AD$14:$AD$23,TEXT(,))=ROWS($AD$14:$AD$23),"","undefined return value")))

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