Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing Text to Several Cells Pontus Excel Discussion (Misc queries) 4 July 4th 08 04:01 PM
Comparing text within cells in two columns Billing Excel Worksheet Functions 2 April 30th 07 02:00 PM
Comparing cells with text Mortir Excel Worksheet Functions 4 January 3rd 07 10:54 PM
comparing text cells Comander Excel Worksheet Functions 2 June 5th 06 10:00 PM
Comparing text strings in cells Andy Excel Discussion (Misc queries) 0 January 11th 06 10:38 AM


All times are GMT +1. The time now is 07:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"