Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default testing for left 2 characters in set of 3 choices

following returns true even if false
a1=ab1234
b1=if(left A1,2)=or("cd","ef","gh"),1,2) test if A1=cd or ef or gh, true
1, false 2
the above should return 2 false but returns 1 true in error?
I tried formula evaluation and it shows "ab"=false but then evalutes
combined to true in error.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default testing for left 2 characters in set of 3 choices

=IF(OR(LEFT(A1,2)={"cd","ef","gh"}),1,2)

--
Gary''s Student - gsnu200909
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,276
Default testing for left 2 characters in set of 3 choices

Hi,
=IF(OR(LEFT(A1,2)="cd",LEFT(A1,2)="ef",LEFT(A1,2)= "gh"),1,2)

"MusicMan" wrote:

following returns true even if false
a1=ab1234
b1=if(left A1,2)=or("cd","ef","gh"),1,2) test if A1=cd or ef or gh, true
1, false 2
the above should return 2 false but returns 1 true in error?
I tried formula evaluation and it shows "ab"=false but then evalutes
combined to true in error.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 506
Default testing for left 2 characters in set of 3 choices

Use your formula like the below:-

=IF(OR(LEFT(A1,2)="CD",LEFT(A1,2)="EF",LEFT(A1,2)= "GH"),"TRUE 1","FALSE 2")

Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"MusicMan" wrote:

following returns true even if false
a1=ab1234
b1=if(left A1,2)=or("cd","ef","gh"),1,2) test if A1=cd or ef or gh, true
1, false 2
the above should return 2 false but returns 1 true in error?
I tried formula evaluation and it shows "ab"=false but then evalutes
combined to true in error.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default testing for left 2 characters in set of 3 choices

You'll need to show us exactly what is in your formulae, and explain more
clearly what your problem is.

=if(left A1,2)=or("cd","ef","gh"),1,2) would not be a valid formula, as the
parentheses don't match.
When you've sorted out the parentheses, you've still got =OR("cd","ef","gh")
which is feeding text strings into a function that wants Boolean inputs, so
it gives a #VALUE! error.

Start again, but this time be more precise with the wording of your
question.
--
David Biddulph

"MusicMan" wrote in message
...
following returns true even if false
a1=ab1234
b1=if(left A1,2)=or("cd","ef","gh"),1,2) test if A1=cd or ef or gh, true
1, false 2
the above should return 2 false but returns 1 true in error?
I tried formula evaluation and it shows "ab"=false but then evalutes
combined to true in error.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default testing for left 2 characters in set of 3 choices

=AND(LEFT(A1,2)<{"cd","ef","gh"})+1


"MusicMan" wrote:

following returns true even if false
a1=ab1234
b1=if(left A1,2)=or("cd","ef","gh"),1,2) test if A1=cd or ef or gh, true
1, false 2
the above should return 2 false but returns 1 true in error?
I tried formula evaluation and it shows "ab"=false but then evalutes
combined to true in error.

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
Get characters on left of specified character in Excel Murugan Excel Discussion (Misc queries) 3 April 2nd 23 04:15 PM
Find duplicates with left 4 characters brumanchu Excel Discussion (Misc queries) 3 September 15th 09 03:11 PM
Excel 2003, SUM left-most characters David Aukerman Excel Worksheet Functions 13 January 15th 09 03:35 AM
Easiest way to extract characters in a cell LEFT or RIGHT of a sym Training Goddess Excel Worksheet Functions 2 May 29th 07 09:05 PM
HOW DO I EXTRACT ALL CHARACTERS AFTER 5 CHARACTERS ON LEFT GRYSYF Excel Worksheet Functions 5 October 12th 05 10:58 AM


All times are GMT +1. The time now is 08:46 PM.

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"