Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old June 3rd 15, 02:40 PM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2009
Posts: 5
Default IF Statement return wrong comparison

I have a If statement in L95 as follows: IF(L95="District Did Not Investigate" and L95 contains this statement It returns a FALSE answer when the answer should be TRUE. WHY?

  #2   Report Post  
Old June 4th 15, 01:12 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2013
Posts: 16
Default IF Statement return wrong comparison

On Wednesday, 3 June 2015 23:40:42 UTC+10, Don B wrote:
I have a If statement in L95 as follows: IF(L95="District Did Not Investigate" and L95 contains this statement It returns a FALSE answer when the answer should be TRUE. WHY?


Most likely there's an extra space in the text in L95 or a change of case somewhere. One way to get around this would be to change your formula to start
=IF(TRIM(UPPER(L95))="DISTRICT DID NOT INVESTIGATE" ...

That should give the right result whether or not there are extra spaces around the text or the case is incorrect.

Howard


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
I'm trying to do a comparison if statement but it is not working!! Brett Smith[_2_] Excel Programming 4 February 28th 06 06:52 PM
wts wrong with this statement Jason Excel Worksheet Functions 2 February 24th 06 02:26 PM
HELP: Comparison IF statement R Weeden Excel Worksheet Functions 6 February 6th 06 08:55 PM
Date Comparison and IF statement Holly Excel Worksheet Functions 4 January 19th 06 01:01 AM
Comparison Operators for IF statement. Shams Excel Worksheet Functions 1 February 14th 05 03:35 PM


All times are GMT +1. The time now is 06:19 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017