Formula. Retur "OK" if all cells in range contains "OK", ignoring blanks.

MadBern

New Member
Joined
May 10, 2019
Messages
37
Hi,

I have the following formula working perfectly fine in one cell to return the text "Complete" if all cells in range (G35:G38) contain "Complete": =IF(COUNTA(G35:G38)=0,"Not initiated",IF(COUNTIF(G35:G38,"Complete")=COUNTA(G35:G38),"Complete",IF(COUNTIF(G35:G38,"Not initiated")=COUNTA(G35:G38),"Not initiated","Initiated")))
If all cells contain "Not initated" it returns that and if all contain "Complete" except for one that reads "Initiated", the return is "Initiated".
And it ignores blanks, which is important.

So now I'm trying to get the same function in another cell, but a bit easier. Now the range only has two possible texts, "OK" and "Not OK", and still ignore blanks.
And I cannot get it to work, however I rewrite the formula. The latest iteration returns "OK" if "OK" is found in any of the cells, even tho one or more contain "Not OK".

What am I missing?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
are you doing differently?

Book1
ABCD
1OK3OK
2OK4Not OK
3OK
4
5NOT OK
6NOT OK
7
8NOT OK
9NOT OK
Sheet8
Cell Formulas
RangeFormula
C1C1=COUNTIF(A:A,"OK")
C2C2=COUNTIF(A:A,"NOT OK")
 
Upvote 0
How about
=IF(COUNTIFS(A:A,"Not ok")>0,"Not Ok","Ok")
 
Upvote 0
Hi Fluff

Close.
But if all cells in range are blank, your formula returns "OK". Should be "Not OK" then.
 
Upvote 0
Ok, how about
=IF(AND(COUNTIFS(A:A,"ok"),COUNTIFS(A:A,"Not ok")=0),"Ok","Not Ok")
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,406
Messages
6,119,330
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top