Compare two cells with text (1 Viewer)

echorley

Registered User.
Local time
Yesterday, 22:19
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).
 

ajetrumpet

Banned
Local time
Yesterday, 21:19
Joined
Jun 22, 2007
Messages
5,638
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...
 

HaHoBe

Locomotive Breath
Local time
Today, 04:19
Joined
Mar 1, 2002
Messages
233
Hi, echorley,

additional spaces?

Code:
=IF(TRIM(A2)=TRIM(B2),"Yes","No")
Ciao,
Holger
 

Access Hero

Registered User.
Local time
Yesterday, 21:19
Joined
Oct 29, 2008
Messages
96
Also try trimming the values. Like this:
Code:
=IF(TRIM(A2) = TRIM(B2), "Yes", "No")
 

Users who are viewing this thread

Top Bottom