ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF function question (https://www.excelbanter.com/excel-worksheet-functions/201689-if-function-question.html)

scubadiver

IF function question
 

The two columns I am comparing are text. In another column I have this:

=IF(G5=O5,1,0)

As an example, I have "237A98" in the same row in G5 and O5 but when I
evaluate this function it brings back '0', not '1'.

Anyone know why?


Mike H

IF function question
 
Could additional spaces be a problem?

Try this

=(TRIM(G5)=TRIM(O5))*1

Mike

"scubadiver" wrote:


The two columns I am comparing are text. In another column I have this:

=IF(G5=O5,1,0)

As an example, I have "237A98" in the same row in G5 and O5 but when I
evaluate this function it brings back '0', not '1'.

Anyone know why?


scubadiver

IF function question
 

duh!

thanks for pointing out what wasn't very obvious.

"Mike H" wrote:

Could additional spaces be a problem?

Try this

=(TRIM(G5)=TRIM(O5))*1

Mike

"scubadiver" wrote:


The two columns I am comparing are text. In another column I have this:

=IF(G5=O5,1,0)

As an example, I have "237A98" in the same row in G5 and O5 but when I
evaluate this function it brings back '0', not '1'.

Anyone know why?



All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com