IF,AND,OR

P

Paula

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,13,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
 
M

Mike H

Maybe

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

Mike
 
P

Paula

Hi Mike,

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top