Forum Discussion
if multiple cells contain specific text then return value
- Dec 22, 2022
(edited to account for empty state)
Try:
=IF(COUNTIF(range,""),"",IF(PRODUCT(--(range="APPROVED")),"APPROVED","AMEND REQUIRED"))Basically assigns binary to your cells where APPROVED = 1 and anything else = 0. These are all multiplied together and if the result is 1 it'll be "APPROVED" otherwise "AMEND REQUIRED".
With this, it considers all 3 possible states: all approved, all amend (or empty), mixed approved and amend (or empty).
(edited to account for empty state)
Try:
=IF(COUNTIF(range,""),"",IF(PRODUCT(--(range="APPROVED")),"APPROVED","AMEND REQUIRED"))
Basically assigns binary to your cells where APPROVED = 1 and anything else = 0. These are all multiplied together and if the result is 1 it'll be "APPROVED" otherwise "AMEND REQUIRED".
With this, it considers all 3 possible states: all approved, all amend (or empty), mixed approved and amend (or empty).
- lilian51129Dec 23, 2022Copper ContributorThanks this worked like a charm!