Compare two cells with text

echorley

Registered User.
Local time
Today, 18:30
Joined
Mar 11, 2003
Messages
131
How do I compare two cells in a spreadsheet with each other using the IF statement. For example: =IF(A2 = B2, "Yes", "No") always gives me No eventhough A2 = C and B2 = C (both contain an upper case C).
 
How do I compare two cells in a spreadsheet with each other using the IF statement. For example: =IF(A2 = B2, "Yes", "No") always gives me No eventhough A2 = C and B2 = C (both contain an upper case C).

TRY refreshing the page with F9. maybe also check the cell type? cell formatting? try it in other cells too...to narrow down the problem cells...
 
Hi, echorley,

additional spaces?

Code:
=IF(TRIM(A2)=TRIM(B2),"Yes","No")
Ciao,
Holger
 
Also try trimming the values. Like this:
Code:
=IF(TRIM(A2) = TRIM(B2), "Yes", "No")
 

Users who are viewing this thread

Back
Top Bottom