Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
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. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Comparing Text to Several Cells | Excel Discussion (Misc queries) | |||
Comparing text within cells in two columns | Excel Worksheet Functions | |||
Comparing cells with text | Excel Worksheet Functions | |||
comparing text cells | Excel Worksheet Functions | |||
Comparing text strings in cells | Excel Discussion (Misc queries) |