Comparing 2 text cells in an if statement
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. -- thanks, Wurkingurl |
Comparing 2 text cells in an if statement
"wrkingurl" wrote:
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 ----- "wrkingurl" wrote in message ... 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. -- thanks, Wurkingurl |
Comparing 2 text cells in an if statement
=IF(AND(A2="NO",B2="NO"),"OK","NOT OK")
Gord Dibben MS Excel MVP On Mon, 23 Mar 2009 16:21:03 -0700, wrkingurl wrote: 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. |
Comparing 2 text cells in an if statement
Thank you Joel2004! I tried the first statement and it worked perfectly.
You really saved me big time, I appreciate it! -- thanks, Wurkingurl "JoeU2004" wrote: "wrkingurl" wrote: 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 ----- "wrkingurl" wrote in message ... 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. -- thanks, Wurkingurl |
All times are GMT +1. The time now is 02:24 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com