#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 138
Default IF,AND,OR

Hi, I have 2 formulas which I use and I wish to combine them in one formula...
In the same cell I have 2 things I am trying to pick out..

The following
LON/AMS/LON
I do this with formula which was kindly given by this forum...
=IF(AND(left(f2,3)=right(f2,3),len(f2)=11),"yes"," no")

I also look for
LON/AMS/NYC/AMS/LON
I use 2 formulas for this
=LEN(cell reference) to find all cells with 19 characters.
a second formula is
=IF((LEFT(A1,3)&MID(A1,5,3))=(RIGHT(A1,3)&MID(A1,1 3,3)),"YES","NO")

I really need to combine all 3 formulas above into one so that it will say
yes to either of the above strings of data, or no, if it meets neither
criteria.. can you help?

Many thanks
Paula




  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default IF,AND,OR

Maybe

=IF(AND(LEFT(A1,3)=RIGHT(A1,3),LEN(A1)=11),"yes",I F(AND(LEFT(A1,3)&MID(A1,5,3)=(RIGHT(A1,3)&MID(A1,1 3,3)),LEN(A1)=19),"YES","NO"))

Mike

"Paula" wrote:

Hi, I have 2 formulas which I use and I wish to combine them in one formula...
In the same cell I have 2 things I am trying to pick out..

The following
LON/AMS/LON
I do this with formula which was kindly given by this forum...
=IF(AND(left(f2,3)=right(f2,3),len(f2)=11),"yes"," no")

I also look for
LON/AMS/NYC/AMS/LON
I use 2 formulas for this
=LEN(cell reference) to find all cells with 19 characters.
a second formula is
=IF((LEFT(A1,3)&MID(A1,5,3))=(RIGHT(A1,3)&MID(A1,1 3,3)),"YES","NO")

I really need to combine all 3 formulas above into one so that it will say
yes to either of the above strings of data, or no, if it meets neither
criteria.. can you help?

Many thanks
Paula




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 138
Default IF,AND,OR

Hi Mike,

Thanks so much for the advice, I changed the And to Or and it worked when I
did this, many thanks
Paula


"Mike H" wrote:

Maybe

=IF(AND(LEFT(A1,3)=RIGHT(A1,3),LEN(A1)=11),"yes",I F(AND(LEFT(A1,3)&MID(A1,5,3)=(RIGHT(A1,3)&MID(A1,1 3,3)),LEN(A1)=19),"YES","NO"))

Mike

"Paula" wrote:

Hi, I have 2 formulas which I use and I wish to combine them in one formula...
In the same cell I have 2 things I am trying to pick out..

The following
LON/AMS/LON
I do this with formula which was kindly given by this forum...
=IF(AND(left(f2,3)=right(f2,3),len(f2)=11),"yes"," no")

I also look for
LON/AMS/NYC/AMS/LON
I use 2 formulas for this
=LEN(cell reference) to find all cells with 19 characters.
a second formula is
=IF((LEFT(A1,3)&MID(A1,5,3))=(RIGHT(A1,3)&MID(A1,1 3,3)),"YES","NO")

I really need to combine all 3 formulas above into one so that it will say
yes to either of the above strings of data, or no, if it meets neither
criteria.. can you help?

Many thanks
Paula




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



All times are GMT +1. The time now is 07:57 PM.

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

About Us

"It's about Microsoft Excel"