Comparing 2 text cells in an if statement

W

wrkingurl

Example:
Column A2 = NO (this is from an if statement)
Column B2 = NO (this is from an if statement)

What I need, is another IF statement in column C2 that is:
If A2 = No and B2 = No then column c2 would read OK, else, NOT OK

I can do this with numbers, but am having trouble with bringing back results
from anything that is Text.
 
J

JoeU2004

wrkingurl said:
What I need, is another IF statement in column C2 that is:
If A2 = No and B2 = No then column c2 would read OK, else, NOT OK

Ostensibly, the following should work (in C2):

=if(and(A2="No",B2="No"),"OK","NOT OK")

But you write:
I can do this with numbers, but am having trouble with bringing
back results from anything that is Text.

If you tried the above (by copy-and-paste) and it still does not work, the
problem might leading or trailing spaces about the text. Try:

=if(and(trim(A2)="No",trim(B2)="No"),"OK,"NOT OK")

If neither of those work for you, I suggest that you post the exact contents
of A2 and B2, allow with the results of TYPE() and LEN(). As I recall,
TRIM() does work with some other ASCII characters that appear as
"whitespace" (blank space).


----- original posting -----
 
W

wrkingurl

Thank you Joel2004! I tried the first statement and it worked perfectly.
You really saved me big time, I appreciate it!
--
thanks,
Wurkingurl


JoeU2004 said:
wrkingurl said:
What I need, is another IF statement in column C2 that is:
If A2 = No and B2 = No then column c2 would read OK, else, NOT OK

Ostensibly, the following should work (in C2):

=if(and(A2="No",B2="No"),"OK","NOT OK")

But you write:
I can do this with numbers, but am having trouble with bringing
back results from anything that is Text.

If you tried the above (by copy-and-paste) and it still does not work, the
problem might leading or trailing spaces about the text. Try:

=if(and(trim(A2)="No",trim(B2)="No"),"OK,"NOT OK")

If neither of those work for you, I suggest that you post the exact contents
of A2 and B2, allow with the results of TYPE() and LEN(). As I recall,
TRIM() does work with some other ASCII characters that appear as
"whitespace" (blank space).


----- original posting -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top